A simple Rust CLI tool that packages your codebase for LLMs. It scans directories, shows file contents, and displays a nice tree view of your project structure.
- 📁 Recursive file scanning with include/exclude patterns
- 🌳 Pretty ASCII tree visualization
- 📝 Extracts text file contents (skips binary files)
- 🔄 Git repository information
- 🎯 Glob pattern filtering
- ⏰ Recent files filtering (last 7 days)
The easiest way to install rusty-repo-context-manager is using Cargo:
cargo install rusty-repo-context-managerAfter installation, you can use it directly:
rusty-repo-context-manager .- Install Rust (1.70+ required)
- Git (optional, for repository features)
git clone https://github.com/RiverDave/rust-cli-tool.git
cd rust-cli-tool
cargo build --release
./target/release/rusty-repo-context-managerNote: Only one path argument is supported.
# Scan current directory
./rusty-repo-context-manager .
# Include only source files
./rusty-repo-context-manager . -i "src/*"
# Exclude build artifacts
./rusty-repo-context-manager . -e "target/*" -e "*.log"
# Save to file
./rusty-repo-context-manager . -o output.txt
# Only include files modified in the last 7 days
./rusty-repo-context-manager . --recent| Option | Description |
|---|---|
-i, --include |
Include file patterns (e.g., "src/*") |
-e, --exclude |
Exclude file patterns (e.g., "target/*") |
-o, --output |
Save to file instead of stdout |
-r, --recursive |
Recursive scanning (default: true) |
--recent |
Only include files modified within the last 7 days |
| Crate | Purpose |
|---|---|
| clap | Command-line parsing |
| git2 | Git repository operations |
| globset | Pattern matching |
| ptree | Tree visualization |
| chrono | Date/time handling |
The tool uses globset to match patterns against file paths relative to the root you pass.
Rules:
- Hidden files/directories (starting with
.) are skipped automatically. - Exclude patterns: if any pattern matches a relative path, that file (or directory contents) is skipped.
- Include patterns: if provided, only files matching at least one include pattern are kept (after exclusion filtering).
- If no include patterns are supplied, all non-excluded, non-hidden files are considered.
- Patterns follow standard glob rules:
**matches across directory boundaries.
Examples:
# Include only Rust and Markdown sources
./rusty-repo-context-manager . --include 'src/**/*.rs' '**/*.md'
# Exclude build artifacts and logs
./rusty-repo-context-manager . --exclude 'target/**' '**/*.log'
# Combine include + exclude
./rusty-repo-context-manager . --include 'src/**/*.rs' --exclude 'src/generated/**'
# Only recent files (last 7 days)
./rusty-repo-context-manager . --recent
# Combine recent with include patterns
./rusty-repo-context-manager . --recent --include 'src/**/*.rs' --output recent_changesGotchas:
- To exclude an entire directory tree, prefer
dir/**(not justdir/*). - Include patterns use OR logic: any match keeps the file.
- Exclude wins over include (a file matching both is excluded).
- Binary detection is heuristic (null byte scan of first 512 bytes) and such files have no inlined content.
If patterns don’t behave as expected, run with no patterns first to view relative paths, then refine patterns.
This project uses GitHub Actions for continuous integration and deployment:
- Automated testing on multiple Rust versions (stable, beta, nightly)
- Cross-platform builds for Linux, Windows, and macOS
- Code quality checks with rustfmt and clippy
- Security auditing with cargo audit
- Automated releases when version tags are pushed
- Dependency updates via Dependabot
See CI/CD Documentation for detailed information.
# Install dependencies
cargo build
# Run tests
cargo test
# Format code
cargo fmt
# Run lints
cargo clippy
# Build release binary
cargo build --releaseOr use the provided Makefile:
make help # Show all available commands
make check # Run all checks
make all # Run all checks and buildMIT License - see LICENSE file.