4 releases
0.1.3 | Oct 9, 2024 |
---|---|
0.1.2 | Oct 6, 2024 |
0.1.1 | Sep 24, 2024 |
0.1.0 | Sep 3, 2024 |
#1714 in Command line utilities
611 downloads per month
51KB
1K
SLoC
π Snippy
π Overview
Snippy is a command-line tool for copying code snippets to the clipboard with optional formatting features. It's designed to make sharing code easier and more efficient, with special features for working with Large Language Models. β¨Here's a quick demo of Snippy in action:
https://github.com/user-attachments/assets/64d4ac13-8e3b-4923-8c74-95ad37a92e20
π Features
- π Copy multiple files to clipboard
- ποΈ Optional markdown code block formatting
- π’ Customizable line numbering
- π Clipboard watching mode for real-time processing
- π€ Seamless integration with LLM outputs
- π₯οΈ Cross-platform support (Windows, macOS, Linux)
- π XML Output Formatting
π» Installation
To install snippy
, you need to have Rust installed. Then you can install it using cargo
:
cargo install snippy
π οΈ Usage
snippy [OPTIONS] [FILES]...
π Examples
-
Copy files to clipboard with default settings:
snippy copy file1.rs file2.py
-
Copy files without markdown ticks:
snippy copy --no-markdown file1.rs file2.py
-
Add line numbers with a custom prefix:
snippy copy --line-number 3 --prefix ">> " file1.rs file2.py
-
Copy files formatted as XML:
snippy copy --xml file1.rs file2.py
-
Watch clipboard for changes and process new content:
snippy watch
π Clipboard Watching for LLM Integration
The watch command (watch
) is particularly powerful when working with LLMs:
snippy watch
This mode continuously monitors your clipboard. When you copy output from an LLM, snippy automatically processes and applies the code to your workspace. πͺ
To use this feature effectively:
- Use prompts that generate code in a format Snippy can recognize.
- Check the
prompts/
directory for example prompts that work well with Snippy. - Ensure your LLM output includes clear file paths and properly formatted code blocks.
Example of a Snippy-friendly code format:
### src/main.rs
```rust
fn main() {
println!("Hello, Snippy!");
}
```
π License
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
π€ Contributing
Contributions are welcome! Please feel free to submit a Pull Request. π
π¬ Support
If you encounter any problems or have any questions, please open an issue on the GitHub repository. We're here to help! π
Happy coding with Snippy! π
Dependencies
~23β37MB
~434K SLoC