@z2r0/prompt-vault
v1.0.0
Published
A calm, developer-oriented prompt vault — hybrid search, multi-format copy, and zero-click ingestion of your local Codex & OpenCode history. Runs as a local app from the CLI.
Downloads
136
Maintainers
Readme
Prompt Vault
A calm, local-first prompt manager for developers.
Hybrid search · multi-format copy · zero-click ingestion of your Codex, OpenCode & Claude Code history — all on your machine, nothing leaves it.
Prompt Vault is a tiny, self-contained app you launch from the terminal. It stores your
prompts, finds them by keyword and by meaning, and copies any of them in the exact
format you need — with {{variable}} fill-ins. It can also read your prompts straight out
of your local CLI-agent history, so the vault fills itself.
npx @z2r0/prompt-vault # run it — no installFeatures
- 🔎 Hybrid search, fully offline. Real BM25 lexical ranking fused (Reciprocal Rank
Fusion) with a local concept-vector semantic layer — no model download, no API key, no
network. Toggle Hybrid / Keyword / Semantic; every hit shows
keyword/meaningsignal chips and a relevance bar. Searching "make my code run faster" surfaces "Optimize a slow SQL query" by meaning. - 📥 Zero-click history ingestion. On launch it quietly reads your Codex, OpenCode, and Claude Code history off disk and merges in anything new — keeping only your prompts (environment envelopes and assistant turns skipped) and tracing each back to the project it came from. Re-scan any time from Ingest.
- 📋 Copy in four formats. Raw · Markdown · XML (
<prompt>) · JSON, with{{variable}}fill-ins that flow into every format. - 🗂️ Stay organized. Pin to top, inline-edit, duplicate, archive, delete, live-edit tags, and sort by recent / most used / newest / A–Z.
- 🔒 Local-first by design. Your vault lives in the browser (
localStorage); the server only ever reads files on your machine. No account, no database, no telemetry. - 🌿 Calm, responsive UI. A warm, Anthropic-inspired light theme with a low-contrast
dark mode,
⌘Ksearch, and a layout that folds into drawers on narrow screens.
Install
# Run once, no install:
npx @z2r0/prompt-vault
# Or install it globally:
npm install -g @z2r0/prompt-vault
prompt-vaultEither way it starts a tiny local server on 127.0.0.1, prints the URL, and opens the app
in your browser.
Usage
- Launch — run
prompt-vault. The app opens and silently ingests any new prompts from your local history. - Find a prompt — search from the top bar (or press
⌘K). Switch Hybrid → Keyword → Semantic to trade exact matching for meaning, and narrow the rail by source (Codex / OpenCode / Claude Code / Manual), status (Pinned / Archived), or tags. - Fill & copy — open a prompt, fill any
{{variables}}, choose a format (Raw / Markdown / XML / JSON), and hit Copy. Your values flow into every format. - Curate — add prompts with New, then pin, tag, edit, duplicate, or archive them as your library grows.
Flags & environment
| Flag / env | Effect |
| ------------------- | ------------------------------------------------------------------ |
| --port <n> | Pin the server port (default: first free port in 7331–7350). |
| --no-open | Start the server without opening a browser. |
| CODEX_HOME | Override where Codex history is read from (default ~/.codex). |
| OPENCODE_DATA_DIR | Override the OpenCode data dir (~/.local/share/opencode). |
Requirements
Node ≥ 22.5 — the OpenCode reader uses the built-in node:sqlite. Everything else
(Codex/Claude ingestion, search, copy) runs on older Node too; only OpenCode ingestion
needs it.
Only needed if you edit the UI under src/ — the committed HTML is already built.
git clone https://github.com/SamWongML/prompt-vault
cd prompt-vault
npm install # dev-only: pulls esbuild
npm run build # → regenerates "prompt-vault/Prompt Vault.html"
npm run dev # build + openThe UI ships as one self-contained HTML file. build.mjs concatenates the source in
load order, transforms JSX → React.createElement with esbuild (no in-browser Babel),
then inlines the CSS and a vendored React build into a single file that works offline —
even double-clicked. The local server (node:http, no Express) serves that file and
exposes one endpoint, /api/scan, which does the history reading. History ingestion is
the one feature that needs the server.
Where is my data? In your browser's localStorage, served over http://localhost.
Nothing is uploaded.
Do I need a database? No. For a single-user local vault it's zero-infrastructure — nothing to provision. A backing store would only earn its keep if you wanted cross-device sync.
Does anything leave my machine? No. Ingestion reads history files locally and the page makes no network calls; React is vendored, so it runs fully offline.
Which histories can it read? Codex (~/.codex/sessions), OpenCode
(~/.local/share/opencode/opencode.db), and Claude Code (~/.claude/history.jsonl). It
keeps user prompts only.
License
MIT.
Recreated from a Claude Design handoff —
src/mirrors the design prototype; the single-file build, local server, and CLI are the production packaging.
