@fouaden/snipit
v1.1.2
Published
A lightweight CLI tool to save, search and tag code snippets locally. Stop re-typing; start snipping.
Downloads
323
Maintainers
Readme
snipit 📎
Why snipit?
You know that one-liner you Google every time? The tsconfig you copy from an old project? The regex you always lose?
snipit stores them locally, tagged and searchable, ready to copy to your clipboard in one command. No account, no sync, no internet — just a JSON file on your machine.
Install
npm i -g @fouaden/snipitRequirements: Node.js 18+
Note!
macOS/Linux: If you get an EACCES permission error, run
sudo npm install -g @fouaden/snipit # This happens when npm's global folder is owned by root.Quick Start
# save a snippet
snipit save "kill port 3000" --code "lsof -ti:3000 | xargs kill" --tag node
# find it
snipit list --tag node
# grab it
snipit get "kill port 3000" --copyCommands
Save a snippet
# inline code
snipit save "kill port 3000" --code "lsof -ti:3000 | xargs kill" --tag node
# from a file — reads the file content and stores it
snipit save "tsconfig base" --file ./tsconfig.json --tag ts
# multiline — opens your default editor
snipit save "async fetch" --tag jsTags are comma-separated and optional:
snipit save "docker prune" --code "docker system prune -af" --tag "docker,ops"List snippets
snipit list # all snippets
snipit list --tag ts # filter by tag
snipit list --search "docker" # search by titleGet a snippet
snipit get "kill port 3000" # prints to terminal
snipit get "kill port 3000" --copy # prints + copies to clipboardSince output goes to stdout, you can pipe it too:
snipit get "tsconfig base" > tsconfig.json
snipit get "nginx config" | ssh user@server "cat > /etc/nginx/nginx.conf"Delete a snippet
snipit delete 3 # use the ID shown in snipit listData
Snippets are stored at ~/.snipit/snippets.json as a plain JSON file. No database, no server, no account.
{
"snippets": [
{
"id": 1,
"title": "kill port 3000",
"code": "lsof -ti:3000 | xargs kill",
"tags": ["node"],
"created": "2026-02-25"
}
],
"lastId": 1
}You can back it up, sync it with Dropbox, or commit it to a private repo — it's just a file.
License
MIT
