Every snippet service I have ever used has one fatal flaw: your code lives somewhere else.
Gists vanish when you forget your account. Pastebin links rot. A browser profile wipe takes your "code stuff" folder with it. I have watched all of this happen.
So here is the workflow I settled on, and the one tool at its center. The core idea: your snippets should be a file you own.
The Local-First Rule
Three requirements, non-negotiable:
- The data is a plain file I can open in any editor.
- No network required — it must work in a meeting, on a train, on a locked-down work machine.
- Syncing is a file operation — copy it, git it, rsync it. No service.
SnippetX is built exactly around this. Everything you save lands in:
~/.snippetx/snippets.json
That is it. A single JSON file with names, languages, dates, and content. Open it. Read it. Move it.
Saving Is a Pipe
echo 'app.get("/users", handler)' | npx @wuchunjie/snippetx add user-route js
✅ Saved: "user-route" (js)
Retrieval Is One Command
npx @wuchunjie/snippetx search route
🔍 "route" → 1 match
🔹 a1b2c3d4 user-route
...app.get("/users", handler)...
And to use it:
npx @wuchunjie/snippetx copy a1b2c3d4 >> server.js
# or to clipboard:
npx @wuchunjie/snippetx copy a1b2c3d4 | pbcopy
Syncing: The Boring (Good) Way
Because it is one file, "sync across machines" is a two-line script:
cd ~/.snippetx
git init && git add snippets.json && git commit -m "snippets"
Push it to any repo (private, if you like). New machine? Clone and done. Your entire code memory travels in a single JSON file — no service account, no API, no Terms of Service update you never read.
Why I Care About This
Snippet data is personal infrastructure. The regex you built over an hour, the config for your team's weird proxy, the exact curl call that hits your staging API — these are not "notes". They are muscle memory.
Cloud services make muscle memory hostage to their uptime and their business model. A file makes it yours.
That is the whole pitch. Zero dependencies, zero accounts, one command.
npm: @wuchunjie/snippetx | GitHub: wuchunjie00/devtools
From the same toolbox
-
ScaffoldX — generate production-ready project templates in seconds:
npx scaffoldx-cli -
DotGuard — scan
.envfiles for exposed secrets:npx @wuchunjie/dotguard -
GitPulse — git analytics (commits, contributors, activity) in your terminal:
npx @wuchunjie/gitpulse -
SnippetX — save, search, and copy code snippets from the terminal:
npx @wuchunjie/snippetx
☕ If This Saved You Time
All of these tools are and will always be 100% free. If they make your day a little easier, consider fueling the next one:
Built with ❤️. Zero dependencies, zero tracking, zero bloat.
Top comments (0)