Skip to main content

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

Project description

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 corresponding 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
  • Python package: Import it in your code

📚 Requirements

  • Python 3.7+

📦 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

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

# Asynchronous usage
from gitingest import ingest_async
import asyncio

result = asyncio.run(ingest_async("path/to/directory"))

Jupyter notebook usage

from gitingest import ingest_async

# Use await directly in Jupyter
summary, tree, content = await ingest_async("path/to/directory")

This is because Jupyter notebooks are asynchronous by default.

🐳 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

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/FileSystemNode package?

Check out the NPM alternative 📦 Repomix: https://github.com/yamadashy/repomix

🚀 Project Growth

Star History Chart

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.4.tar.gz (40.6 kB view details)

Uploaded Source

Built Distribution

gitingest-0.1.4-py3-none-any.whl (40.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gitingest-0.1.4.tar.gz
  • Upload date:
  • Size: 40.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for gitingest-0.1.4.tar.gz
Algorithm Hash digest
SHA256 b3e537bb38152c48084dcb745e4d32665271a5f16306182628c69d39f615e427
MD5 17bb3e95c8c322345cd6f3764a331e02
BLAKE2b-256 b1ffd94a7dd5ce2437efa020d57cd5eb8d1f9ac31c6bf8c4ce98dab63890f549

See more details on using hashes here.

Provenance

The following attestation bundles were made for gitingest-0.1.4.tar.gz:

Publisher: publish.yml on cyclotruc/gitingest

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: gitingest-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 40.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for gitingest-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0f61f8a98aa527613fde5c3ae13243f42c2e9698fbbe7c0794f19bc62eedc093
MD5 de4deeaf8c2f1d0c6d1ea5632f5df85a
BLAKE2b-256 722bdf9747f305cd384c36b791121b150ab00d399e20b0b679f0966d3e6588a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for gitingest-0.1.4-py3-none-any.whl:

Publisher: publish.yml on cyclotruc/gitingest

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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