Gitingest is designed to convert any Git repository into a text summary suitable for large language model (LLM) prompts, making it easy to use in code contexts.
Purpose
- Obtain text summaries from Git repository URLs or directories to provide LLMs with easy-to-use code context.
- Supports public and private repositories (private repositories require a GitHub personal access token, PAT).
Key capabilities
- Intelligent formatting: The output format is optimized for LLM prompts.
- Statistics: Provides file and directory structure, the size of the extracted content, and token counts.
- Multiple usage methods:
- Web service: Replace "hub" in any GitHub URL with "ingest" to access the corresponding summary (e.g., gitingest.com).
- Browser extensions: Provides a Chrome extension and a Firefox add-on.
- Command-line tool (CLI): Can be run as a shell command.
- Python package: Can be imported and used in code.
- Self-hosting: Deploy via Docker.
Usage
Installation
- Install via PyPI:
pip install gitingest(If server dependencies for self-hosting are needed, additional dependencies can be installed). - Installing with pipx is recommended:
pipx install gitingest.
Command-line usage
- Basic command:
gitingest <repository_url>. - Private repositories: Use the
--token/-toption to provide a PAT. - By default, files listed in
.gitignoreare skipped; use--include-gitignoredto include these files. - By default, the summary is written to
digest.txtin the current working directory; use--output/-o <filename>to specify an output file, or use--output/-o -to output to standard output (convenient for piping). - View more options:
gitingest --help.
Python package usage
- Import gitingest and call the relevant functions; a token can be passed for private repositories.
- By default, no file is written; this can be enabled via the output parameter.
- When using in a Jupyter notebook, note the asynchronous behavior.
Browser extensions
- A Chrome extension and a Firefox add-on are available; the extension is open source at lcandy2/gitingest-extension.
Self-hosting (Docker)
- Build the image:
docker build -t gitingest . - Run the container:
docker run -d --name gitingest -p 8000:8000 gitingest - The application can be accessed via http://localhost:8000 .
- It can be configured via environment variables, such as
ALLOWED_HOSTS、GITINGEST_METRICS_ENABLED、GITINGEST_SENTRY_ENABLED, etc. - Using Docker Compose: The project includes
compose.yml, which defines theapp(production),app-dev(development), andminio(S3-compatible storage for development) services.- Development mode:
docker compose --profile dev up - Production mode:
docker compose --profile prod up
- Development mode:
Use cases
- Developers need to quickly convert a codebase into text format for LLM analysis or prompting.
- Code understanding, summarization, or question answering in LLM applications.
- Extracting codebase structure in educational or research scenarios.
Limitations
- Private repositories require a GitHub PAT.
- By default,
.gitignorefiles are skipped, which may omit some content. - Self-hosting requires a Docker environment.
- Details such as specific performance, fees, pricing, and platform support are not yet provided.