Skip to content

Commit 63e6141

Browse files
committed
Add OpenClaw + VS Code agent detection (10 agents total)
- OpenClaw: detect ~/.openclaw/, write MCP config to openclaw.json - VS Code was already wired in PR #79 but not counted in README - Agent struct initializer uses memset instead of counting booleans - README updated: 8 → 10 agents
1 parent 8ca7199 commit 63e6141

3 files changed

Lines changed: 40 additions & 6 deletions

File tree

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
**The fastest and most efficient code intelligence engine for AI coding agents.** Full-indexes an average repository in milliseconds, the Linux kernel (28M LOC, 75K files) in 3 minutes. Answers structural queries in under 1ms. Ships as a single static binary for macOS, Linux, and Windows — download, run `install`, done.
44

5-
High-quality parsing through [tree-sitter](https://tree-sitter.github.io/tree-sitter/) AST analysis across all 64 languages, enhanced with LSP-style hybrid type resolution for Go, C, and C++ (more languages coming soon) — producing a persistent knowledge graph of functions, classes, call chains, HTTP routes, and cross-service links. 14 MCP tools. Zero dependencies. Plug and play across 8 coding agents.
5+
High-quality parsing through [tree-sitter](https://tree-sitter.github.io/tree-sitter/) AST analysis across all 64 languages, enhanced with LSP-style hybrid type resolution for Go, C, and C++ (more languages coming soon) — producing a persistent knowledge graph of functions, classes, call chains, HTTP routes, and cross-service links. 14 MCP tools. Zero dependencies. Plug and play across 10 coding agents.
66

77
<p align="center">
88
<img src="docs/graph-ui-screenshot.png" alt="Graph visualization UI showing the codebase-memory-mcp knowledge graph" width="800">
@@ -16,7 +16,7 @@ High-quality parsing through [tree-sitter](https://tree-sitter.github.io/tree-si
1616
- **Plug and play** — single static binary for macOS (arm64/amd64), Linux (arm64/amd64), and Windows (amd64). No Docker, no runtime dependencies, no API keys. Download → `install` → restart agent → done.
1717
- **64 languages** — vendored tree-sitter grammars compiled into the binary. Nothing to install, nothing that breaks.
1818
- **120x fewer tokens** — 5 structural queries: ~3,400 tokens vs ~412,000 via file-by-file search. One graph query replaces dozens of grep/read cycles.
19-
- **8 agents, one command**`install` auto-detects Claude Code, Codex CLI, Gemini CLI, Zed, OpenCode, Antigravity, Aider, KiloCode and configures MCP entries, instruction files, and pre-tool hooks for each.
19+
- **10 agents, one command**`install` auto-detects Claude Code, Codex CLI, Gemini CLI, Zed, OpenCode, Antigravity, Aider, KiloCode, VS Code, and OpenClaw — configures MCP entries, instruction files, and pre-tool hooks for each.
2020
- **Built-in graph visualization** — 3D interactive UI at `localhost:9749` (optional UI binary variant).
2121
- **14 MCP tools** — search, trace, architecture, impact analysis, Cypher queries, dead code detection, cross-service HTTP linking, ADR management, and more.
2222

@@ -221,6 +221,8 @@ Restart your agent. Verify with `/mcp` — you should see `codebase-memory-mcp`
221221
| Antigravity | `mcp_config.json` | `AGENTS.md` ||
222222
| Aider || `CONVENTIONS.md` ||
223223
| KiloCode | `mcp_settings.json` | `~/.kilocode/rules/` ||
224+
| VS Code | `Code/User/mcp.json` |||
225+
| OpenClaw | `openclaw.json` |||
224226

225227
**Hooks** are advisory (exit code 0) — they remind agents to prefer MCP graph tools when they reach for grep/glob/read, without blocking the tool call.
226228

@@ -327,7 +329,7 @@ Plus: Clojure, F#, Julia, Vim Script, Nix, Common Lisp, Elm, Fortran, CUDA, COBO
327329
src/
328330
main.c Entry point (MCP stdio server + CLI + install/update/config)
329331
mcp/ MCP server (14 tools, JSON-RPC 2.0, session detection, auto-index)
330-
cli/ Install/uninstall/update/config (8 agents, hooks, instructions)
332+
cli/ Install/uninstall/update/config (10 agents, hooks, instructions)
331333
store/ SQLite graph storage (nodes, edges, traversal, search, Louvain)
332334
pipeline/ Multi-pass indexing (structure → definitions → calls → HTTP links → config → tests)
333335
cypher/ Cypher query lexer, parser, planner, executor

src/cli/cli.c

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,8 @@ int cbm_remove_zed_mcp(const char *config_path) {
813813
/* ── Agent detection ──────────────────────────────────────────── */
814814

815815
cbm_detected_agents_t cbm_detect_agents(const char *home_dir) {
816-
cbm_detected_agents_t agents = {false, false, false, false, false, false, false, false, false};
816+
cbm_detected_agents_t agents;
817+
memset(&agents, 0, sizeof(agents));
817818
if (!home_dir || !home_dir[0]) {
818819
return agents;
819820
}
@@ -884,6 +885,12 @@ cbm_detected_agents_t cbm_detect_agents(const char *home_dir) {
884885
agents.vscode = true;
885886
}
886887

888+
/* OpenClaw: ~/.openclaw/ dir */
889+
snprintf(path, sizeof(path), "%s/.openclaw", home_dir);
890+
if (stat(path, &st) == 0 && S_ISDIR(st.st_mode)) {
891+
agents.openclaw = true;
892+
}
893+
887894
return agents;
888895
}
889896

@@ -2169,8 +2176,12 @@ int cbm_cmd_install(int argc, char **argv) {
21692176
if (agents.vscode) {
21702177
printf(" VS-Code");
21712178
}
2179+
if (agents.openclaw) {
2180+
printf(" OpenClaw");
2181+
}
21722182
if (!agents.claude_code && !agents.codex && !agents.gemini && !agents.zed && !agents.opencode &&
2173-
!agents.antigravity && !agents.aider && !agents.kilocode && !agents.vscode) {
2183+
!agents.antigravity && !agents.aider && !agents.kilocode && !agents.vscode &&
2184+
!agents.openclaw) {
21742185
printf(" (none)");
21752186
}
21762187
printf("\n\n");
@@ -2356,7 +2367,18 @@ int cbm_cmd_install(int argc, char **argv) {
23562367
printf(" mcp: %s\n", config_path);
23572368
}
23582369

2359-
/* Step 13: Ensure PATH */
2370+
/* Step 13: Install OpenClaw */
2371+
if (agents.openclaw) {
2372+
printf("OpenClaw:\n");
2373+
char config_path[1024];
2374+
snprintf(config_path, sizeof(config_path), "%s/.openclaw/openclaw.json", home);
2375+
if (!dry_run) {
2376+
cbm_install_editor_mcp(self_path, config_path);
2377+
}
2378+
printf(" mcp: %s\n", config_path);
2379+
}
2380+
2381+
/* Step 14: Ensure PATH */
23602382
char bin_dir[1024];
23612383
snprintf(bin_dir, sizeof(bin_dir), "%s/.local/bin", home);
23622384
const char *rc = cbm_detect_shell_rc(home);
@@ -2551,6 +2573,15 @@ int cbm_cmd_uninstall(int argc, char **argv) {
25512573
printf("VS Code: removed MCP config entry\n");
25522574
}
25532575

2576+
if (agents.openclaw) {
2577+
char config_path[1024];
2578+
snprintf(config_path, sizeof(config_path), "%s/.openclaw/openclaw.json", home);
2579+
if (!dry_run) {
2580+
cbm_remove_editor_mcp(config_path);
2581+
}
2582+
printf("OpenClaw: removed MCP config entry\n");
2583+
}
2584+
25542585
/* Step 2: Remove indexes */
25552586
int index_count = 0;
25562587
const char *cache_dir = get_cache_dir(home);

src/cli/cli.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ typedef struct {
114114
bool aider; /* aider on PATH */
115115
bool kilocode; /* KiloCode globalStorage dir exists */
116116
bool vscode; /* VS Code User config dir exists */
117+
bool openclaw; /* ~/.openclaw/ exists */
117118
} cbm_detected_agents_t;
118119

119120
/* Detect which coding agents are installed.

0 commit comments

Comments
 (0)