@@ -61,10 +61,40 @@ class _CLIArgs(TypedDict):
6161 "--output" ,
6262 "-o" ,
6363 default = None ,
64- help = "Write to PATH (or '-' for stdout, default: <repo>.txt) ." ,
64+ help = "Output file path (default: digest.txt in current directory). Use '-' for stdout." ,
6565)
6666def main (** cli_kwargs : Unpack [_CLIArgs ]) -> None :
67- """Run the CLI entry point to analyze a repo / directory and dump its contents."""
67+ """Run the CLI entry point to analyze a repo / directory and dump its contents.
68+
69+ Parameters
70+ ----------
71+ **cli_kwargs : Unpack[_CLIArgs]
72+ A dictionary of keyword arguments forwarded to ``ingest_async``.
73+
74+ Notes
75+ -----
76+ See ``ingest_async`` for a detailed description of each argument.
77+
78+ Examples
79+ --------
80+ Basic usage:
81+ $ gitingest
82+ $ gitingest /path/to/repo
83+ $ gitingest https://github.com/user/repo
84+
85+ Output to stdout:
86+ $ gitingest -o -
87+ $ gitingest https://github.com/user/repo --output -
88+
89+ With filtering:
90+ $ gitingest -i "*.py" -e "*.log"
91+ $ gitingest --include-pattern "*.js" --exclude-pattern "node_modules/*"
92+
93+ Private repositories:
94+ $ gitingest https://github.com/user/private-repo -t ghp_token
95+ $ GITHUB_TOKEN=ghp_token gitingest https://github.com/user/private-repo
96+
97+ """
6898 asyncio .run (_async_main (** cli_kwargs ))
6999
70100
@@ -88,7 +118,7 @@ async def _async_main(
88118 Parameters
89119 ----------
90120 source : str
91- Directory path or Git repository URL.
121+ A directory path or a Git repository URL.
92122 max_size : int
93123 Maximum file size in bytes to ingest (default: 10 MB).
94124 exclude_pattern : tuple[str, ...] | None
@@ -103,7 +133,7 @@ async def _async_main(
103133 GitHub personal access token (PAT) for accessing private repositories.
104134 Can also be set via the ``GITHUB_TOKEN`` environment variable.
105135 output : str | None
106- Destination file path. If ``None``, the output is written to ``<repo_name> .txt`` in the current directory.
136+ The path where the output file will be written (default: ``digest .txt`` in current directory) .
107137 Use ``"-"`` to write to ``stdout``.
108138
109139 Raises
0 commit comments