feat(plugins): add OpenClaw target#887
Open
Elzlxx wants to merge 1 commit into
Open
Conversation
Adds a thin OpenClaw shell wrapping the CodeGraph installer. OpenClaw becomes the 9th supported agent (joining Claude, Cursor, Codex, opencode, Hermes, Gemini, Antigravity, and Kiro). Writes the codegraph MCP server entry into $HOME/.openclaw/openclaw.json under mcp.servers.codegraph. Sibling MCP servers (chrome-mcp, etc.) and all other top-level config keys (channels, agents, gateway) are preserved on install and uninstall. Single global location — OpenClaw is a single gateway with no per-project config layer, so local install returns a note and writes nothing. Project root is auto-detected by walking up from cwd looking for an existing .codegraph/ directory, falling back to cwd. Mirrors the behavior of `codegraph init`. End-to-end tested: - 13 new openclaw-specific tests (sibling preservation, idempotency, uninstall behavior, detect transitions, local-install refusal) - All 157 installer-target tests pass - Full test suite (1549 tests) passes - npm run build (tsc) is clean Files: - src/installer/targets/openclaw.ts — new target implementation - src/installer/targets/registry.ts — add openclawTarget to ALL_TARGETS - src/installer/targets/types.ts — add 'openclaw' to TargetId union - __tests__/installer-targets.test.ts — 13 new openclaw tests - README.md — list OpenClaw in supported-agents badges and prose
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an OpenClaw installer target so
codegraph install(and the standalone installer) auto-wires the CodeGraph MCP server into OpenClaw. OpenClaw becomes the 9th supported agent — joining Claude, Cursor, Codex, opencode, Hermes, Gemini, Antigravity, and Kiro.What's in this PR
src/installer/targets/openclaw.ts(new) — implementsAgentTargetfor OpenClaw:~/.openclaw/openclaw.json(falls back to$XDG_CONFIG_HOME/openclaw/)mcp.servers.codegraphwith absolute codegraph binary path,--serve --mcp --path <project>,CODEGRAPH_TELEMETRY=0, and the project cwdsupportsLocation('local')returnsfalseandinstall('local')returns a note and writes nothingmcp.servers.codegraphwrite — preserves all sibling MCP servers (chrome-mcp, wordpress-deltabis, user-defined) and all other top-level config keys (channels, agents, gateway)action: 'unchanged'mcp.servers.codegraph; siblings and other keys intact.codegraph/, mirroringcodegraph initbehaviorsrc/installer/targets/registry.ts— registersopenclawTargetsrc/installer/targets/types.ts— extendsTargetIdunion with'openclaw'__tests__/installer-targets.test.ts— 13 new openclaw-specific tests (sibling preservation, top-level config preservation, idempotency, uninstall, local-install refusal, detect transitions)README.md— adds OpenClaw to supported-agents badges and proseTest Results
installer-targets(157 tests)npm run build(tsc)The 13 new openclaw tests cover: greenfield install, sibling MCP preservation, sibling top-level config preservation (channels/agents/gateway), idempotent re-run, uninstall with siblings intact, local install refusal with note, and the before/after detect transitions.
Why OpenClaw
OpenClaw is an open-source multi-agent gateway (github.com/openclaw/openclaw) with a Claude/Codex-style config format. It's a natural fit — single global config dir, MCP server entries in a
mcp.serversnamespace, same write pattern as the existing 8 targets.The contributor (Elzlxx) runs OpenClaw as a 4-agent production setup and will use this target daily for code exploration on
geoxylia-audit,SkillOpt, andkobe-capital.Notes
TargetIdunion pattern as the existing 8 targets. Mirrors the opencode test scaffolding (env-redirection viasetHome(), XDG_CONFIG_HOME handling, etc.).~/.local/bin/codegraph,~/.codegraph/bin/codegraph,/usr/local/bin/codegraph,/opt/homebrew/bin/codegraph) with a PATH-resolved fallback.jsonDeepEqualshared helper for idempotency detection.License
MIT (consistent with the rest of the repo).