A Zed extension that allows you to get a prompt-friendly extract of GitHub repositories via slash commands.
- Prompt-Friendly Digests: Generate concise text summaries from GitHub repositories optimized for LLM prompts.
- Flexible Command Usage: Utilize the
/gitingest
slash command with various URL and pattern options. - Pattern Matching: Include or exclude specific files using glob patterns for tailored outputs.
- Comprehensive Output: Receive repository summaries, directory trees, selected file contents, and details of ignored files.
Follow these simple steps to set up the Git Ingest Extension in Zed Editor.
- Rust: Install via rustup.
- Zed Editor:
-
Clone the Repository
git clone https://github.com/gc-victor/gitingest-zed-extension.git cd git-ingest-extension
-
Install as Dev Extension
- Open Zed Editor.
- Go to Extensions Manager (
Ctrl+Shift+X
). - Click Install Dev Extension.
- Select the
git-ingest-extension
folder you cloned. - Click Rebuild.
- It can take some time to do the build. Be patient.
-
Verify Installation
- Open the Assistant Panel with
Ctrl+?
. - Search for and run the
/gitingest
command.
- Open the Assistant Panel with
Use the /gitingest
command followed by a GitHub repository URL and optional include/exclude patterns:
Basic usage with just the URL:
/gitingest https://github.com/username/repo
Add include/exclude patterns to filter files:
/gitingest https://github.com/username/repo include:*.rs,src/*.ts exclude:*.log,test/*
For private repos or higher rate limits, add GitHub token:
/gitingest https://github.com/username/repo github_token:your_token
The extension supports:
URL formats:
- Basic:
https://github.com/username/repo
- With branch:
https://github.com/username/repo/tree/branch
- With path:
https://github.com/username/repo/tree/branch/path/to/dir
Pattern formats:
- Include:
include:*.rs,src/*.ts
- Only include files matching these glob patterns - Exclude:
exclude:*.log,test/*
- Exclude files matching these glob patterns - Multiple patterns separated by commas
- Glob pattern syntax (e.g. *, **, ?)
Pattern behavior:
- If no include patterns specified, all files included by default
- Files matching exclude patterns are always excluded
- Include/exclude patterns are checked against full file paths
- Patterns are cumulative with .gitignore rules
Additional options:
- GitHub Token:
github_token:your_token
- Optional personal access token for authenticated requests - GitHub token enables higher API rate limits and access to private repositories
The command outputs:
- Repository summary (files, size, directory count)
- Directory structure tree
- Selected file contents (within size limits)
- Ignored files/directories (based on .gitignore and exclude patterns)
- Maximum total size: 1MB per repository
- Maximum file size: 50KB per file
- Maximum total files: 500 files per repository
- Subject to GitHub API rate limits
- Only supports public repositories currently
Built with:
See the official documentation for full details on extension development.
To develop locally:
- Install Rust via rustup
- Clone the repository
- From Zed's extensions page, click "Install Dev Extension" and select your extension directory
- Make changes to the extension code - Zed will automatically reload when files are modified
Run the test suite with:
cargo test
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
Thanks to:
- The Git Ingest project for inspiring this extension
- The Zed editor team for their excellent extension API
- GitHub for providing a robust API
MIT License - see LICENSE file for details