code-digest ๐
Transform your entire codebase into a single, well-formatted Markdown file optimized for LLM context windows. Similar to gitingest, but faster and with built-in Gemini CLI integration.
Why code-digest?
Leverage Gemini's massive context window to understand your entire codebase at once. This tool gives AI assistants like Claude Code superpowers by enabling them to:
- ๐๏ธ Plan architectural changes with full visibility of your codebase
- ๐ Answer complex questions about how different parts interact
- ๐ Analyze patterns and suggest improvements across your entire project
- ๐ Make informed decisions when they need the big picture
Simply put: feed your entire repo to Gemini and let Claude Code have intelligent conversations about your code architecture.
๐ Quick Start
Ask Questions About Your Codebase
# Analyze local architecture
# Analyze remote GitHub repository
# Understand dependencies
# Find improvement opportunities
๐ฏ Key Features
- ๐ Blazing Fast: Built in Rust with parallel processing
- ๐ค Gemini Integration: Direct piping to Gemini CLI for instant AI analysis
- ๐ Remote Repository Support: Analyze any GitHub repository directly without cloning
- ๐ Smart Token Management: Accurate token counting using tiktoken
- ๐ฏ Intelligent Prioritization: Automatically prioritizes important files when hitting token limits
- ๐ Git-Aware: Respects
.gitignore
and custom.digestignore
patterns
๐ฆ Installation
Prerequisites
Install code-digest
# Using Cargo
# Or from source
Install Gemini CLI (optional):
Generate Context Files
# Process current directory
# Save to file for later use
# Process specific directory with token limit
๐ Configuration
.digestignore
Exclude files from processing:
# Dependencies
node_modules/
target/
vendor/
# Build artifacts
dist/
build/
*.pyc
# Sensitive files
.env
secrets/
.digestkeep
Prioritize important files:
# Core functionality
src/main.*
src/core/**/*.rs
# Important configs
Cargo.toml
package.json
Configuration File (.code-digest.toml)
[]
= 150000
= true
[[]]
= "src/**/*.rs"
= 100
[[]]
= "tests/**/*.rs"
= 50
๐ง CLI Reference
code-digest [OPTIONS] [PROMPT]
Arguments:
[PROMPT] The prompt to send to Gemini
Options:
-d, --directory <PATH> Directory to process [default: .]
--repo <URL> GitHub repository URL (e.g., https://github.com/owner/repo)
-o, --output <FILE> Output to file instead of stdout
--max-tokens <N> Maximum tokens for output
-q, --quiet Suppress output except errors
-v, --verbose Enable verbose logging
-c, --config <FILE> Path to config file
--progress Show progress indicators
-h, --help Print help
-V, --version Print version
๐งช Common Use Cases
Architecture Review
Security Audit
Analyze Remote Projects
# Analyze any public GitHub repository
# Compare architectures
Documentation Generation
Code Quality Analysis
๐ค Contributing
We welcome contributions! Please see our Contributing Guidelines for details.
Development
# Run tests
# Run all checks
๐ Troubleshooting
gemini not found
- Ensure Gemini CLI is installed:
pip install gemini-cli
- Verify it's in your PATH:
which gemini
Token count exceeded
- Use
--max-tokens
to set a limit - Configure file priorities in
.digestkeep
- Exclude unnecessary files in
.digestignore
๐ง Roadmap
- Support for more tokenizers (GPT-4, Claude, etc.)
- Custom output templates
- Integration with more LLM CLIs