MemBrain CLI
npm i -g mem-brain-cli, run mb auth login once with your API key, then use mb from Claude Code, Cursor, Gemini CLI, OpenCode, or any other environment that can invoke a CLI.npm global
Install once: mem-brain-cli → mb everywhere
API key login
mb auth login stores credentials locally
Memory graph
Search, traverse, import, and export
Agent-ready I/O
--json and --toon on every command
Install
Global package, authenticate once with your API key, then use mb from any terminal.
npm i -g mem-brain-climb auth login# optional: non-interactivemb auth login --key YOUR_API_KEYInteractive mode
Run mb with no arguments (or mb interactive) in a TTY for the REPL, banner, and built-in help.
60-second path
Same flow as mb quickstart — copy and run in order.
mb auth loginmb add "My first memory" --scope demomb search "first memory" --k 3mb statsWorks wherever a shell runs
No special host required — if it can execute mb, it can use MemBrain.
Claude Code
Shell out to mb from skills, hooks, or terminal steps.
Cursor
Run mb in the integrated terminal or agent-run commands.
Gemini CLI
Pipe mb --json output into prompts and scripts.
OpenCode & more
Anything that can execute CLI can use MemBrain.
--json or --toon to any mb command for pipelines, wrappers, and agent tools. Per-invocation override: --key for an API key without saving it.Command reference
Expand a category for context, tips, and copy-paste examples. Run mb --help or mb help <command> for every flag.
Store your MemBrain API key locally so every mb subcommand can reach your workspace. Use non-interactive login in CI or headless agents.
Essentials
- mb auth login — prompt or paste key; add --key for scripts.
- mb auth status — shows key fingerprint, user id, memory counts.
- mb auth logout — clears saved credentials from this device.
mb auth loginmb auth login --key YOUR_API_KEYmb auth statusmb auth logoutTip: append --json or --toon to parse output in scripts and agents.