cyclotruc / gitingest
- Π²ΠΎΡΠΊΡΠ΅ΡΠ΅Π½ΡΠ΅, 22 ΠΈΡΠ½Ρ 2025β―Π³. Π² 00:00:02
Replace 'hub' with 'ingest' in any github url to get a prompt-friendly extract of a codebase
Turn any Git repository into a prompt-friendly text ingest for LLMs.
You can also replace hub with ingest in any GitHub URL to access the corresponding digest.
gitingest.com Β· Chrome Extension Β· Firefox Add-on
Gitingest is available on PyPI.
You can install it using pip:
pip install gitingestHowever, it might be a good idea to use pipx 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 gitingestThe 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 (writes to digest.txt by default)
gitingest /path/to/directory
# From URL
gitingest https://github.com/cyclotruc/gitingestFor private repositories, use the --token/-t option.
# Get your token from https://github.com/settings/personal-access-tokens
gitingest https://github.com/username/private-repo --token github_pat_...
# Or set it as an environment variable
export GITHUB_TOKEN=github_pat_...
gitingest https://github.com/username/private-repoBy default, the digest is written to a text file (digest.txt) in your current working directory. You can customize the output in two ways:
--output/-o <filename> to write to a specific file.--output/-o - to output directly to STDOUT (useful for piping to other tools).See more options and usage details with:
gitingest --help# 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")For private repositories, you can pass a token:
# Using token parameter
summary, tree, content = ingest("https://github.com/username/private-repo", token="github_pat_...")
# Or set it as an environment variable
import os
os.environ["GITHUB_TOKEN"] = "github_pat_..."
summary, tree, content = ingest("https://github.com/username/private-repo")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.
Build the image:
docker build -t gitingest .Run the container:
docker run -d --name gitingest -p 8000:8000 gitingestThe 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"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.
Check out the NPM alternative π¦ Repomix: https://github.com/yamadashy/repomix