CLI
The mt CLI is a thin wrapper over the SDK for terminal-driven workflows. Best at:
- One-shot recording from shell scripts (
mt record "...") - Wrapping a subprocess and streaming stdout/stderr as turns (
mt observe -- claude-code) - Quick search from the terminal (
mt search "..." --mode summaries)
Install
Section titled “Install”pnpm add -g @memoturn/climt --versionConfigure
Section titled “Configure”mt initInteractive setup — stores api key + default project + email at ~/.memoturn/config.json. Override per-invocation with --api-key, --project, --email, --base-url.
Commands
Section titled “Commands”mt record <text...>
Section titled “mt record <text...>”One-shot record_turn (role=event).
mt record "deploying the worker tonight"mt record --session sprint-42 "kicked off staging deploy"mt observe -- <cmd...>
Section titled “mt observe -- <cmd...>”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).
mt observe --session debug-incident -- python train.pymt observe -- claude-codemt search <query...>
Section titled “mt search <query...>”Hybrid search from the terminal. --mode matches the SDK modes; --limit caps results.
mt search "hyperdrive connection limit"mt search "parseUser" --mode entitiesmt search "what did we figure out about auth" --mode summaries --limit 3Output is one hit per line: score [mode d=<dense_rank> l=<lexical_rank>] <content>.
mt link <project>
Section titled “mt link <project>”Set the default project slug for subsequent calls.
mt whoami
Section titled “mt whoami”Print the resolved config (api key masked).
Environment overrides
Section titled “Environment overrides”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.