A Rust-based CLI tool that generates comprehensive, single-file summaries of source code projects, optimized for use as context with Large Language Models (LLMs) like Claude or ChatGPT.
- 🔍 Automatic Project Detection: Identifies project types (Rust, JavaScript, Python) based on key markers
- 📑 Smart Summary Generation: Creates concise yet informative project overviews
- 🌳 Project Tree View: Provides a visual representation of your project structure
- 💬 Interactive Mode: Append custom LLM prompts to your summary
- ⚡ Batch Processing: Quick, non-interactive summary generation
cargo install snapctx
Basic usage:
scx /path/to/project
# Run in interactive mode (default)
scx /path/to/project
# Run in batch mode (no prompts)
scx --batch /path/to/project
SnapCtx generates a Markdown file containing:
- Project metadata (name, timestamp, type)
- Directory structure
- Key file contents
- Git status information (when available)
- Your custom LLM prompt (in interactive mode)
Output files are saved with the format: {project_name}_snapshot_{timestamp}.md
SnapCtx automatically detects project types based on common markers:
- Rust:
Cargo.toml
- JavaScript:
package.json
- Python:
requirements.txt
orsetup.py
Unknown project types are still processed with default settings.
By default, SnapCtx ignores:
- Hidden files and directories (starting with
.
) - Build directories (
target
,node_modules
,__pycache__
) - Compiled Python files (
.pyc
)
- 🤖 Preparing context for LLM coding sessions
- 📚 Quick project documentation generation
- 🔄 Code review preparation
- Rust 1.70 or higher
- Cargo
git clone https://github.com/serkanaltuntas/snapctx.git
cd snapctx
cargo build --release
cargo test
clap
: Command-line argument parsingwalkdir
: Directory traversalchrono
: Timestamp generationanyhow
&thiserror
: Error handlingserde
&serde_yaml
: Data serializationenv_logger
: Logging functionality
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Serkan Altuntas - [email protected]
- Inspired by the need for better LLM context generation
- Built with Rust for performance and reliability