Skip to content

CLI

The memoturn CLI is a thin wrapper over the SDK for terminal-driven workflows. Best at:

  • One-shot recording from shell scripts (memoturn record "...")
  • Wrapping a subprocess and streaming stdout/stderr as turns (memoturn observe -- claude-code)
  • Quick search from the terminal (memoturn search "..." --mode summaries)
Terminal window
pnpm add -g @memoturn/cli
memoturn --version
Terminal window
memoturn init

Interactive setup. Stores api key, default project, and email at ~/.memoturn/config.json. Override per-invocation with --api-key, --project, --email, --base-url.

One-shot record_turn (role=event).

Terminal window
memoturn record "deploying the worker tonight"
memoturn record --session sprint-42 "kicked off staging deploy"

Wrap a subprocess. Each chunk of stdout becomes a turn (role=assistant); stderr is recorded too unless --no-stderr. Use --session to scope all the turns under one session id, --flush-ms to control the buffer flush cadence (default 400 ms).

Terminal window
memoturn observe --session debug-incident -- python train.py
memoturn observe -- claude-code

Hybrid search from the terminal. --mode matches the SDK modes; --limit caps results.

Terminal window
memoturn search "hyperdrive connection limit"
memoturn search "parseUser" --mode entities
memoturn search "what did we figure out about auth" --mode summaries --limit 3

Output is one hit per line: score [mode d=<dense_rank> l=<lexical_rank>] <content>.

Set the default project slug for subsequent calls.

Store an api key for the current user, so later commands need no --api-key.

Wire local agent configs at Memoturn’s MCP endpoint. Detects Claude Code, Cursor, VS Code, and Codex, then merges a memoturn entry into whichever of their configs already exist. Naming tools limits it to those.

Terminal window
memoturn connect # every detected tool
memoturn connect cursor codex # just these two
memoturn connect --dry-run # print the plan, write nothing
memoturn connect --check # exit non-zero if anything is unwired

memoturn connect hooks [ids] adds presence heartbeat entries to the Cursor, Claude Code, and Codex hook configs.

Print the resolved config (api key masked).

Every flag has a MEMOTURN_* env-var equivalent: MEMOTURN_API_KEY, MEMOTURN_PROJECT, MEMOTURN_USER_EMAIL, MEMOTURN_BASE_URL. Useful for CI and ephemeral shells.