The brain binary is the operator command-line surface. This page is the command reference.
The CLI covers retrieval, ingest (directories), self-correction, domain/retention/backup/key
management, UMP, clients, and health — the commands it ships in src/bin/brain.rs (hand-rolled argument
parsing, no clap). Per-client DSAR and legal hold are exposed here via brain client; the actions
the CLI does not expose (erasure of a bare chunk, proposal approval, the global audit log) live
on the HTTP API or the client console.
Atomically rotate the bearer token (v1.27.12): a fresh 32-byte hex token is written to a 0600 temp file (create_new, never umask-dependent), fsync’d, and renamed over the configured token file. Refuses to overwrite a group/world-readable target. Restart the server to pick it up.
# Health + stats
brain status
# Structured recall with lexical control
brain query "blueberry alternative" --phrase "antioxidant" --exclude "smoothie" --k 5
# Explain why results were chosen
brain explain "blueberry alternative"
# Ingest a whole vault directory (dry-run first, then for real)
brain ingest-dir ~/notes/health --dry-run
brain ingest-dir ~/notes/health
# Check the memory for duplicates and conflicts
brain check-consistency
# Back up the database (passphrase via file; DB path from BRAIN_DB_PATH)
brain backup ~/backups/brain-$(date +%F).enc --passphrase-file ~/.config/brain-server/backup.pass