coderamp-labs /gitingest

Replace 'hub' with 'ingest' in any GitHub URL to get a prompt-friendly extract of a codebase

★ 16,142⑂ 1,217👁 57⑃ 370● 241▤ 7
PythonMITCreated 2024-11-29gitingest.com
Download: v0.3.1v0.3.1 ↓0.3.12025-07-31
+3
Daily
16,142
stars
1,217
forks
57
watchers
370
prs
241
issues
7
releases

README

Gitingest






  
  
  
  
  
  

  
  
  
  
  
  
  
  
  



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


Deutsch |
Español |
Français |
日本語 |
한국어 |
Português |
Русский |
中文

 🚀 Features

- 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

 📚 Requirements

- Python 3.8+
- For private repositories: A GitHub Personal Access Token (PAT). Generate your token here!

 📦 Installation

Gitingest is available on PyPI.
You can install it using pip:

bash
pip install gitingest


or

bash
pip install gitingest[server]


to include server dependencies for self-hosting.

However, it might be a good idea to use pipx to install it.
You can install pipx using your preferred package manager.

bash
brew install pipx
apt install pipx
scoop install pipx
...


If you are using pipx for the first time, run:

bash
pipx ensurepath


bash
 install gitingest
pipx install gitingest


 🧩 Browser Extension Usage







The extension is open source at lcandy2/gitingest-extension.

Issues and feature requests are welcome to the repo.

 💡 Command line usage

The gitingest command line tool allows you to analyze codebases and create a text dump of their contents.

bash
 Basic usage (writes to digest.txt by default)
gitingest /path/to/directory

 From URL
gitingest https://github.com/coderamp-labs/gitingest

 or from specific subdirectory
gitingest https://github.com/coderamp-labs/gitingest/tree/main/src/gitingest/utils


For private repositories, use the --token/-t option.

bash
 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-repo

 Include repository submodules
gitingest https://github.com/username/repo-with-submodules --include-submodules


By default, files listed in .gitignore are skipped. Use --include-gitignored if you
need those files in the digest.

By default, the digest is written to a text file (digest.txt) in your current working directory. You can customize the output in two ways:

- Use --output/-o  to write to a specific file.
- Use --output/-o - to output directly to STDOUT (useful for piping to other tools).

See more options and usage details with:

bash
gitingest --help


 🐍 Python package usage

python
 Synchronous usage
from gitingest import ingest

summary, tree, content = ingest("path/to/directory")

 or from URL
summary, tree, content = ingest("https://github.com/coderamp-labs/gitingest")

 or from a specific subdir

Top issues

Discussions

Latest release

v0.3.1 v0.3.1 2025-07-31
0.3.1 (2025-07-31)


 Bug Fixes

 make cache aware of subpaths (481) (8b59bef)

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON