I Typed the Same Docker Command Five Times This Week. So I Built a Snippet Manager That Lives in My Terminal
Every developer has a drawer of "useful code" scattered across five places: Browser bookmarks — that Stack Overflow answer with the exact flag Chat history — the one-liner a coworker sent in Slack three months ago Old terminals — scroll back 200 lines, it's gone Project READMEs — findable only if you remember which project Your brain — a terrible database By the time you find the snippet again,…
Developers often store useful code snippets in various places, such as browser bookmarks, chat history, old terminals, project READMEs or their brain. However, searching for these snippets takes time and can lead to mistakes. Existing snippet managers either require a GUI, work in the web, or are project-specific. The reporter wanted a simple solution that lives in the terminal with no accounts or subscriptions.
This led to the creation of snippetx, a tool that stores snippets in a single JSON file without any daemon, account, or cloud. The reporter installed snippetx using npm, and it consists of six commands for saving, listing, searching, viewing, copying to clipboard, and deleting snippets. The entire API is straightforward, with no configuration needed.
The reporter uses snippetx to quickly recover a Postgres database during rare emergencies, saving over 15 minutes of typing and searching. The snippets are just plain JSON files, easy to back up, search with tools like grep, or version control. The reporter also mentioned other local-first tools they built, all of which are zero-dependency and MIT licensed.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.