π Turn any repository into an AI-ready text bundle with safe defaults and rich analytics.
Perfect for ChatGPT, Claude, and LLM workflows. Transform your entire codebase into a structured, token-counted digest in seconds. Built for developers who want to leverage AI for code review, documentation, and project analysis.
π― Keywords: AI code analysis, ChatGPT code review, repository digest, LLM preprocessing, code documentation, Python CLI tool
# Install
pip install repo-digest
# Export your repo (safe defaults)
repo-digest . -o my-project.txt
# Preview first (recommended)
repo-digest . --previewThat's it! Your entire repository is now in a single, AI-friendly text file.
| Feature | repo-digest | Manual Copy-Paste | Other Tools |
|---|---|---|---|
| π Security First | β Blocks secrets by default | β Risk of leaking .env files | |
| π Token Counting | β Precise tiktoken support | β Manual estimation | |
| π― AI-Optimized | β Structured for LLMs | β Unstructured text | |
| β‘ Speed | β Seconds for entire repos | β Hours of manual work | |
| π‘οΈ Safe Defaults | β Excludes binaries/builds | β Includes everything |
===== REPO SUMMARY =====
Generated: 2025-09-11T22:39:07.627088
Tokenizer: cl100k_base
Total files: 11
Total tokens: 11,474
Total bytes: 46,914
===== SUMMARY BY EXTENSION =====
.py: files=6, tokens=8,226, bytes=34,003
.md: files=2, tokens=2,170, bytes=8,615
.toml: files=1, tokens=249, bytes=906
===== DIRECTORY TREE =====
./ (files: 11, tokens: 11,474, bytes: 46,914)
βββ src/ (files: 3, tokens: 5,240, bytes: 21,450)
βββ tests/ (files: 2, tokens: 1,685, bytes: 8,022)
===== FILES =====
[Complete file contents with token/line counts]
Built-in protection keeps your sensitive data safe:
- π Secrets blocked by default (
.env,*secret*,*.key,*.pem) - π« Binary files excluded (images, videos, archives)
- π Respects
.gitignoreautomatically - β‘ Size limits prevent runaway exports
# Basic export
repo-digest . -o my-project.txt
# Preview first (see what will be included)
repo-digest . --preview
# Set size limit (5MB max)
repo-digest . -o project.txt --max-bytes 5000000
# Include sensitive files (β οΈ use with caution)
repo-digest . -o project.txt --allow-secrets
# Ignore .gitignore rules
repo-digest . -o project.txt --no-gitignore- π¬ AI Code Review: Paste entire projects into ChatGPT/Claude for comprehensive analysis
- π Debugging Sessions: Give AI full context of your codebase for better solutions
- π Documentation Generation: Auto-generate project overviews and technical docs
- π Legacy Code Analysis: Understand inherited codebases quickly
- π Onboarding: Help new team members grasp project structure instantly
- π€ AI-Assisted Development: Enhance your workflow with LLM integration
"Reduced code review prep time from 2 hours to 30 seconds. Game changer for our AI workflow!" - Senior Developer
"Finally, a tool that understands security. No more accidentally sharing .env files." - DevOps Engineer
"Perfect token counting helped us optimize our ChatGPT usage costs by 40%." - Startup CTO
# Basic installation
pip install repo-digest
# With precise token counting (recommended)
pip install "repo-digest[tiktoken]"| Code | Meaning |
|---|---|
0 |
β Success |
1 |
β Runtime error (bad path, permissions) |
2 |
π Safety violation (secrets detected) |
3 |
π Size limit exceeded |
Windows long paths? Run from shorter path (e.g., C:\src)
Encoding issues? Files are read as UTF-8 with errors ignored
Large repos? Use --preview first, then --max-bytes to set limits
Q: Why are some files missing?
A: Safe defaults exclude build artifacts, secrets, and binary files. Use --no-gitignore if needed.
Q: Why do token counts differ from my model?
A: Install tiktoken for precise counts, otherwise we use word approximation.
Q: Can I include secrets?
A: Not recommended, but use --allow-secrets if you understand the risk.
We welcome contributions! Here's how to get started:
- π΄ Fork the repository
- πΏ Create a feature branch:
git checkout -b feature/amazing-feature - β
Test your changes:
pytest tests/ - π Commit with clear messages:
git commit -m 'Add amazing feature' - π Push and create a Pull Request
Good First Issues: Look for good-first-issue labels in our Issues
Vote on features by starring issues!
- π Markdown/JSON outputs - Multiple export formats
- βοΈ Config file support -
.repo-digest.yamlconfiguration - π GitHub URL input - Direct repo URL processing
- π¦ Chunking for huge repos - Smart splitting for large codebases
- π₯οΈ Simple GUI - Desktop app (if community requests)
- π IDE Extensions - VS Code, PyCharm integration
ai-tools chatgpt claude code-analysis developer-tools llm python-cli repository-analysis code-review documentation ai-workflow productivity
MIT - Use freely in any project!
β Star this repo if it helped you! π Report issues to help us improve. π‘ Suggest features for the roadmap.
Made with β€οΈ for the developer community