snip-it
A fast, terminal-based snippet manager. Fuzzy search your command library,
expand <variable> placeholders on the fly, organize snippets into
libraries, and keep every device in sync with end-to-end encryption.
Why snip-it?
Your shell history is unorganized. Generic snippet tools like pet don't
sync. Cloud-first managers want your data. snip-it is a single Rust
binary that runs everywhere, stores snippets in plain TOML you can grep,
and adds optional end-to-end-encrypted sync without ever holding your
plaintext.
Installation
From crates.io (recommended)
From source
Pre-built binaries
Download from the latest release:
| Platform | Asset |
|---|---|
| Linux x86_64 | snp-linux-x86_64.tar.gz |
| Linux aarch64 | snp-linux-aarch64.tar.gz |
| macOS x86_64 | snp-macos-x86_64.tar.gz |
| macOS Apple Si | snp-macos-aarch64.tar.gz |
| Windows x86_64 | snp-windows-x86_64.exe.zip |
# Linux / macOS
Homebrew
Docker (sync server only)
Quickstart
# Create a snippet with variables, then prompt for description and tags
# Create a snippet with a default value, then prompt for description
# List all snippets
# Launch the TUI to search, run, or copy
# Open the snippets file in $EDITOR
Snippets live in ~/.config/snp/snippets.toml:
[[]]
= "git commit with message"
= ["git", "version-control"]
= "git commit -m \"<message>\""
[[]]
= "ssh with port"
= ["ssh"]
= "ssh <user=root>@<host> -p <port=22>"
Features
- Fuzzy search — find snippets by description, command, or tags (
skimalgorithm). - Variable expansion —
<name=default>syntax prompts for values at runtime. - TUI — keyboard-driven selection with 50 bundled Halloy themes and a live theme picker (
ein normal mode). - Multiple libraries — separate collections per project, environment, or client.
- Premade libraries — download community-built snippet packs (
snp premade sync). - End-to-end encrypted sync — AES-256-GCM + Argon2id; the server never sees plaintext.
- Cron-friendly —
snp syncis non-interactive by default; safe for headless setups. - TOML you can grep — snippets are plain files; version-control them, edit them, diff them.
- Cross-platform — macOS, Linux, Windows; uses the system clipboard and keychain.
- Shell keyword expansion —
$HOME,~,$(date), etc. expand at copy time.
Security
Snippet commands are executed as-is via your shell. Only add snippets you trust. Snippets that contain secrets (passwords, tokens, keys) live in plaintext TOML — use a sync server with end-to-end encryption rather than sharing the file.
- Sync: snippets are encrypted with AES-256-GCM before leaving the client; the server stores only ciphertext.
- Key derivation: Argon2id with OWASP-recommended parameters.
- API keys: stored in the OS keychain (macOS Keychain, GNOME Keyring,
Windows Credential Manager) by default. A
SNP_ALLOW_PLAINTEXT_API_KEY=trueopt-in falls back to a plaintext key with a warning. - Integrity:
sync.tomlcarries a CRC32 checksum comment to detect accidental corruption (e.g., partial writes).
See SECURITY.md for the vulnerability disclosure policy and a fuller threat model.
Optional: Sync Server
snp is a single binary; sync is opt-in and requires a snip-sync
server (also in this repo). See snip-sync/README.md
for installation, configuration, and a docker-compose.yml example.
# Register against your server (stores API key in OS keychain)
# Manual sync (uses sync.toml direction; default is push-only)
# Push-only / pull-only
# Set up a 15-minute sync cron job
CLI Overview
$ snp --help
A fast, terminal-based snippet manager with fuzzy search, clipboard support, and cloud sync
Usage: snp [COMMAND]
Commands:
new Create a new snippet
list List all snippets
run Run a snippet via TUI
clip Copy snippet to clipboard
search Search and view snippet details
edit Edit snippets file in $EDITOR
sync Sync snippets with server
cron Setup automatic sync
library Manage snippet libraries
premade Browse/download premade libraries
register Register sync account
keybindings Show TUI keybindings
completions Generate shell completions
version Show version
See USER_GUIDE.md for the full reference and CONTRIBUTING.md for development setup.
Environment Variables
| Variable | Description | Default |
|---|---|---|
XDG_CONFIG_HOME |
Override config root; snp uses $XDG_CONFIG_HOME/snp |
platform default |
SNP_COMMAND_TIMEOUT |
Command execution timeout in seconds (0 disables; direct terminal runs default to no timeout, output-capture runs default to 300s) |
- |
SNP_CLIPBOARD_TIMEOUT |
Clipboard operation timeout (seconds) | 5 |
SNP_ALLOW_PLAINTEXT_API_KEY |
Allow API key in config file (not keychain) | false |
SNP_SYNC_CONNECT_TIMEOUT |
Sync TCP connect timeout (seconds) | 10 |
SNP_SYNC_REQUEST_TIMEOUT |
Sync per-request timeout (seconds) | 30 |
SNP_THEME |
UI theme (dark, bright, or Halloy theme name) |
dark |
SNP_LOG |
Per-module log filter (e.g., snp=debug) |
snp=info |
RUST_LOG |
Standard tracing/env-filter fallback when SNP_LOG is unset |
- |
EDITOR |
Editor for snp edit command |
vim |
Documentation
-
USER_GUIDE.md — Detailed guide: libraries, sync, variables, premade libraries, troubleshooting.
-
CONTRIBUTING.md — Development setup, code style, testing, release process.
-
SECURITY.md — Vulnerability disclosure policy and threat model.
-
CHANGELOG.md — Release history.
-
snip-sync/README.md — Sync server setup, configuration, deployment.
Contributing
Contributions welcome! See CONTRIBUTING.md for development setup, code style, and the release process. Bug reports and feature requests go through GitHub Issues.
License
MIT © 2026 David Bowman