Skip to content

mverab/repo-digest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“¦ repo-digest

PyPI version Python 3.8+ License: MIT Downloads

πŸš€ 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

πŸš€ Quick Start

# Install
pip install repo-digest

# Export your repo (safe defaults)
repo-digest . -o my-project.txt

# Preview first (recommended)
repo-digest . --preview

That's it! Your entire repository is now in a single, AI-friendly text file.

🌟 Why repo-digest?

Feature repo-digest Manual Copy-Paste Other Tools
πŸ”’ Security First βœ… Blocks secrets by default ❌ Risk of leaking .env files ⚠️ Usually no protection
πŸ“Š Token Counting βœ… Precise tiktoken support ❌ Manual estimation ⚠️ Basic word count
🎯 AI-Optimized βœ… Structured for LLMs ❌ Unstructured text ⚠️ Generic output
⚑ Speed βœ… Seconds for entire repos ❌ Hours of manual work ⚠️ Varies
πŸ›‘οΈ Safe Defaults βœ… Excludes binaries/builds ❌ Includes everything ⚠️ Manual configuration

✨ What You Get

===== 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]

πŸ›‘οΈ Safety First

Built-in protection keeps your sensitive data safe:

  • πŸ”’ Secrets blocked by default (.env, *secret*, *.key, *.pem)
  • 🚫 Binary files excluded (images, videos, archives)
  • πŸ“‹ Respects .gitignore automatically
  • ⚑ Size limits prevent runaway exports

πŸ“š Examples

# 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

🎯 Perfect For

  • πŸ’¬ 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

πŸ† Success Stories

"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

πŸš€ Advanced Installation

# Basic installation
pip install repo-digest

# With precise token counting (recommended)
pip install "repo-digest[tiktoken]"

πŸ“Š Exit Codes

Code Meaning
0 βœ… Success
1 ❌ Runtime error (bad path, permissions)
2 πŸ”’ Safety violation (secrets detected)
3 πŸ“ Size limit exceeded

πŸ”§ Troubleshooting

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

❓ FAQ

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.

🀝 Contributing

We welcome contributions! Here's how to get started:

  1. 🍴 Fork the repository
  2. 🌿 Create a feature branch: git checkout -b feature/amazing-feature
  3. βœ… Test your changes: pytest tests/
  4. πŸ“ Commit with clear messages: git commit -m 'Add amazing feature'
  5. πŸš€ Push and create a Pull Request

Good First Issues: Look for good-first-issue labels in our Issues

πŸ—ΊοΈ Roadmap

Vote on features by starring issues!

  • πŸ“ Markdown/JSON outputs - Multiple export formats
  • βš™οΈ Config file support - .repo-digest.yaml configuration
  • 🌐 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

πŸ“ˆ GitHub Stats

GitHub stars GitHub forks GitHub issues GitHub pull requests

🏷️ Topics

ai-tools chatgpt claude code-analysis developer-tools llm python-cli repository-analysis code-review documentation ai-workflow productivity

πŸ“„ License

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

About

πŸš€ Turn any repository into an AI-ready text bundle with safe defaults and rich analyticsπŸš€

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages