My browser has 47 tabs open. Around 30 of them are code snippets I "might need later."
This is not an organization system. It is a landfill with a search bar.
I have tried every way to keep code snippets, and I want to be honest about why each one failed — because the solution I landed on is the simplest thing I have ever adopted, and it runs in your terminal.
The Three Ways I Tried (And Why They Failed)
1. Browser Bookmarks
The obvious default. Every useful CSS fix, regex, curl command, and config block gets bookmarked.
Why it dies:
- No metadata. "Untitled - Stack Overflow" tells you nothing.
- Search = scrolling. Bookmarks search by title, not by the code inside the page.
- Fragile. The page changes, gets deleted, or now sits behind a login. Your snippet is gone.
2. GitHub Gists
A step up — the code is actually stored, not just linked.
Why it dies:
- Login + network required. In a meeting, on a flaky connection, or on a work machine, you are locked out.
- Public by default. That half-baked script with your internal hostname in the comments? Now it is on the internet.
- Slow loop. Create gist → copy URL → find gist → open → scroll → select → copy. Five steps for a 10-line snippet.
3. The TODO.md Graveyard
Everyone's fallback: paste everything into a markdown file.
Why it dies:
- No structure. No names, no languages, no dates.
-
No search.
grepworks, but you are managing a file by hand forever. - It grows until it is useless. A 2,000-line TODO.md is just a browser tab with more steps.
What I Actually Needed
Four requirements, in order:
- Instant — save in under 2 seconds, while the context is still fresh.
- Local — no account, no network, no "are you sure you want to make this public?"
- Searchable — by name and by content.
- Ownable — a format I can carry to any machine.
So I Built SnippetX
SnippetX is a terminal snippet manager with zero dependencies. No install, no config, no account:
echo 'app.get("/users", handler)' | npx @wuchunjie/snippetx add user-route js
✅ Saved: "user-route" (js)
It stores everything in ~/.snippetx/snippets.json — one plain file. That single decision solves requirement 4: git init it to sync across machines, copy it for backups, open it in any editor. You own your data, full stop.
A Day in the Life
9:40 am — Found a nice debounce function while reading. Two seconds:
pbpaste | npx @wuchunjie/snippetx add debounce js
2:15 pm — Need that debounce back. One command, content search:
npx @wuchunjie/snippetx search debounce
🔍 "debounce" → 1 match
🔹 f3a1b2c4 debounce
...function debounce(fn, ms) { ...
4:30 pm — Paste it into the file that needs it:
npx @wuchunjie/snippetx copy f3a1b2c4 >> hooks.js
Total friction: three commands, zero tabs, zero logins.
Head to Head
| Browser bookmarks | GitHub Gist | TODO.md | SnippetX | |
|---|---|---|---|---|
| Save time | ~10s | ~20s | ~10s | ~2s |
| Works offline | Partial | No | Yes | Yes |
| Content search | No | No | Manual | Built in |
| Private by default | Yes | No | Yes | Yes |
| Sync to other machines | Sync service | Yes | Manual | Any file sync |
Try It Now
echo 'git push origin main' | npx @wuchunjie/snippetx add push-shorthand sh
npx @wuchunjie/snippetx list
npx @wuchunjie/snippetx search push
npm: @wuchunjie/snippetx | GitHub: wuchunjie00/devtools
From the same toolbox
-
ScaffoldX — generate 12 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
☕ If This Saved You Time
SnippetX is and will always be 100% free. If it makes your day a little easier, consider fueling the next tool:
Built with ❤️. Zero dependencies, zero tracking, zero bloat.
Top comments (0)