GitHub

Distill GitHub Repositories into Perfect LLM Prompts

Gitingest is a powerful Ruby gem that fetches repository files and generates consolidated text prompts optimized for large language models.

zsh - gitingest
$ gem install gitingest
Successfully installed gitingest-0.5.0
1 gem installed
$ gitingest --repository user/repo --token $GITHUB_TOKEN
Fetching repository: user/repo (branch: main)
Found 87 files (excluding system and binary files)
[====================] 100% | ETA: 0s | 87/87 files
Prompt generated: repo_prompt.txt (254 KB)
$ gitingest --repository user/repo --show-structure

Why Use Gitingest

Streamlined Repository Extraction

Extract the essence of any GitHub codebase with precision and transform it into the perfect context for LLM prompting.

Concurrent Processing

Utilizes configurable thread counts to accelerate downloads and intelligently prioritize files for optimal concurrency.

Smart Filtering

Automatically excludes unnecessary binary and system files while supporting custom exclusion patterns to fit your needs.

Real-Time Progress

Visual progress indicators display processing speed, ETA, and file counts, keeping you informed every step of the way.

Directory Visualization

Generate a tree-view of the repository structure to easily navigate and understand codebase organization.

Clean Code Output

Produces a well-organized, consolidated text prompt that’s perfect for feeding into large language models.

Usage

Integrate Gitingest seamlessly into your workflow. Whether you install via RubyGems or clone the repository, the CLI lets you extract repository content quickly and effortlessly.

# Install from RubyGems
gem install gitingest

# Clone from GitHub and install dependencies
git clone https://github.com/davidesantangelo/gitingest.git
cd gitingest
bundle install
bundle exec rake install

# Basic usage for public repositories
gitingest --repository user/repo

# Using a GitHub token for private repositories
gitingest --repository user/repo --token YOUR_GITHUB_TOKEN

# Generate repository prompt and show structure
gitingest --repository user/repo --show-structure

Changelog

Mar 18

v0.6.0

Improved default branch handling and enhanced repository validation with better error handling.

  • Use repository's actual default branch instead of hardcoding "main"
  • Enhanced error handling in repository access validation
  • Updated documentation for default branch behavior
  • Fixed repository validation in test environment
Mar 04

v0.5.0

Introduced repository directory structure visualization, added DirectoryStructureBuilder, and improved concurrent processing with thread management.

  • Added --show-structure option
  • Created DirectoryStructureBuilder class
  • Integrated directory tree view generation
Mar 04

v0.4.0

Implemented in-memory prompt generation, visual progress bar, and enhanced multithreaded operations.

  • Added generate_prompt method
  • Integrated visual progress bar
  • Improved logging and error handling
Mar 03

v0.3.1

Optimized threading with configurable options and introduced exponential backoff for API requests.

  • Configurable threading options
  • Added thread-local buffers
  • Improved file exclusion performance