ContextVaultDocs
Documentation/Vault Terminal/CLI guide
← All guides

Vault Terminal

CLI guide

Capture project work in the terminal, then review it as searchable local Markdown.

Vault Terminal · Workflow

Capture a coding session from the terminal

The CLI writes session events to Markdown in the current project's `.contextvault/sessions/` folder. Capture decisions and failures while they are fresh; search and prepare handoffs later.

1. Install and initialize

bash
# Run without a global install
npx @aliabdm/contextvault init

# Optional: install a reusable global command
npm install --global @aliabdm/contextvault
cd my-project
contextvault init

Global install is optional. With npx, replace contextvault with npx @aliabdm/contextvault.

2. Record the work

bash
contextvault record

/source codex
/title Fix authentication callback
/user Callback redirects users back to sign-in.
/agent Cookie is read before the callback writes it.
/problem Session cookie is missing after OAuth callback.
/decision Keep authentication checks in middleware.
/task Add regression coverage for redirect loop.
/end

Supported event types

/user, /agent, /note, /decision, /task, and /problem each record a dated event.

Recorder controls

/source sets the source; /title sets the title; /paste captures multiline text until /endpaste; /help lists the commands; /end saves and exits.

3. Review and search

bash
contextvault list
contextvault show latest
contextvault search "OAuth callback"
contextvault history --since 14d
contextvault decisions authentication --source codex
contextvault problems callback --since 30d

4. Retrieve evidence and prepare the next handoff

bash
contextvault retrieve "authentication callback" --type decision,problem --source codex --since 30d --limit 10
contextvault prepare "Fix callback redirect and add regression coverage" --source codex --since 30d
contextvault memory
contextvault timeline

Prepare writes an agent-ready Markdown file under .contextvault/exports/. Give that file to the next agent; the CLI does not call an AI provider.

Keep the project consistent

Run CLI commands from the intended project directory. Desktop displays these sessions when its active project points at that same folder.
Browse the complete command reference →