🧠 Supercharge your LLM interactions with structured context from your codebase!
A Rust CLI tool that transforms your project files into perfectly formatted context blocks for Large Language Models. Ideal for code reviews, refactoring assistance, and technical discussions with AI.
- 📁 Smart File Selection - Automatically scan and select files with specific extensions
- 🔍 Interactive Mode - Choose files interactively or auto-include all matched files
- 🚫 Exclusion Patterns - Easily ignore directories like
.git,node_modules, etc. - 🏗️ Structured Output - Generate well-formatted context blocks optimized for LLMs
- 💬 Custom Instructions - Include your specific prompts within the context block
- 📤 Flexible Output - Print to console, save to file, or copy to clipboard with a simple flag
- 📋 Clipboard Support - Copy generated content directly to your clipboard for easy pasting
- 🔄 GitIgnore Support - Respect existing
.gitignorerules when scanning files
sudo apt-get install libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-devcargo install rich-promptgit clone https://github.com/username/rich-prompt.git
cd rich-prompt
cargo install --path .rich-prompt generate --path /path/to/project| Option | Description |
|---|---|
--path |
📂 Root directory to scan (optional, by default current directory) |
--ext |
📑 File extensions to include (optional, include all files if not specified) |
--exclude |
🚫 Patterns to exclude (optional, exclude none if not specified) |
--output |
💾 File path to save output (optional) |
--auto |
🤖 Skip interactive selection, include all files |
--prompt |
💬 User prompt to include in context block |
--exclude-version-control-dir |
📂 Version control directory to exclude (default: .git) |
--apply-dot-git-ignore |
🔍 Whether to apply .gitignore rules (default: true) |
--clipboard-output |
📋 Copy the output to the clipboard |
--verbose |
📝 Increase logging verbosity (-v, -vv, -vvv) |
rich-prompt generate --path ./my-project --ext .rs --exclude target --autorich-prompt generate --path ./frontend --ext .js,.ts --exclude node_modules --output output.txtrich-prompt generate --path ./src --prompt "Optimize this code for performance and reduce memory usage"rich-prompt generate --path ./src --auto --clipboard-outputThe tool generates output in the following format:
<file_map>
# 📂 Directory structure representation
</file_map>
<file_contents>
File: path/to/file.ext
```ext
file content
```
</file_contents>
<user_instructions>
💬 Your custom prompt goes here
</user_instructions>
- 🔍 Code Reviews: Get AI feedback on your code quality and structure
- 📚 Documentation: Generate comprehensive docs with AI assistance
- 🛠️ Refactoring: Receive intelligent suggestions for code improvements
- 🧩 Problem Solving: Get AI help with complex coding challenges
- 🎓 Learning: Analyze and understand project structure with AI explanations
Perfect for integrating with:
- 💻 CI/CD pipelines
- 🤖 AI code review bots
- 📊 Documentation generators
- 🧪 Testing frameworks
Control verbosity with the --verbose flag:
- Default: Only errors
-v: Warnings and errors-vv: Info, warnings, and errors-vvv: All debug information
Create a .rich-prompt.toml in your home directory to set default options:
default_extensions = [".rs", ".toml"]
default_excludes = [".git", "target", "node_modules"]
log_level = "info"Contributions are welcome! Here's how you can help:
- 🍴 Fork the repository
- 🔄 Create a feature branch
- 💻 Add your changes
- 🧪 Add tests for your changes
- 📤 Submit a pull request
Please make sure your code follows our coding standards and includes appropriate tests.
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ by Mohamed Abdelwahed