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 advisory writer label for captures and activity; authenticated principal identity is authoritative.
--agent-id <id>MEMORY_LAYER_WRITER_IDAlias for --writer-id; it changes the label, not authorization.

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 shape

Most commands follow one of three shapes:

ShapeExampleNotes
Root command with flagsmemory query --project memory --question "..."Common for query, scan, remember, status, doctor.
Command group with subcommandmemory commits sync --project memoryCommon for service, watcher, repo, graph, bundle, eval, embeddings, checkpoint.
Foreground long-running commandmemory service runRuns until interrupted; use service managers for packaged background operation.

Command inventory

Current command inventory

This reference is checked against the CLI's visible root commands in Rust tests. Use command help for flags and subcommands.

WorkflowCommandsUse when
Start and set upwizard, init, demo, tourConfigure Memory Layer, bootstrap a project, and try a guided example.
Use every dayremember, query, resume, tuiCapture finished work, ask cited questions, recover context, and inspect memory.
Diagnosestatus, health, doctorCheck the service, project configuration, and environment health.
Capture and curatecapture, curate, scan, ingest, proposals, consolidate, structure, review, archiveCollect evidence, make it durable, and review changes to canonical memory.
Reinforce and validatescores, validateInspect what stays useful and validate it against project evidence.
History and sharinghistory, prune-history, verify-provenance, bundleInspect versions, prove sources, keep history manageable, and transfer memory.
Workflow continuitycheckpoint, activities, up-to-speedRecord execution state and prepare the next person or agent to continue.
Connect people and toolsservice, auth, watcher, agent, loops, mcp, embeddingsRun the backend, manage access, connect agents, and operate integrations.
Index project evidencecommits, repo, graphImport repository history and build code-aware retrieval evidence.
Maintain and evaluateeval, upgradeMeasure memory quality and refresh repo-local integration files.
Show all 41 visible root commands

wizard · init · demo · tour · remember · query · resume · tui · status · health · doctor · capture · curate · scan · ingest · proposals · consolidate · structure · review · archive · scores · validate · history · prune-history · verify-provenance · bundle · checkpoint · activities · up-to-speed · service · auth · watcher · agent · loops · mcp · embeddings · commits · repo · graph · eval · upgrade

The hidden contributor utilities memory completion and memory dev remain documented in Setup and bootstrap. They are intentionally not part of the everyday root-command inventory above.

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, healthservice enable, service disable, service restart-all, watcher flush
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
Reinforcementscores, review listvalidate, review apply, review reject
Evidencerepo status, graph status, embeddings listcommit sync, repo indexing, graph extraction, embedding reindex/reembed/prune, bundle import
Integrationsmcp status, watcher status, loops list, eval comparewatcher start/stop, loop settings/runs/approvals, 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

Output contracts

Commands intended for automation prefer JSON output where supported. Usage mistakes, such as missing required flags, normally exit with code 2. Operational failures normally exit non-zero and include a human-readable error on stderr.

Use memory status --project <slug> --json as the first broad diagnostic when command behavior looks wrong.

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.