feat(installer): add Grok Build target#1324
Open
leihanchen wants to merge 1 commit into
Open
Conversation
Add Grok Build (xAI) as a supported installer target so codegraph install auto-wires the CodeGraph MCP server into Grok's config. - New src/installer/targets/grok.ts implementing AgentTarget for Grok - Config: ~/.grok/config.toml (global) or .grok/config.toml (local) - MCP format: [mcp_servers.codegraph] TOML table (same as Codex) - Supports both global and project-scoped installs - Respects GROK_HOME env var override - Writes marker-fenced CodeGraph block to ~/.grok/AGENTS.md (global) - No permissions concept (Grok gates through its own UI) - Idempotent: byte-equal re-runs return action='unchanged' - Uninstall preserves sibling MCP servers and other TOML sections - Register grokTarget in registry.ts, add 'grok' to TargetId union - 13 new tests in installer-targets.test.ts covering install, sibling preservation, top-level section preservation, idempotent re-run, uninstall, local install, detect transitions, and GROK_HOME override - Update README.md with Grok Build in badges and agent lists
leihanchen
force-pushed
the
feat/grok_build_target
branch
from
July 17, 2026 03:07
c11fc34 to
3c6041a
Compare
leihanchen
marked this pull request as ready for review
July 17, 2026 03:08
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Adds a Grok Build installer target so
codegraph installauto-wires the CodeGraph MCP server into Grok Build. Grok Build becomes the 10th supported agent — joining Claude, Cursor, Codex, opencode, Hermes, Gemini, Antigravity, Kiro, and OpenClaw.What is in this PR:
src/installer/targets/grok.ts(new) — implementsAgentTargetfor Grok Build:~/.grok/config.toml(falls back to$GROK_HOME/config.toml)[mcp_servers.codegraph]TOML table withcommand = "codegraph"andargs = ["serve", "--mcp"]~/.grok/config.toml) and project-scoped (.grok/config.toml) installsGROK_HOMEenv var override for config directory[mcp_servers.codegraph]write — preserves all sibling MCP servers and other top-level TOML sections ([cli],[models],[ui],[plugins],[marketplace], etc.)action: "unchanged"[mcp_servers.codegraph]; siblings and other sections intact.grok/config.tomland the empty.grok/dir if only codegraph was present~/.grok/AGENTS.md(global only) — subagents and non-MCP harnesses read AGENTS.md but never the MCP initialize instructionssrc/installer/targets/registry.ts— registersgrokTargetsrc/installer/targets/types.ts— extendsTargetIdunion with"grok"__tests__/installer-targets.test.ts— 13 new grok-specific tests (sibling preservation, top-level section preservation, idempotency, uninstall, local install, local uninstall cleanup, detect transitions, GROK_HOME override)README.md— adds Grok Build to supported-agents badges and proseWhy Grok Build: Grok Build is xAI's CLI agent (https://x.ai) with a TOML-based config at
~/.grok/config.toml. It uses[mcp_servers.<name>]sections for MCP server entries — the same TOML format as Codex, so it reuses the existingtoml.tsserializer. It also supports project-scoped config at.grok/config.toml, making it a natural fit for both install locations.Test Results:
installer-targets(176 tests)npm run build(tsc)Notes:
TargetIdunion pattern as the existing targets. Mirrors the Codex test scaffolding (TOML format, global-only instructions).toml.ts) — no new dependency.~/.grok/docs/user-guide/07-mcp-servers.mdand~/.grok/docs/user-guide/05-configuration.md.