Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

License

NotificationsYou must be signed in to change notification settings

coderamp-labs/gitingest

Repository files navigation

Screenshot of Gitingest front page

PyPIPython Versions
CIRuffOpenSSF Scorecard
LicenseDownloadsGitHub StarsDiscord
Trendshift

Turn any Git repository into a prompt-friendly text ingest for LLMs.

You can also replacehub withingest in any GitHub URL to access the corresponding digest.

gitingest.com ·Chrome Extension ·Firefox Add-on

Deutsch |Español |Français |日本語 |한국어 |Português |Русский |中文

🚀 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

📦 Installation

Gitingest is available onPyPI.You can install it usingpip:

pip install gitingest

However, it might be a good idea to usepipx to install it.You can installpipx using your preferred package manager.

brew install pipxapt install pipxscoop install pipx...

If you are using pipx for the first time, run:

pipx ensurepath
# install gitingestpipx install gitingest

🧩 Browser Extension Usage

Available in the Chrome Web StoreGet The Add-on for FirefoxGet from the Edge Add-ons

The extension is open source atlcandy2/gitingest-extension.

Issues and feature requests are welcome to the repo.

💡 Command line usage

Thegitingest command line tool allows you to analyze codebases and create a text dump of their contents.

# Basic usage (writes to digest.txt by default)gitingest /path/to/directory# From URLgitingest https://github.com/coderamp-labs/gitingest# or from specific subdirectorygitingest https://github.com/coderamp-labs/gitingest/tree/main/src/gitingest/utils

For private repositories, use the--token/-t option.

# Get your token from https://github.com/settings/personal-access-tokensgitingest https://github.com/username/private-repo --token github_pat_...# Or set it as an environment variableexport GITHUB_TOKEN=github_pat_...gitingest https://github.com/username/private-repo# Include repository submodulesgitingest https://github.com/username/repo-with-submodules --include-submodules

By default, files listed in.gitignore are skipped. Use--include-gitignored if youneed those files in the digest.

By default, the digest is written to a text file (digest.txt) in your current working directory. You can customize the output in two ways:

  • Use--output/-o <filename> to write to a specific file.
  • Use--output/-o - to output directly toSTDOUT (useful for piping to other tools).

See more options and usage details with:

gitingest --help

🐍 Python package usage

# Synchronous usagefromgitingestimportingestsummary,tree,content=ingest("path/to/directory")# or from URLsummary,tree,content=ingest("https://github.com/coderamp-labs/gitingest")# or from a specific subdirectorysummary,tree,content=ingest("https://github.com/coderamp-labs/gitingest/tree/main/src/gitingest/utils")

For private repositories, you can pass a token:

# Using token parametersummary,tree,content=ingest("https://github.com/username/private-repo",token="github_pat_...")# Or set it as an environment variableimportosos.environ["GITHUB_TOKEN"]="github_pat_..."summary,tree,content=ingest("https://github.com/username/private-repo")# Include repository submodulessummary,tree,content=ingest("https://github.com/username/repo-with-submodules",include_submodules=True)

By default, this won't write a file but can be enabled with theoutput argument.

# Asynchronous usagefromgitingestimportingest_asyncimportasyncioresult=asyncio.run(ingest_async("path/to/directory"))

Jupyter notebook usage

fromgitingestimportingest_async# Use await directly in Jupytersummary,tree,content=awaitingest_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 athttp://localhost:8000.

If you are hosting it on a domain, you can specify the allowed hostnames via env variableALLOWED_HOSTS.

# Default: "gitingest.com, *.gitingest.com, localhost, 127.0.0.1".ALLOWED_HOSTS="example.com, localhost, 127.0.0.1"

Environment Variables

The application can be configured using the following environment variables:

  • ALLOWED_HOSTS: Comma-separated list of allowed hostnames (default: "gitingest.com, *.gitingest.com, localhost, 127.0.0.1")
  • GITINGEST_METRICS_ENABLED: Enable Prometheus metrics server (set to any value to enable)
  • GITINGEST_METRICS_HOST: Host for the metrics server (default: "127.0.0.1")
  • GITINGEST_METRICS_PORT: Port for the metrics server (default: "9090")
  • GITINGEST_SENTRY_ENABLED: Enable Sentry error tracking (set to any value to enable)
  • GITINGEST_SENTRY_DSN: Sentry DSN (required if Sentry is enabled)
  • GITINGEST_SENTRY_TRACES_SAMPLE_RATE: Sampling rate for performance data (default: "1.0", range: 0.0-1.0)
  • GITINGEST_SENTRY_PROFILE_SESSION_SAMPLE_RATE: Sampling rate for profile sessions (default: "1.0", range: 0.0-1.0)
  • GITINGEST_SENTRY_PROFILE_LIFECYCLE: Profile lifecycle mode (default: "trace")
  • GITINGEST_SENTRY_SEND_DEFAULT_PII: Send default personally identifiable information (default: "true")

🤝 Contributing

Non-technical ways to contribute

  • Create an Issue: If you find a bug or have an idea for a new feature, pleasecreate 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 bycreating an issue on GitHub or by reaching out to us onDiscord.

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 onDiscord. For detailed instructions on how to make a pull request, seeCONTRIBUTING.md.

🛠️ Stack

Looking for a JavaScript/FileSystemNode package?

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

🚀 Project Growth

Star History Chart

About

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

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

 
 
 

[8]ページ先頭

©2009-2025 Movatter.jp