CLI tool to analyze and create text dumps of codebases for LLMs
Project description
GitIngest 🔍
gitingest.com - 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
- One-Click Analysis: Simply paste a Git repository URL and get instant pastable context
- Smart Formatting: Optimized output format for LLM prompts
- Statistics about: :
- File and directory structure
- Size of the extract
- (soon) Token count
- Web Interface: Lightweight responsive UI
🛠️ Tech Stack
- Tailwind CSS
- FastAPI - Backend framework
- apianalytics.dev - Usage tracking
📦 Running Tests
To run the tests, first install the test dependencies:
pip install -r requirements.txt
Then run the tests with coverage:
cd src
pytest --cov
To generate a coverage HTML report:
pytest --cov --cov-report=html
The report will be available in htmlcov/index.html
📦 Installation
- 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 application will be available at http://localhost:8000
Docker
- 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
🌐 Environment Configuration
You can configure the application using the following environment variables:
ALLOWED_HOSTS
: Specify allowed hostnames for the application. Default:"gitingest.com,*.gitingest.com,gitdigest.dev,localhost"
.
Example:
ALLOWED_HOSTS="gitingest.local,localhost"
Ensure these variables are set before running the application or deploying it via Docker.
✔️ Contributions are welcome!
Create a pull request or open an Issue about anything you'd like to see in gitingest
🔒 WIP
- Feedback/suggestions: Please open a github Issue or mail me: romain@coderamp.io
- Repository cloning is limited to public GitHub repositories only
- Too big repos will probably timeout (if longer than 20 secondes to clone)
Command Line Global Installation
pip install -e .
Command Line Usage
The gitingest
command line tool allows you to analyze any directory and create a text dump of its contents.
Basic Usage
gitingest /path/to/directory
This will create a text file named after your directory (e.g., directory.txt
) in your current working directory.
Specifying Output Location
gitingest /path/to/directory -o /path/to/output.txt
Options
-o, --output
: Specify the output file path (default:<directory_name>.txt
in current directory)-s, --max-size
: Maximum file size to process in bytes (default: 10MB)-i, --ignore-pattern
: Additional patterns to ignore (can be used multiple times)
Examples
# Basic usage
gitingest ~/projects/myproject
# Custom output location
gitingest ~/projects/myproject -o ~/Desktop/analysis.txt
# Ignore specific file patterns
gitingest ~/projects/myproject -i "*.csv" -i "*.json"
# Set maximum file size (e.g., 5MB)
gitingest ~/projects/myproject -s 5000000
Output Format
The generated text file contains:
- Summary statistics (file count, directory count, content size)
- Directory tree structure
- Contents of all text files
Files and directories that are commonly ignored (like .git
, node_modules
, cache directories, etc.) are automatically excluded. You can add additional patterns to ignore using the -i
flag.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file gitingest-0.1.1.tar.gz
.
File metadata
- Download URL: gitingest-0.1.1.tar.gz
- Upload date:
- Size: 15.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
14fba67cb5c41c603bfc0af2a7e50eedcdb27c46f565103c59a408914eac77ec
|
|
MD5 |
affadd64fe36d524233c014c875190b9
|
|
BLAKE2b-256 |
bf5aee4d1aff67b2e0069e1dc70a219548ad2626bb28e0db85ce969f7dddf9bd
|
File details
Details for the file gitingest-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: gitingest-0.1.1-py3-none-any.whl
- Upload date:
- Size: 17.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
9c64a103bdc6b515d0134ad972bfe8aea404bfd98c5eff7400dc849e7a76b59e
|
|
MD5 |
9bc5fa20df97158f3499a59d5250794a
|
|
BLAKE2b-256 |
80ea1bf8ca4e7fc3448fb38a78c6d676380abfcf33e8523ae7460647d4323f4c
|