Skip to main content

CLI tool to analyze and create text dumps of codebases for LLMs

Project description

Image

License

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

gitingest.com

🚀 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
  • 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

🌐 Self-host

  1. Build the image:
docker build -t gitingest .
  1. 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

  1. Provide your feedback and ideas on discord
  2. Open an Issue on github to report a bug
  3. 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

  1. Clone the repository
git clone https://github.com/cyclotruc/gitingest.git
cd gitingest
  1. Install dependencies
pip install -r requirements.txt
  1. Run the application:
cd src
uvicorn main:app --reload

The frontend will be available at localhost:8000

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

gitingest-0.1.2.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

gitingest-0.1.2-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file gitingest-0.1.2.tar.gz.

File metadata

  • Download URL: gitingest-0.1.2.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.3

File hashes

Hashes for gitingest-0.1.2.tar.gz
Algorithm Hash digest
SHA256 7103f13ed890d3a04252adbde4d38e3125a4bbf581bbbf8e1fe5304c15ca3292
MD5 90947a7283f9918dd28bb63fca85ae59
BLAKE2b-256 902e96067d09e77692888a9ac5f0a664604c44f8e187f784a1f43fe002e46403

See more details on using hashes here.

File details

Details for the file gitingest-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: gitingest-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.3

File hashes

Hashes for gitingest-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c57cb2327bc1fd79e7c694d1a1ae7a6f2f39fd39a347a7ddf5d00fe2606d612d
MD5 d62ee04024878a22619414854b316a92
BLAKE2b-256 d32596db2ebd578c1d887fc95f82988d3257d7a875099ac72be8a33d3570996f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page