@membank/cli
v0.20.0
Published
CLI and npx entrypoint for membank. Manages memories from the terminal and starts the MCP server for LLM harnesses.
Downloads
1,638
Readme
@membank/cli
CLI and npx entrypoint for membank. Manages memories from the terminal and starts the MCP server for LLM harnesses.
Install
npm install -g @membank/cliOr use without installing:
npx @membank/cli <command>Setup
Run once to configure your LLM harness:
membank setupThis auto-detects installed harnesses (Claude Code, Codex, OpenCode), writes MCP server config, installs session hooks, and downloads the embedding model (~33 MB).
Options:
--harness <name> Target a specific harness instead of auto-detecting
--yes Skip confirmation prompts
--dry-run Preview changes without writing files
--json Machine-readable outputSupported harnesses: claude-code, codex, opencode (see membank setup for harness-specific setup instructions)
membank setup upgrade
Migrate existing harness configs from the old npx @membank/cli --mcp pattern to the standalone npx @membank/mcp binary:
membank setup upgradeRun this once after upgrading to align all configured harnesses with the new standalone MCP package.
Commands
membank query <text>
Semantic search over stored memories.
membank query "how to run pnpm in one package"
membank query "auth decisions" --type decision --limit 5Options: --type <type>, --limit <n> (default 10), --include-pinned
membank add <content>
Save a new memory.
membank add "Use --filter flag for scoped pnpm commands" --type preference --tags "pnpm,monorepo"Required: --type <type>
Options: --tags <a,b,c>, --global
membank list
List stored memories.
membank list
membank list --type correction
membank list --pinnedOptions: --type <type>, --pinned
membank stats
Show memory counts by type.
membank statsmembank pin <id> / membank unpin <id>
Pin a memory so it's always injected at session start.
membank pin abc123
membank unpin abc123membank delete <id>
Delete a memory. Prompts for confirmation unless --yes is passed.
membank delete abc123
membank delete abc123 --yesmembank export
Export all memories to a JSON file.
membank export
membank export --output my-backup.jsonDefault filename: membank-export-<timestamp>.json
membank import <file>
Import memories from an export file.
membank import membank-export-2025-01-01.json
membank import membank-export-2025-01-01.json --yesmembank review
List memories flagged for deduplication review, or dismiss review events.
membank review
membank review --resolve <id>membank migrate <mode> [name]
List or run named data migrations.
membank migrate list
membank migrate run <name>membank config
Read and write config values.
membank config get <key>
membank config set <key> <value>
membank config showmembank synthesize
View and manage memory synthesis.
membank synthesize run # trigger a synthesis run for a scope
membank synthesize show # current synthesis for global scope
membank synthesize show --scope <s> # synthesis for a specific project scope
membank synthesize status # all scopes and their synthesis stateOptions for run and show: --scope <scope>
membank activity
List activity events for the current project.
membank activity
membank activity --type memory.created
membank activity --since 2025-01-01
membank activity --globalOptions: --type <event_type> (memory.created|updated|deleted|flagged|queried), --since <date>, --memory-id <id>, --limit <n> (default 50), --global, --scope <hash>
membank inject
Output session context formatted for a harness. Called automatically by session hooks — you don't normally run this directly.
membank inject --harness claude-codeOptions: --harness <name> (claude-code|codex|opencode), --event <event> (session-start)
membank dashboard (deprecated)
The dashboard is now a standalone package. Run it directly:
npx @membank/dashboardSee @membank/dashboard for options.
Global flags
--json Output machine-readable JSON
--yes, -y Skip confirmation prompts
--mcp Start MCP stdio server (deprecated — use npx @membank/mcp)MCP server mode
The preferred way to run the MCP server is via the standalone package:
npx @membank/mcpmembank setup writes this command into harness configs automatically. The legacy membank --mcp flag still works but emits a deprecation warning. Run membank setup upgrade to migrate existing harness configs.
Session hooks
setup installs hooks for each supported harness:
- claude-code — SessionStart hook (fires on startup, resume, clear, and compact) + SessionEnd hook in
~/.claude/settings.json. Context is re-injected automatically after context compaction. - codex — SessionStart hook (fires on startup, resume, clear, and compact) in
~/.codex/hooks.json. Context is re-injected automatically after context compaction. - opencode — plugin at
~/.config/opencode/plugins/membank.jsusingexperimental.chat.system.transform(injects on first call per session) andexperimental.compaction.autocontinue(resets the injection flag after compaction so context is re-injected on the next LLM call). - copilot — MCP server config only; Copilot CLI hooks do not support context injection and have no post-compaction mechanism.
Requirements
- Node.js >=24
