| Crates.io | code-digest |
| lib.rs | code-digest |
| version | 0.5.0 |
| created_at | 2025-07-11 08:47:46.634849+00 |
| updated_at | 2025-07-13 17:17:04.574599+00 |
| description | High-performance CLI tool to convert codebases to Markdown for LLM context |
| homepage | |
| repository | https://github.com/matiasvillaverde/code-digest |
| max_upload_size | |
| id | 1747547 |
| size | 520,782 |
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.
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:
Simply put: feed your entire repo to Gemini and let Claude Code have intelligent conversations about your code architecture.
# Analyze local architecture
code-digest "What are the main architectural patterns used in this codebase?"
# Analyze remote GitHub repository
code-digest --repo https://github.com/owner/repo "How is this project structured?"
# Understand dependencies
code-digest "How does the authentication system interact with the database?"
# Find improvement opportunities
code-digest "How can I implement the new feature X?"
.gitignore and custom .digestignore patterns# Using Cargo
cargo install code-digest
# Or from source
git clone https://github.com/matiasvillaverde/code-digest.git
cd code-digest
cargo install --path .
Install Gemini CLI (optional):
npm install -g @google/gemini-cli
# Process current directory
code-digest
# Save to file for later use
code-digest -o context.md
# Process specific directory with token limit
code-digest -d /path/to/project --max-tokens 100000
Exclude files from processing:
# Dependencies
node_modules/
target/
vendor/
# Build artifacts
dist/
build/
*.pyc
# Sensitive files
.env
secrets/
Prioritize important files:
# Core functionality
src/main.*
src/core/**/*.rs
# Important configs
Cargo.toml
package.json
[defaults]
max_tokens = 150000
progress = true
[[priorities]]
pattern = "src/**/*.rs"
weight = 100
[[priorities]]
pattern = "tests/**/*.rs"
weight = 50
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
code-digest "Create a high-level architecture diagram of this codebase"
code-digest "Identify potential security vulnerabilities in this codebase"
# Analyze any public GitHub repository
code-digest --repo https://github.com/rust-lang/rust "How is the compiler structured?"
# Compare architectures
code-digest --repo https://github.com/owner/project "Compare this architecture to best practices"
code-digest "Generate comprehensive API documentation for all public functions"
code-digest "What code smells or anti-patterns exist in this project?"
We welcome contributions! Please see our Contributing Guidelines for details.
# Run tests
make test
# Run all checks
make validate
gemini not found
pip install gemini-cliwhich geminiToken count exceeded
--max-tokens to set a limit.digestkeep.digestignoreMade with โค๏ธ and Rust