Heads‑up This repository is an independent fork of the fantastic cyclotruc/gitingest. We aim for zero‑surprise Docker usage on WSL 2 / Linux while tracking upstream features. Huge thanks 🙏 to the original authors for making the project MIT‑licensed and hack‑friendly!
If you want the pristine upstream package, just run
pip install gitingest– see the Installation section below.
Turn any Git repository into a prompt‑friendly text digest you can feed to an LLM – plus a one‑command container workflow.
You can also replace hub with ingest in any GitHub URL to access the
corresponding digest (This uses the orginal app for now):
https://github.com/cyclotruc/gitingest
gitingest.com · Chrome Extension · Firefox Add-on
| Change | Why it matters |
|---|---|
Docker‑first workflow (docker-compose.yml) |
docker compose up -d → http://localhost:9090. |
entrypoint.sh |
Auto‑chowns cache dir so non‑root container user can write. |
.env template |
Central place for hosts, debug flag, size limit, PAT token. |
| Ext4‑friendly docs | No more drvfs chown errors on WSL 2. |
LF enforcement (.gitattributes) |
Prevents bash\r shebang crashes. |
Developer option: uv |
Conflict‑free, deterministic Python installs. |
- CLI & Python API – generate a
digest.txtwith one command or one import. - Web UI – paste any repo URL, tweak include/exclude patterns.
- Chrome / Firefox add‑ons – swap hub → ingest automatically.
- Self‑host – single
docker compose up -d(this fork). - Easy code context: Get a text digest from a Git repository URL or a directory
- Smart Formatting: Optimized output format for LLM prompts
- Statistics about:
- File and directory structure
- Size of the extract
- Token count
- CLI tool: Run it as a shell command
- Python package: Import it in your code
| Tool | Version |
|---|---|
| Python | ≥ 3.8 |
| Git | any |
| Docker + Compose | ≥ v20 (for container workflow) |
| Linux (Optional) | optional but recommended |
| WSL 2 (Windows - Optional) | optional but recommended |
Gitingest is available on PyPI.
You can install it using pip:
pip install gitingest # installs cyclotruc/gitingest from PyPIHowever, it might be a good idea to use pipx or uv to install it.
You can install pipx using your preferred package manager.
brew install pipx
apt install pipx
scoop install pipx
...If you are using pipx for the first time, run:
pipx ensurepath# install gitingest
pipx install gitingest# clone inside WSL 2 ext4 (or native Linux)
$ git clone https://github.com/<your‑org>/gitingest.git ~/dev/gitingest
$ cd ~/dev/gitingest
# prepare runtime bits
$ cp .env.example .env # tweak if needed
$ mkdir -p cache
# build & run
$ docker compose build --pull
$ docker compose up -d
→ http://localhost:9090pip install -U uv # Rust‑powered installer
uv pip compile --all-extras -o requirements.txt pyproject.toml
uv venv .venv && source .venv/bin/activate
uv pip install -r requirements.txtThe extension is open source at lcandy2/gitingest-extension.
Issues and feature requests are welcome to the repo.
The gitingest command line tool allows you to analyze codebases and create a text dump of their contents.
# Basic usage
gitingest /path/to/directory
# From URL
gitingest https://github.com/cyclotruc/gitingest
# See more options
gitingest --helpThis will write the digest in a text file (default digest.txt) in your current working directory.
# Synchronous usage
from gitingest import ingest
summary, tree, content = ingest("path/to/directory")
# or from URL
summary, tree, content = ingest("https://github.com/cyclotruc/gitingest")By default, this won't write a file but can be enabled with the output argument.
# Asynchronous usage
from gitingest import ingest_async
import asyncio
result = asyncio.run(ingest_async("path/to/directory"))from gitingest import ingest_async
# Use await directly in Jupyter
summary, tree, content = await ingest_async("path/to/directory")This is because Jupyter notebooks are asynchronous by default.
This fork adds a single‑file stack:
# build image & start
$ docker compose up -d --build
# env vars live in .env
ALLOWED_HOSTS=localhost,127.0.0.1
GITINGEST_DEBUG=false- Container user:
appuser(UID 1000). - Cache path:
./cache→/tmp/gitingest. - Health check:
GET /health.
WSL 2 users must clone on ext4 (e.g. ~/dev/...).
By default Gitingest now splits Python/JS files into functions & classes using Tree-sitter (like Repomix). Unknown filetypes fall back to whole-file.
--parallel(default ON): scan files with 8 threads.--incremental: skip unchanged files using SHA cache in~/.gitingestcache.--compress: writedigest.txt.gz(≈ 10× smaller on monorepos).--stream: fetch files directly from GitHub without creating a.gitdirectory.
- Secrets are auto-redacted using
detect-secrets. - Path traversal protection blocks
../and unsafe symlinks. - Rate limit: set
RATE_LIMIT_PER_MIN=60in.env(0 disables).
Original method:
-
Build the image:
docker build -t gitingest . -
Run the container:
docker run -d --name gitingest -p 8000:8000 gitingest
The application will be available at http://localhost:8000.
If you are hosting it on a domain, you can specify the allowed hostnames via env variable ALLOWED_HOSTS.
# Default: "gitingest.com, *.gitingest.com, localhost, 127.0.0.1".
ALLOWED_HOSTS="example.com, localhost, 127.0.0.1"- Create an Issue: If you find a bug or have an idea for a new feature, please create an issue on GitHub. This will help us track and prioritize your request.
- Spread the Word: If you like Gitingest, please share it with your friends, colleagues, and on social media. This will help us grow the community and make Gitingest even better.
- Use Gitingest: The best feedback comes from real-world usage! If you encounter any issues or have ideas for improvement, please let us know by creating an issue on GitHub or by reaching out to us on Discord.
Gitingest aims to be friendly for first time contributors, with a simple Python and HTML codebase. If you need any help while working with the code, reach out to us on Discord. For detailed instructions on how to make a pull request, see CONTRIBUTING.md.
- Run
pre‑commit install– hooks enforce LF & ruff/black. - Commit new shell scripts with
chmod +x. - PR title prefix:
feat(docker): …,fix(ci): …, etc.
- Tailwind CSS - Frontend
- FastAPI - Backend framework
- Jinja2 - HTML templating
- tiktoken - Token estimation
- posthog - Amazing analytics
Check out the NPM alternative 📦 Repomix: https://github.com/yamadashy/repomix
(Star history chart courtesy of https://starchart.cc.)
This fork remains under the MIT License. Credit to @cyclotruc and contributors for the original implementation.
