ReferenceCLI

CLI reference

The memory CLI is the primary automation surface for Memory Layer. It configures projects, runs the backend, captures work, curates memory, answers questions, manages embeddings, opens the TUI, exposes MCP, and runs evaluations.

Use command help as the final source of truth before scripting:

memory --help
memory <command> --help
memory <command> <subcommand> --help

Global options

OptionEnv varPurpose
--config <path>MEMORY_LAYER_CONFIGUse a specific global config file.
--writer-id <id>MEMORY_LAYER_WRITER_IDOverride the writer identity for captures and activity.
--agent-id <id>MEMORY_LAYER_WRITER_IDAlias for --writer-id.

Many commands also support --project <slug>, --json, or --dry-run. Prefer --json for agent automation and --dry-run before commands that write config, memory, history, embeddings, or repo metadata.

Command groups

GroupCommandsUse when
Setup and bootstrapwizard, init, upgrade, completion, devInstalling, configuring, refreshing repo-local integration files, and setting up shell completion.
Service and healthservice, status, doctor, health, stats, automationStarting the backend, diagnosing config, checking API health, and inspecting automation queues.
Query and briefingsquery, resume, up-to-speed, activities, history, verify-provenanceAsking project questions, resuming work, inspecting activity, and proving memory sources still exist.
Capture and curationremember, capture, scan, curate, proposals, archive, prune-history, checkpointWriting project memory, reviewing replacements, pruning history, and tracking plan execution.
Repository, evidence, and searchcommits, repo, graph, embeddings, bundleImporting code/history evidence, maintaining search indexes, and exporting project memory.
Integrations and evalstui, watcher, mcp, evalOpening UIs, attaching agents, serving MCP, and measuring memory quality.

Agent contract

Agents should follow a repeatable command pattern:

  1. Run memory query before answering project-specific questions.
  2. Run memory resume after interruptions or context loss.
  3. Use memory checkpoint start-execution when beginning approved plans.
  4. Use memory remember after meaningful completed work.
  5. Use memory status, memory doctor, and memory health before blaming retrieval or the TUI.

Read/write guide

KindMostly read-onlyWrites local or service state
Setupcompletion, most dev inspectionwizard, init, upgrade, some dev scaffolding
Servicestatus, doctor, health, statsservice enable, service disable, service restart-all, automation flushes
Queryquery, resume, up-to-speed, activities, history, verify-provenanceQuery/activity logging may write audit events when the service is running.
Memoryproposals list, scan --dry-runremember, capture, curate, scan, proposal approval/rejection, archive, prune-history
Evidencerepo inspect, graph inspect, embeddings statuscommit import, repo indexing, graph extraction, embedding rebuilds, bundle import
Integrationsmcp status, watcher status, eval comparewatcher start/stop, MCP HTTP service config, eval run artifacts

Project resolution

Commands that operate on memory need a project slug. In normal repo-local use, the CLI can read .mem/project.toml; in automation, pass --project <slug> explicitly so the command does not depend on the current working directory.

memory query --project memory --question "What changed in the docs site?"
memory status --project memory --json

Next

Use Setup and bootstrap for installation flows or Query and briefings for day-to-day agent use.

© 2026 Olivier Van Acker (3vilM33pl3). Memory Layer is AGPL-3.0-or-later with commercial licensing available.

On this page