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 serve

Start 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 serve

Start on a specific port with cloud storage:

cmk serve --port 8842 --storage cloud
cmk init

Initialize 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 remember

Store 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 immediately

Examples

Remember a preference:

cmk remember "I prefer 2-space indentation" --gate behavioral

Remember a fact and pin it:

cmk remember "API uses JWT RS256" --gate epistemic --scope project --pin
cmk recall

Search 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 JSON

Examples

Search for database preferences:

cmk recall "preferred database"

Search with filters and JSON output:

cmk recall "auth setup" --gate epistemic --limit 10 --json
cmk reflect

Trigger 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 memory
cmk forget

Delete 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 prompt

Examples

Delete a specific memory:

cmk forget mem_abc123

Delete all promissory memories:

cmk forget --gate promissory --force
cmk identity

View 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 JSON

Examples

View current identity:

cmk identity

Regenerate from memories:

cmk identity --regenerate