sinbo 1.0.0

A CLI snippet manager. Store code once, retrieve it anywhere.
sinbo-1.0.0 is not a library.

sinbo

Crates.io Downloads License Build Rust

sinbo is a CLI snippet manager. Store code once, retrieve it anywhere.


Installation

macOS / Linux

curl -sSf https://raw.githubusercontent.com/opmr0/sinbo/main/install.sh | sh

Windows

iwr https://raw.githubusercontent.com/opmr0/sinbo/main/install.ps1 -UseBasicParsing | iex

Via cargo

cargo install sinbo


Quick Start

sinbo add rust-test -e rs        # opens your editor, saves as a Rust snippet

sinbo get rust-test              # prints the snippet

sinbo get rust-test --copy       # copies to clipboard


Setup

sinbo opens your $EDITOR when adding or editing snippets. Set it in your shell config:

export EDITOR="vim"                    # Vim

export EDITOR="nvim"                   # Neovim

export EDITOR="nano"                   # Nano

export EDITOR="hx"                     # Helix

export EDITOR="code --wait"            # VSCode (--wait is required)

export EDITOR="idea --wait"            # IntelliJ

export EDITOR="pycharm --wait"         # PyCharm

export EDITOR="subl --wait"            # Sublime Text

The temp file uses the --ext flag for syntax highlighting sinbo add my-snippet -e rs opens the editor with a .rs file so your editor formats the language syntax correctly.

Commands

sinbo add <name>

Add a new snippet. Opens your $EDITOR if no input is piped.

sinbo add rust-test -e rs                  # open editor with .rs extension

sinbo add center-div -f style.css          # read from file

sinbo add docker-run -t docker infra       # add with tags

echo "hello world" | sinbo add greeting   # read from stdin

Flag Short Description
--ext -e File extension for syntax highlighting
--file-name -f Read content from a file
--tags -t Tag the snippet

sinbo get <name>

Print or copy a snippet.

sinbo get rust-test          # print to stdout

sinbo get rust-test --copy   # copy to clipboard

Flag Short Description
--copy -c Copy to clipboard

sinbo list

List all saved snippets.

sinbo list              # list all

sinbo list -t docker    # filter by tag

Flag Short Description
--tags -t Filter by tags
--show -s SHow the snippets content

sinbo edit <name>

Edit an existing snippet in your $EDITOR. Preserves the extension for syntax highlighting.

sinbo edit rust-test

sinbo edit rust-test -t rust testing   # update tags while editing


sinbo remove <name>

Delete a snippet.

sinbo remove rust-test


Tags

Tags let you group and filter snippets:

sinbo add nginx-conf -t infra server

sinbo add k8s-deploy -t infra k8s

sinbo list -t infra   # shows both


How It Works

  • Snippets are stored as plain files in your system config directory
  • Each snippet has two files: {name}.code for content and {name}.meta.json for tags and metadata
  • On Linux/macOS: ~/.config/sinbo/snippets/
  • On Windows: %APPDATA%\sinbo\snippets\
  • Files are plain text, you can grep, copy, or back them up directly

License

MIT - LICENSE