DEV Community

ke jia
ke jia

Posted on

How I Moved All My Code Bookmarks Into the Terminal

My browser had a bookmark folder called "code stuff". Inside: 40+ tabs. Regexes, curl commands, config blocks, "that one CSS fix I always need".

It felt organized. It was not. It was a landfill with a search bar that only matches titles.

Last weekend I moved all of it into my terminal. Here is exactly how, because the whole migration took about 10 minutes and it changed how I work.

Step 1: Pick a Local Snippet Store

The rule I set for myself: the snippets must live on my machine, in a plain file. No account, no network, no "service sunset" risk.

That is SnippetX — a zero-dependency snippet manager. It stores everything in ~/.snippetx/snippets.json. One file. I can read it, back it up, and sync it anywhere.

Step 2: Pipe Each Bookmark In

For every bookmark, open the page, select the code, copy it — then one command:

pbpaste | npx @wuchunjie/snippetx add debounce js
Enter fullscreen mode Exit fullscreen mode
  Saved: "debounce" (js)
Enter fullscreen mode Exit fullscreen mode

Two seconds per snippet. The name is the only thinking required. I batched through the whole folder in one sitting — 43 snippets in, bookmark folder deleted.

Step 3: Delete the Folder

This is the part that feels illegal. Just delete it. The browser bookmark folder is gone. Everything lives in the terminal now.

The Payoff

Need a snippet? One command, content search included:

npx @wuchunjie/snippetx search debounce
Enter fullscreen mode Exit fullscreen mode
  🔍  "debounce"  1 match

  🔹 f3a1b2c4  debounce
     ...function debounce(fn, ms) { ...
Enter fullscreen mode Exit fullscreen mode

Want it in your clipboard?

npx @wuchunjie/snippetx copy f3a1b2c4 | pbcopy
Enter fullscreen mode Exit fullscreen mode

No tabs. No scrolling. No "which of the six Stack Overflow pages was it on".

Before vs After

Bookmarks SnippetX
Find a snippet Scroll 40+ tabs 1 command
Search By title only Name + content
Offline Partial Always
Sync Browser profile git or copy one file
Survives browser wipe No Yes

The Full Set

add  <name> [lang]     Save snippet (pipe content in)
list [filter]          List all snippets
show <id>              View a snippet
search <term>          Search all snippets
rm <id>                Delete a snippet
copy <id>              Output snippet to stdout
Enter fullscreen mode Exit fullscreen mode

npm: @wuchunjie/snippetx | GitHub: wuchunjie00/devtools


From the same toolbox

  • ScaffoldX — generate production-ready project templates in seconds: npx scaffoldx-cli
  • DotGuard — scan .env files 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

GitHub: wuchunjie00/devtools


☕ 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:

Buy me a coffee on Ko-fi

Built with ❤️. Zero dependencies, zero tracking, zero bloat.

Top comments (0)