CLI Reference
openclaw memory
Bootstrap, flush, snapshot, and sync OpenClaw file memory with local DB memory.
The openclaw memory command group manages OpenClaw memory file mode:
- semantic memory (
memory.md) - append-only daily logs (
memory/daily/YYYY-MM-DD.md) - session snapshots (
memory/snapshots/YYYY-MM-DD/<slug>.md)
Commands
Read bootstrap context
memories openclaw memory bootstrapThis reads:
memory.md(semantic memory)- today's and yesterday's daily logs
Use JSON output when scripting:
memories openclaw memory bootstrap --jsonFlush session events to daily log
memories openclaw memory flush <session-id>Options:
-m, --messages <n>number of meaningful events to include (default15)--workspace <path>override OpenClaw workspace directory
Create snapshot file + DB snapshot
memories openclaw memory snapshot <session-id> --trigger resetThis writes both:
- DB snapshot row (
memory_session_snapshots) - OpenClaw snapshot file under
memory/snapshots/...
Sync DB ↔ OpenClaw files
memories openclaw memory sync --direction bothDirections:
exportDB -> filesimportfiles -> DBboth(default)
Use JSON output for automation:
memories openclaw memory sync --direction both --jsonWorkspace path resolution
Workspace precedence:
--workspace- env (
MEMORIES_OPENCLAW_WORKSPACE_DIR,OPENCLAW_WORKSPACE_DIR,OPENCLAW_WORKSPACE_PATH) ~/.openclaw/openclaw.json(for exampleagent.workspace,agents.defaults.workspace)- default
~/.openclaw/workspace