Welcome to the ultimate guide for snip. This document will walk you through everything from your first snippet to advanced shell integration.
Get snip running on your machine in seconds.
# Install globally
npm install -g snip-manager
# Set up the shell widget (for Ctrl+G magic)
# Add this to your ~/.zshrc or ~/.bashrc
eval "$(snip widget)"You can add snippets interactively or pipe them directly.
# Interactive add (opens your $EDITOR)
snip add my_script --lang js --tags node,util
# Pipe from another command
echo "curl -X POST http://api.local/dev" | snip add quick_post --lang shStay organized with powerful filtering and sorting.
# List all snippets
snip list
# Filter by tag or sort by most used
snip list --tag node --sort usageExecute any snippet by name or ID.
snip run quick_postsnip supports dynamic variables. Use {{name}} or {{name:default}} in your snippets.
Example Snippet:
docker run --rm -it {{image:ubuntu:24.04}} {{cmd:bash}}When you run it, snip will interactively prompt you for the values!
Import scripts directly from URLs or GitHub.
snip grab github:user/repo/scripts/backup.sh --name backupIf you have fzf installed, use the interactive fuzzy finder with a live preview.
snip fzfsnip is designed to be both fast and safe.
Automatically detects dangerous commands like rm -rf or sudo. If a snippet is risky, snip will demand an explicit "yes" confirmation before running.
The TUI (Terminal User Interface) gives you a full-screen view of your library.
snip ui- Navigate with arrow keys.
- Search instantly.
- Run with
Enter.
Once installed via snip widget, you can press Ctrl+G anytime in your terminal to fuzzy-search your snippets and insert them directly into your current command line.
| Command | Description |
|---|---|
snip config |
View and edit your settings (editor, storage mode). |
snip export |
Backup your library to a JSON file. |
snip show --edit |
Quickly edit an existing snippet. |
snip stats |
See your most used snippets and productivity data. |
Tip
Switch to SQLite: For large libraries, enable SQLite in your config for blazing-fast lookups and zero-downtime persistence.
snip config set useSqlite trueHappy Snipping! 🐧