Skip to content

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

License

Notifications You must be signed in to change notification settings

cyclotruc/gitingest

Repository files navigation

Gitingest

Image

License PyPI version GitHub stars Downloads

Discord

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 Β· Chrome Extension Β· Firefox Add-on

πŸš€ 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 (currently on Linux only)
  • Python package: Import it in your code

πŸ“¦ Installation

pip install gitingest

🧩 Browser Extension Usage

Available in the Chrome Web Store Get The Add-on for Firefox Get from the Edge Add-ons

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.

# 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.

🌐 Self-host

  1. Build the image:

    docker build -t gitingest .
  2. Run the container:

    docker run -d --name gitingest -p 8000:8000 gitingest

The 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"

βœ”οΈ Contributing to Gitingest

Non-technical ways to contribute

  • Create an Issue: If you find a bug or have an idea for a new feature, please create an issue on GitHub. This will help us track and prioritize your request.
  • Spread the Word: If you like Gitingest, please share it with your friends, colleagues, and on social media. This will help us grow the community and make Gitingest even better.
  • Use Gitingest: The best feedback comes from real-world usage! If you encounter any issues or have ideas for improvement, please let us know by creating an issue on GitHub or by reaching out to us on Discord.

Technical ways to contribute

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.

πŸ› οΈ Stack

Looking for a JavaScript/Node package?

Check out the NPM alternative πŸ“¦ Repomix: https://github.com/yamadashy/repomix

Project Growth

Star History Chart