@mayurdluffy/cbm-cli
v1.0.8
Published
The ultimate manager for codebase-memory-mcp — install, build, share, and query codebase graphs with one command
Maintainers
Readme
Why CBM?
codebase-memory-mcp is a beast. It indexes your entire codebase into a queryable knowledge graph — functions, call chains, HTTP routes, cross-service links — and answers structural queries in under a millisecond after initial indexing. It cuts agent token usage by 10–100x depending on query type and supports 158 languages via tree-sitter, with deep semantic analysis for 12 major languages.
But getting it installed, keeping the binary updated, configuring a dozen different agents, and sharing the indexed graph with your team involves a lot of moving parts.
CBM handles all of that for you.
Think of CBM as the project-level manager that wraps the engine. One command to install the binary. One command to index your repo. One command for your teammates to jump in. No manual config file editing. No "works on my machine."
What CBM Does
- Installs & manages the
codebase-memory-mcpbinary for you. - Indexes your project into a shareable
graph.db.zstartifact. - Auto-configures 11 coding agents with an interactive menu — no copy-pasting JSON.
Limitations
- Best for structural queries — call chains, symbol discovery, blast radius analysis
- Not for semantic questions — "is this algorithm correct?" still requires reading code
- Tiny projects (<20 files) — grep may be faster than indexing
- Stale graphs — re-index after large refactors with
cbm re-index - Config/non-code files —
.env, Dockerfiles not indexed - Answer quality — 83% vs 92% for raw file exploration (arxiv paper)
Installation
Via npm (Recommended)
npm install -g @mayurdluffy/cbm-cliVia npx (No install)
npx @mayurdluffy/cbm-cli installVia curl (macOS / Linux)
curl -fsSL https://raw.githubusercontent.com/mayurdluffy/cbm-cli/main/install.sh | bashWindows
npm install -g @mayurdluffy/cbm-cli
# or
npx @mayurdluffy/cbm-cli installSecurity
The codebase-memory-mcp binary is closed-source but each release is signed, checksummed, and scanned. All processing is local — your code never leaves your machine. See upstream SECURITY.md.
Uninstalling
Remove the codebase-memory-mcp binary only
cbm uninstallThis removes the binary, cache, and config — but keeps cbm installed.
Remove cbm entirely
npm:
npm uninstall -g @mayurdluffy/cbm-clicurl (macOS / Linux):
npm uninstall -g @mayurdluffy/cbm-cliThe curl installer uses npm under the hood, so the uninstall command is the same.
Quick Start
# 1. Install the engine + select your agents
cbm install
# 2. Index your project and create a shareable graph
cd ~/projects/my-awesome-api
cbm build
# 3. Commit the graph so your team skips re-indexing
git add .codebase-memory/graph.db.zst
git commit -m "Add shareable codebase graph"
git push
# 4. Teammates clone and go
cbm useCLI at a Glance
@lucifer:~$ cbm
██████╗ ██████╗ ███╗ ███╗
██╔════╝ ██╔══██╗████╗ ████║
██║ ██████╔╝██╔████╔██║
██║ ██╔══██╗██║╚██╔╝██║
╚██████╗ ██████╔╝██║ ╚═╝ ██║
╚═════╝ ╚═════╝ ╚═╝ ╚═╝
Codebase Memory Manager
- Supercharge your agentic coding — without the token bleed
Usage: cbm [command]
Setup:
install (i) Install codebase-memory-mcp + select agents
update (up) Update to latest version
uninstall Remove from system
version (-V, -v) Show version info
kill (k) Stop running server
help (-h, --help) Show help
Project:
build (b) Index + create shareable graph + select agents
use (u) Use shared graph (no indexing needed)
re-index (ri) Force re-index + fresh artifact
status (s) Show project graph status
Options:
--version, -V, -v Show version
--help, -h Show help
--yes, -y Skip prompts
--agents, -a Specify agents (comma-separated)
Raw CLI:
cbm <cmd> Any codebase-memory-mcp CLI command
Example: cbm cli search_graph '{"name_pattern": ".*"}'
Supported Agents:
Claude Code, Codex CLI, Gemini CLI, Zed, OpenCode,
Antigravity, Aider, KiloCode, VS Code, OpenClaw, Kiro
Notes:
• Aider: No native MCP config — use ./cbm-aider wrapper
• Antigravity: Shares Gemini CLI config file
Workflow:
cbm install → select agents → cbm build → select agents → git pushCommands
Setup
| Command | Alias | Description |
|---|---|---|
| cbm install | i | Install codebase-memory-mcp + select agents |
| cbm update | up | Update to latest version |
| cbm uninstall | | Remove from system |
| cbm version | -V, -v | Show version info |
| cbm kill | k | Stop running server |
| cbm help | -h, --help | Show help |
Project
| Command | Alias | Description |
|---|---|---|
| cbm build | b | Index + create shareable graph.db.zst + select agents |
| cbm use | u | Use shared graph (no indexing needed) |
| cbm re-index | ri | Force re-index + fresh artifact |
| cbm status | s | Show project graph status |
Raw CLI
Any command not recognized by cbm is passed to codebase-memory-mcp:
cbm cli search_graph '{"name_pattern": ".*Handler"}'
cbm cli get_architecture '{}'
cbm config get auto_index
cbm --versionNon-Interactive / CI Mode
Use --yes to skip prompts and select all agents, or --agents to specify a comma-separated list:
# Install and configure all agents without prompting
cbm install --yes
# Build and configure only Claude Code (1) and OpenCode (5)
cbm build --agents 1,5
# Use shared graph and configure only VS Code (9)
cbm use --agents 9Agent numbers:
- Claude Code
- Codex CLI
- Gemini CLI
- Zed
- OpenCode
- Antigravity
- Aider
- KiloCode
- VS Code
- OpenClaw
- Kiro
Interactive Agent Selection
CBM features an interactive arrow-key menu for selecting coding agents:
Configure which agents for this project?
↑↓ navigate · space toggle · a all · n none · enter confirm
❯ ○ Claude Code
○ Codex CLI
● Zed ← toggled
○ OpenCode
● VS Code ← toggled
...Workflows
Owner Workflow
cd ~/projects/my-api
cbm build # Index + create artifact
git add .codebase-memory/graph.db.zst
git commit -m "Add codebase graph"
git pushTeammate Workflow
git clone <repo>
cd <repo>
cbm use # No indexing needed!
# Restart agent and codeRefactor Workflow
cd ~/projects/my-api
cbm re-index # Fresh graph after big changes
git add .codebase-memory/graph.db.zst
git commit -m "Update graph after refactor"
git pushWhat Gets Created
my-awesome-api/
├── .codebase-memory/
│ ├── cbm-server.sh ← MCP wrapper (committed)
│ └── graph.db.zst ← Shareable graph (committed)
├── .opencode/ ← if OpenCode selected
│ └── opencode.json ← OpenCode config (committed)
├── .claude/ ← if Claude Code selected
│ └── .mcp.json ← Claude Code config (committed)
├── .vscode/ ← if VS Code selected
│ └── mcp.json ← VS Code config (committed)
├── CONVENTIONS.md ← Aider conventions (if Aider selected)
├── cbm-aider ← Aider wrapper (if Aider selected)
├── .gitignore ← Ignores live DB
└── .gitattributes ← Prevents merge conflictsCross-Platform
| OS | Status |
|---|---|
| macOS | ✅ Fully supported |
| Linux | ✅ Fully supported |
| Windows | ✅ Supported (npm, PowerShell, Git Bash, WSL) |
| CI/CD | ✅ Non-interactive fallback with --yes / --agents |
Pro Tips
1. The Graph Travels With the Code
Commit graph.db.zst and CI can use it:
# .github/workflows/ci.yml
- name: Use codebase graph
run: |
npm install -g @mayurdluffy/cbm-cli
cbm use --yes
# run structural tests2. Keep It Updated
After large refactors, run cbm re-index and commit the new graph.db.zst so teammates stay in sync.
3. Aider Users
Aider has no native MCP config file. Use the generated ./cbm-aider wrapper to launch Aider with codebase-memory-mcp attached.
Troubleshooting
| Issue | Fix |
|---|---|
| command not found: cbm | npm install -g @mayurdluffy/cbm-cli or use npx @mayurdluffy/cbm-cli |
| codebase-memory-mcp not found | cbm install |
| Agent doesn't see tools | Restart agent; check cbm status |
| graph.db.zst missing | Run cbm build |
| Server won't start | cbm kill then restart agent |
| Stale graph | cbm re-index and commit |
| Interactive menu hangs in CI | Use cbm <cmd> --yes or --agents N,M |
Contributing
This is a community project. Contributions, issues, and feedback are welcome!
License
MIT — see LICENSE.
