Terminal-first snippet manager with VS Code + MCP integration. Local-first — all data lives in a single SQLite file under $XDG_DATA_HOME/snip/snip.db.
Three surfaces, one library:
- CLI —
snip add,snip search, interactive TUI - MCP server — exposes snippets to Claude Code / any MCP client
- VS Code extension — sidebar, insert, save-selection-as-snippet
packages/
core/ shared DB + search + types
cli/ terminal interface
mcp/ MCP server (stdio)
vscode/ VS Code extension
pnpm install
pnpm buildThe CLI binary is linked as snip inside packages/cli/dist/index.js. To use globally:
pnpm --filter @snip/cli link --globalsnip # interactive TUI (fuzzy search + preview)
snip add # create a snippet in $EDITOR
snip add -t "my thing" -l bash --tag devops --file script.sh
snip search "ssh vps" --tag bash
snip get <id> --raw # print raw content (pipeable)
snip copy <id> # copy to clipboard
snip copy <id> --var NAME=bob # fill {{NAME}} before copying
snip edit <id> # open in $EDITOR
snip list --tag react
snip tags # all tags with counts
snip export snippets.json
snip import snippets.json
snip delete <id>Ids can be passed as a short prefix (first 4+ hex chars) as long as it's unambiguous.
Any {{VAR_NAME}} placeholder becomes a variable. snip get, snip copy, and the MCP get_snippet tool accept values to fill them.
Defaults to $XDG_DATA_HOME/snip/snip.db (usually ~/.local/share/snip/snip.db). Override with SNIP_DB=/custom/path/snip.db.
node packages/mcp/dist/index.jsRegister with Claude Code (~/.claude/mcp.json or similar):
{
"mcpServers": {
"snip": {
"command": "node",
"args": ["/absolute/path/to/snip/packages/mcp/dist/index.js"]
}
}
}Exposed tools:
| Tool | Purpose |
|---|---|
search_snippets |
Fuzzy search with optional tag/language filters |
get_snippet |
Retrieve full content (supports template variables) |
create_snippet |
Save a new snippet |
update_snippet |
Modify any field |
delete_snippet |
Remove a snippet |
list_tags |
Browse tags with counts |
From packages/vscode/:
pnpm build
code --install-extension . # or F5 from VS Code for devFeatures:
- Activity-bar sidebar with tag filter
Snip: Insert Snippet— fuzzy picker, replaces selectionSnip: Save Selection as Snippet— right-click in editorSnip: Edit Snippet— opens in a temporary buffer; save to persist- Variable substitution UI for
{{VAR}}placeholders
interface Snippet {
id: string; // uuid
title: string;
content: string;
language: string; // for syntax highlighting
tags: string[]; // lowercased
description: string | null;
source: string | null;
variables: string[]; // extracted from content
created_at: string; // ISO
updated_at: string;
}Use snip export + snip import with any transport you like (git repo, Gist, Dropbox, rsync).