memaxdocs
CLI Reference

CLI Reference

Complete reference for the Memax CLI. Every command, subcommand, flag, and option.

The Memax CLI (memax-cli) is the primary interface for power users. It's designed to feel like git — composable commands, Unix-friendly (pipes, redirection), fast startup, minimal output.

npm install -g memax-cli

The binary is memax.

Command overview

Memory operations

CommandDescription
pushSave a single piece of content.
push alias: rememberSame as push.
recallSemantic search against your hub(s).
listPaginated listing of memories.
importOne-way import of a directory.
ask <question>LLM-synthesized answer grounded in your memories.
show <id>Print a single memory in full.
delete <id>Delete a memory (interactive confirm unless -y).

Hub management

CommandDescription
hub listList hubs you can access.
hub create <name>Create a team hub.
hub switch <id-or-slug>Set the active hub.
hub membersList members of a hub.
hub invite …Create / list / revoke / regenerate / accept invites.

Organization

CommandDescription
topic listList topics (the personal taxonomy).
topic createCreate a topic.
topic setAssign a memory to a topic.
topic clearUnassign a memory from a topic.
topic deleteDelete a topic.

Agents

CommandDescription
agents syncBidirectional sync of configs + sessions.
agents listCombined listing of synced configs and sessions.
agents configs …Config-only sync, list, recovery, doctor.
agents sessions …Session-only sync, list, recovery, doctor.
hook install | uninstallInstall the Claude Code hook (deprecated; prefer setup --hooks).
mcp serveRun the local stdio MCP server.

Setup

CommandDescription
setupConfigure MCP + hooks + instructions on this machine.
teardownReverse setup.
capture-sessionPersist an agent session (summary + decisions + learnings).

Auth & account

CommandDescription
loginInteractive OAuth sign-in.
logoutClear stored credentials.
whoamiShow the currently signed-in user.
auth create-key <name>Generate an API key.
auth list-keysList your keys.
auth revoke-key <id>Revoke a key.

Dreams (knowledge organization)

CommandDescription
dreams listList recent dream runs.
dreams reportShow the latest dream report (contradictions, etc.).
dreams triggerManually trigger a dream run.

Configuration

CommandDescription
config get [key]Read config (or all values).
config set <key> <value>Write a config value.

Environment variables

The CLI reads these env vars:

Env varPurpose
MEMAX_API_KEYNon-interactive auth. Takes precedence over stored OAuth credentials.
MEMAX_API_URLPoint the CLI at a non-default backend. Overrides the api_url in ~/.memax/config.json.

MEMAX_HUB, MEMAX_NO_COLOR, and MEMAX_DEBUG are not read by the CLI today. To change the default hub, use memax hub switch (affects read scoping), pass --hub <slug> per call, or set hub: <slug> in a repo-local .memax.yml (affects memax push). Per-command flags like --hub <slug> and --format json|text override the defaults for the call they're passed to.

Output format

Most commands accept --format text|json. JSON output is intended to be stable for scripting; human-readable output may change between versions.

memax list --format json | jq '.memories[] | {id, title}'
memax recall "deploy process" --format json | jq '.memories[0].chunk_content'

Composition

The CLI follows Unix conventions:

# Pipe recall to the clipboard
memax recall "auth design" --format text | pbcopy

# Query from stdin
cat question.txt | memax recall

# Use in shell scripts
if memax recall "deploy checklist" --format text | grep -q "migration"; then
  echo "Don't forget to run migrations"
fi

memax exits 0 on success, non-zero on error, and writes human output to stdout. Machine-readable output uses --format json.