#snippets #cli #tool #command-line-tool #rust

app code-snip

A CLI tool to create images from code snippets

2 releases

new 0.1.1 Feb 19, 2025
0.1.0 Feb 19, 2025

#610 in Command line utilities

MIT license

21KB
496 lines

Code Snip

code-snip is a Rust binary that simplifies the process of generating code snippets. It allows you to quickly create and save code snippets by specifying the input code and the desired output file name.

Installation

Install code-snip via Cargo:

cargo install code-snip

Usage

code-snip --input "fn main() { println!(\"Hello, world!\"); }" --output snippet.rs

Arguments

  • input: The code you want to create a snippet for.
  • output: The filename for the generated snippet.

Environment Variables

You can configure the export path via the SYNTAX_EXPORT_PATH environment variable. If set, all generated snippets will be saved in this directory:

export SYNTAX_EXPORT_PATH="/path/to/snippets"

All code snippets will then be exported to {SYNTAX_EXPORT_PATH}/{output}.

License

This project is licensed under the MIT License.

Dependencies

~6–14MB
~167K SLoC