Repository Context Packager
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.
Features
- π 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)
Installation
Install from crates.io (Recommended)
The easiest way to install rusty-repo-context-manager is using Cargo:
After installation, you can use it directly:
Build from Source
Prerequisites
- Install Rust (1.70+ required)
- Git (optional, for repository features)
Build and Run
Quick Start
Note: Only one path argument is supported.
# Scan current directory
# Include only source files
# Exclude build artifacts
# Save to file
# Only include files modified in the last 7 days
Command Options
| 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 |
Dependencies
| Crate | Purpose |
|---|---|
| clap | Command-line parsing |
| git2 | Git repository operations |
| globset | Pattern matching |
| ptree | Tree visualization |
| chrono | Date/time handling |
Pattern Matching Semantics
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
# Exclude build artifacts and logs
# Combine include + exclude
# Only recent files (last 7 days)
# Combine recent with include patterns
Gotchas:
- 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.
Development
CI/CD Pipeline
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.
Local Development
# Install dependencies
# Run tests
# Format code
# Run lints
# Build release binary
Or use the provided Makefile:
License
MIT License - see LICENSE file.