A powerful command-line tool for managing and processing code snippets with XML output format, built in Rust.
- 🌲 Automatic project tree generation
- 📝 Interactive REPL interface with two modes:
- Manual mode: For direct file management
- Prompt mode: For collecting and managing prompt text
- 🔍 Smart path completion with gitignore support
- 📋 Clipboard integration for easy XML output
- 🔢 Token counting for GPT model compatibility
- 💡 Multi-line prompt editing support
- 🚫 Intelligent file filtering (respects .gitignore, hidden files)
- Rust 1.70 or higher
- Cargo (Rust's package manager)
- Clone the repository:
git clone https://github.com/yourusername/rustprompt.git
cd rustprompt- Build the project:
cargo build --releaseThe compiled binary will be available at target/release/rustprompt.
/add <path>- Add files or directories to context/remove <path>- Remove files or directories from context/context- Show current context information/copy- Copy current context (with project tree) to clipboard/reset- Clear all context and prompt text/mode [manual|prompt]- View or switch modes/help- Show help information/quit- Exit program
- File management through
/addand/removecommands - Direct context manipulation
- Project tree generation
- Direct text input for prompt collection
- Multi-line editing support
- Automatic prompt text accumulation
- Start in manual mode:
./rustprompt- Add some files:
/add src/- Switch to prompt mode:
/mode prompt- Enter your prompt text:
Please analyze this code and suggest improvements.
- Copy the final XML:
/copyrustprompt
├── src
│ ├── app # Application state and management
│ ├── command # Command parsing and execution
│ ├── core # Core functionality (file scanning, XML generation)
│ ├── repl # REPL engine and prompt handling
│ └── main.rs # Entry point
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- Built with reedline for REPL functionality
- Uses ignore for .gitignore support
- Integrates tiktoken-rs for token counting