* chore: add pre-commit config, type hints, badges, and lint codebase - Add .pre-commit-config.yaml and pyproject.toml for Black and isort - Add missing type hints throughout the code (Dict[...] for Python 3.8 compatibility) - Added badges and convert existing badges to use <a><img></a> format - Lint Markdown files - Lint Jinja templates with djlint * Resolve error and fix remaining type hint violations * Fix absolute imports and mock paths in test_clone.py to resolve test failures. * Replace deprecated 'dotenv' with 'python-dotenv' in requirements.txt to resolve installation errors. |
||
|---|---|---|
| .github/workflows | ||
| docs | ||
| src | ||
| .dockerignore | ||
| .gitignore | ||
| .pre-commit-config.yaml | ||
| CODE_OF_CONDUCT.md | ||
| Dockerfile | ||
| LICENSE | ||
| pyproject.toml | ||
| pytest.ini | ||
| README.md | ||
| requirements.txt | ||
| SECURITY.md | ||
| setup.py | ||
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 coresponding digest
🚀 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 command (Currently on Linux only)
- Python package: Import it in your code
📦 Installation
pip install gitingest
💡 Command Line usage
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 --help
This will write the digest in a text file (default digest.txt) in your current working directory.
🐛 Python package 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
🛠️ Using
- Tailwind CSS - Frontend
- FastAPI - Backend framework
- tiktoken - Token estimation
- apianalytics.dev - Simple Analytics
🌐 Self-host
- 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
Ensure environment variables are set before running the application or deploying it via Docker.
✔️ Contributing
Contributions are welcome!
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
Ways to contribute
- Provide your feedback and ideas on discord
- Open an Issue on github to report a bug
- Create a Pull request
- Fork the repository
- Make your changes and test them locally
- Open a pull request for review and feedback
🔧 Local dev
Environment Configuration
ALLOWED_HOSTS: Specify allowed hostnames for the application. Default:"gitingest.com,*.gitingest.com,gitdigest.dev,localhost". You can configure the application using the following environment variables:
ALLOWED_HOSTS="gitingest.local,localhost"
Run locally
- Clone the repository
git clone https://github.com/cyclotruc/gitingest.git
cd gitingest
- Install dependencies
pip install -r requirements.txt
- Run the application:
cd src
uvicorn main:app --reload
The frontend will be available at localhost:8000
