← Back to home

🚀 Full Product Demo

Welcome to the ultimate guide for snip. This document will walk you through everything from your first snippet to advanced shell integration.

1. Installation & Setup

Get snip running on your machine in seconds.

# Install globally
npm install -g snip-manager

# Set up the shell widget (for Ctrl+G magic)
eval "$(snip widget)"

2. Core Workflow: Capture, Find, Run

📥 Capture: Saving snippets

# Interactive add (opens $EDITOR)
snip add my_script --lang js --tags node,util

# Pipe directly
echo "curl -X POST http://api.local/dev" | snip add quick_post

🔍 Find: Listing your collection

# List all snippets
snip list

# Filter by tag or sort by most used
snip list --tag node --sort usage

🏃 Run: Instant execution

snip run quick_post

3. Advanced Features

🎚️ Parameters (Templates)

Use {{name}} or {{name:default}} in your snippets. snip will interactively prompt you for values when running.

docker run --rm -it {{image:ubuntu:24.04}} {{cmd:bash}}

🔗 Grab: Import from the Web

snip grab github:user/repo/scripts/backup.sh --name backup

⚡ Smart Search (fzf)

snip fzf

⚡ Zero-Friction Exec

Skip the preview modal when you know what you're running:

# Run immediately
snip exec deploy-api

# Dry run — just print what would execute
snip exec deploy-api --dry-run

# Skip dangerous-command warning
snip exec deploy-api --force

🏷️ Shell Aliases

Turn every snippet into a native shell command:

# Generate aliases for bash/zsh
eval "$(snip alias)"

# Now every snippet is a command:
deploy-api           # → snip exec deploy-api
docker-cleanup       # → snip exec docker-cleanup

🩺 Health Check

Verify your setup in one command:

snip doctor
  ✓ Storage: JSON (42 snippets)
  ✓ Editor: code --wait
  ✓ Shell: /bin/zsh
  ✓ fzf: installed
  ✗ Gist sync: not configured

4. UI/UX & Safety

⚠ Safety First

snip automatically detects dangerous commands like rm -rf. If a snippet is risky, it will demand an explicit "yes" confirmation.

🎨 Beautiful Terminal UI

Launch a full-screen interactive view of your library with snip ui. Features syntax highlighting, line numbers, incremental search, and undo delete.

⌨️ Shell Widget (Ctrl+G)

Press Ctrl+G anytime in your terminal to fuzzy-search and insert snippets directly into your prompt.

5. Snippet Management

# Duplicate a snippet
snip cp deploy deploy-staging

# Rename a snippet
snip mv old-name new-name

# Print raw content for piping
snip cat deploy | sh

# Show recently used snippets
snip recent
snip recent 10

6. Pipe-Friendly Output

# JSON output for scripting
snip show deploy --json | jq .tags
snip search docker --json | jq '.[].name'
snip list --json | jq length

# Raw output (no headers)
snip show deploy --raw | pbcopy

7. Maintenance

Command Description
snip config View and edit settings
snip export Backup library to JSON
snip show --edit Quickly edit an existing snippet
snip stats See your productivity data
snip doctor Verify your setup — storage, editor, fzf, gist
snip cp / mv Duplicate or rename snippets
snip alias Generate shell aliases for every snippet
Pro Tip: SQLite

For large libraries, enable SQLite in your config for blazing-fast performance:

snip config set useSqlite true