CLI Reference
The cmk command line tool lets you manage memories, run the MCP server, and interact with the memory store directly from your terminal.
cmk serveStart the CMK MCP server. This is the primary way to run CMK. The server exposes both the MCP tool interface and the REST API.
cmk serve [OPTIONS]Options
--port <PORT>Port to listen on (default: 7749)--storage <MODE>Storage mode: local or cloud (default: local)--host <HOST>Bind address (default: 127.0.0.1)--log-level <LEVEL>Logging level: debug, info, warn, error (default: info)Examples
Start with defaults:
cmk serveStart on a specific port with cloud storage:
cmk serve --port 8842 --storage cloudcmk initInitialize the CMK data directory. Creates the SQLite database, default configuration, and local embeddings cache. Safe to run multiple times.
cmk init [OPTIONS]Options
--dir <PATH>Data directory path (default: ~/.cmk)--storage <MODE>Initial storage mode (default: local)cmk rememberStore a memory directly from the command line. The gate is auto-classified if not specified.
cmk remember "<CONTENT>" [OPTIONS]Options
--gate <GATE>Gate type: behavioral, relational, epistemic, promissory, correction--scope <SCOPE>Scope: user, project, global (default: user)--pinPin this memory immediatelyExamples
Remember a preference:
cmk remember "I prefer 2-space indentation" --gate behavioralRemember a fact and pin it:
cmk remember "API uses JWT RS256" --gate epistemic --scope project --pincmk recallSearch memories using natural language. Returns ranked results with confidence scores and gate labels.
cmk recall "<QUERY>" [OPTIONS]Options
--limit <N>Maximum results (default: 5)--gate <GATE>Filter by gate type--min-confidence <N>Minimum confidence threshold (default: 0)--jsonOutput as JSONExamples
Search for database preferences:
cmk recall "preferred database"Search with filters and JSON output:
cmk recall "auth setup" --gate epistemic --limit 10 --jsoncmk reflectTrigger a reflection cycle. CMK reviews all memories, applies decay, resolves contradictions, and regenerates the identity document.
cmk reflect [OPTIONS]Options
--dry-runPreview changes without applying them--verboseShow detailed output for each resolved memorycmk forgetDelete a specific memory by ID, or delete all memories matching a filter.
cmk forget <ID> [OPTIONS]Options
--allDelete all memories (requires confirmation)--gate <GATE>Delete all memories of a specific gate--forceSkip confirmation promptExamples
Delete a specific memory:
cmk forget mem_abc123Delete all promissory memories:
cmk forget --gate promissory --forcecmk identityView or edit the identity synthesis document. Without arguments, prints the current identity.
cmk identity [OPTIONS]Options
--editOpen the identity document in your default editor--regenerateRegenerate the identity from all memories--jsonOutput as JSONExamples
View current identity:
cmk identityRegenerate from memories:
cmk identity --regenerate