Direct HTTPS operations and authentication headers
The standalone Skill communicates directly with XMemo over HTTPS. Public REST endpoints accept either Authorization: Bearer <token> or X-API-Key: <key> headers, while the standalone Skill runtime automatically formats outbound requests using Authorization: Bearer <token> from the resolved credential.
- Skill runtime transport: Automatically injects Authorization: Bearer <token> into all requests to https://xmemo.dev/v1/skill/operations.
- REST API flexibility: Standalone HTTP clients calling REST endpoints directly can supply either Authorization: Bearer <token> or X-API-Key: <key>.
- Discovery contract: Runtime model and operations endpoints are discoverable at /.well-known/agent-discovery.json and /.well-known/memory-os.json.
# Skill runtime uses Bearer token authorization:
POST /v1/skill/operations
Authorization: Bearer <skill-token>
Content-Type: application/json
# Direct REST endpoints also accept X-API-Key:
GET /v1/memories/search?query=onboarding&limit=5
X-API-Key: <your-assigned-api-key>Complete command inventory by task
The standalone Skill package (v1.1.35) provides 32 commands. Every command is listed below with its verbatim usage string from help.mjs and its required authorization scope.
- Authentication & Setup: login --allow-plaintext, register --reason <unattended|declined> --allow-plaintext, logout [--revoke-environment-token], auth status [--verify], auth add --from-stdin --allow-plaintext, auth claim-status [--allow-plaintext], auth claim-confirm [--allow-plaintext], auth claim-deny [--allow-plaintext].
- Memory & Search: read --id <id> [--offset <n>] [--limit <n>] [--bucket <bucket>] [--scope <scope>] (memory:read), update --id <id> [--content <text>] [--path <path>] [--metadata <json>] [--bucket <bucket>] [--scope <scope>] (memory:write), forget --id <id> [--reason <text>] --confirm (memory:delete or memory:write), remember (--content <text> | --content - | --file <path>) [--path <path>] [--metadata <json-object>] (memory:write), recall --query <text> [--limit <n>] [--explain <true|false>] [--prefer_working <true|false>] [--expand-documents] [--compact] (memory:read), search --query <text> [--limit <n>] [--explain <true|false>] [--prefer_working <true|false>] [--expand-documents] [--compact] (memory:read).
- Knowledge Context: recall-context --query <text> [--max_items <n>] [--max_tokens <n>] [--prefer_working <true|false>] [--include_knowledge <true|false>] (memory:read; opting into Knowledge with --include_knowledge true requires knowledge:read).
- Task Continuity & Snapshots: save-state --key <key> [--content <text>] [--ttl_seconds <0..604800>] (memory:write, alias: state-save), restore-state --key <key> (memory:read, alias: state-restore), state-save --key <key> [--content <text>] [--ttl_seconds <0..604800>] (legacy alias), state-restore --key <key> (legacy alias), restart-snapshot [--state_key <key>] [--session_id <id>] [--ttl_seconds <0..2592000>] (memory:write), restart-restore [--snapshot_id <id> | --source_session_id <id>] [--target_session_id <id>] (memory:read).
- Task TODOs: todo-add --content <text> (memory:write), todo-list (memory:read), todo-done --id <todo_id> (memory:write).
- Financial Ledger & Analytics: expense-add --item <text> --amount <number> --currency <code> (ledger:write), ledger-list [--month <YYYY-MM>] [--from <date>] [--to <date>] [--currency <code>] [--category <name>] [--type <type>] [--min-amount <n>] [--max-amount <n>] [--limit <n>] [--offset <n>] (ledger:read), ledger-summary [--months <n>] [--currency <code>] [--type <type>] (ledger:read), overview (memory:read), activity [--limit <n>] (memory:read), stats [--scope <scope>] [--path <path>] [--bucket <bucket>] [--memory-type <type>] [--status <status>] [--source <src>] [--since <iso>] [--until <iso>] [--group-by <dims>] [--top-n <1..200>] [--team-id <id>] (memory:read).
- Diagnostics & Profiling: doctor [--anonymous] (no scope required), profile [--status <later|never>] (no scope required).
# Memory read and write operations:
node scripts/xmemo-skill.mjs remember --content "Production build uses node 22.22" --path "ops/build"
node scripts/xmemo-skill.mjs recall --query "build node version" --limit 3
node scripts/xmemo-skill.mjs read --id mem_01hxyz... --offset 0 --limit 1000
node scripts/xmemo-skill.mjs update --id mem_01hxyz... --content "Production build uses node 22.22.0 LTS"
node scripts/xmemo-skill.mjs forget --id mem_01hxyz... --confirm
# Context assembly with optional Knowledge inclusion:
node scripts/xmemo-skill.mjs recall-context --query "TLS root configuration" --include_knowledge true
# Task continuity and restart snapshots:
node scripts/xmemo-skill.mjs save-state --key active_task --content "Refactoring migration script"
node scripts/xmemo-skill.mjs restart-snapshot --state_key active_task --session_id sess_alpha_0928
# Ledger and analytics:
node scripts/xmemo-skill.mjs expense-add --item "Cloud hosting" --amount 120 --currency USD
node scripts/xmemo-skill.mjs overview
node scripts/xmemo-skill.mjs doctorDeterministic exit codes
All standalone Skill commands adhere to strict, deterministic exit codes across interactive and programmatic executions.
- Code 0 (Success): Operation succeeded, valid empty result sets returned, --help, or --version.
- Code 1 (User Error): Parameter validation error, mutually exclusive arguments, content exceeding 524,288 bytes, missing mandatory --confirm on forget, missing/unreadable input file, or HTTP 4xx response.
- Code 2 (Auth Error): Missing credentials, expired or invalid token, HTTP 401 Unauthorized, HTTP 403 Forbidden, or doctor auth validation failure.
- Code 3 (Server / Network Error): HTTP 5xx response, network connection failure (ECONNREFUSED, ENOTFOUND, ETIMEDOUT), or response payload exceeding safety ceiling (> 8 MiB).
Content safety, document stubs, and deletion confirmation
The standalone Skill enforces strict guardrails before issuing network requests to ensure data safety and client stability.
- 512 KiB write cap: Memory content is bounded to 524,288 bytes (MAX_MEMORY_CONTENT_BYTES). Inputs exceeding this ceiling exit immediately with code 1 before any network request is dispatched.
- Mutually exclusive input sources: remember accepts --content <text>, --content - (piped stdin), or --file <path>. Providing more than one source aborts locally with exit code 1.
- Document-backed memory stubs: When recall or search matches document-backed memories, it returns a compact one-line stub (Document-backed memory: <title>). Pass --expand-documents to expand up to 3 stubs and up to 20,000 characters total, or use read --id <id> for targeted paginated reading.
- Mandatory confirmation guard: forget --id <id> --confirm strictly requires --confirm. Omitting this flag aborts locally with exit code 1 with zero network requests.
- Global execution options: All commands accept --json (raw JSON output), --terminal (preserve human formatting when piped), --timeout-ms <ms>, --base-url <url>, and --version.
Skill operations
Skills are the instruction-and-command lane for agents that do not mount a hosted MCP server directly.
Source: XMemo Skills