rich-prompt-0.3.1 is not a library.
๐ Rich Prompt
๐ง 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.
โจ Features
- ๐ 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
๐ฆ Installation
๐ฅ From Cargo
For linux make sure to run following command to install X11
For all operating systems run following
๐ง From Source
๐ฎ Usage
๐ฐ Basic Usage
โ๏ธ Command Line Options
| 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) |
๐ Examples
Include all Rust files in a project:
Include selected JavaScript and TypeScript files:
Include a custom prompt with your file context:
Copy the output directly to clipboard:
๐ Output Format
The 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>
๐ฏ Use Cases
- ๐ 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
๐ Workflow Integration
Perfect for integrating with:
- ๐ป CI/CD pipelines
- ๐ค AI code review bots
- ๐ Documentation generators
- ๐งช Testing frameworks
๐ฆ Logging Levels
Control verbosity with the --verbose flag:
- Default: Only errors
-v: Warnings and errors-vv: Info, warnings, and errors-vvv: All debug information
๐ ๏ธ Advanced Configuration
Create a .rich-prompt.toml in your home directory to set default options:
= [".rs", ".toml"]
= [".git", "target", "node_modules"]
= "info"
๐ค Contributing
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.
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.