snippy

Crates.iosnippy
lib.rssnippy
version0.1.3
sourcesrc
created_at2024-09-03 18:51:12.881383
updated_at2024-10-09 05:49:08.591549
descriptionA command-line tool for that makes using LLMs for code generation a breeze
homepagehttps://github.com/nikhil-pandey/snippy
repositoryhttps://github.com/nikhil-pandey/snippy
max_upload_size
id1361943
size173,092
Nikhil Pandey (nikhil-pandey)

documentation

README

πŸ“Ž 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

  1. Copy files to clipboard with default settings:

    snippy copy file1.rs file2.py  
    
  2. Copy files without markdown ticks:

    snippy copy --no-markdown file1.rs file2.py  
    
  3. Add line numbers with a custom prefix:

    snippy copy --line-number 3 --prefix ">> " file1.rs file2.py  
    
  4. Copy files formatted as XML:

    snippy copy --xml file1.rs file2.py  
    
  5. 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:

  1. Use prompts that generate code in a format Snippy can recognize.
  2. Check the prompts/ directory for example prompts that work well with Snippy.
  3. 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! πŸŽ‰

Commit count: 13

cargo fmt