feat(installer): add Gemini CLI + Antigravity IDE targets (#399)#458
Merged
Conversation
`codegraph install` now detects and configures two more agents:
- Gemini CLI / Antigravity CLI — `~/.gemini/settings.json` (or
`./.gemini/settings.json`) + `~/.gemini/GEMINI.md` (or project-root
`./GEMINI.md`). Preserves pre-existing top-level settings like
`security.auth` and sibling MCP servers.
- Antigravity IDE — writes to Antigravity's unified MCP config at
`~/.gemini/config/mcp_config.json` (post-migration, detected via
the `.migrated` marker Antigravity drops). Falls back to the
legacy `~/.gemini/antigravity/mcp_config.json` on pre-migration
builds; install migrates a stale legacy entry, uninstall sweeps
both. Antigravity-managed sibling fields (e.g. the `disabled` flag
added when users disable a server through the UI) survive re-install.
Two Antigravity-specific quirks the target handles:
1. Entries with `type: "stdio"` are silently rejected by
Antigravity's MCP scanner; we omit the field for this target.
2. macOS GUI apps launched from Dock/Finder get a stripped PATH
that excludes nvm — a bare `codegraph` command name fails to
spawn even when `which codegraph` works in the user's shell.
The target resolves `codegraph` to its absolute path at install
time on macOS. Linux + Windows are unaffected.
End-to-end validated:
- macOS: real Gemini CLI v0.43 via tmux — `/mcp` shows codegraph with
all 10 tools, `codegraph_status` executes and returns real index
state. Real Antigravity IDE shows codegraph under Customizations
after restart.
- Linux (Docker node:22-bookworm) + Windows (Parallels Win11): 116
installer tests pass; CLI install + uninstall round-trip verified.
Test coverage: the new targets inherit the existing parameterized
contract (idempotent install, sibling preservation, install/uninstall
round-trip). Plus 14 target-specific tests covering migration-marker
detection, legacy→unified entry migration, `disabled` flag
preservation, the `type` field omission, gemini+antigravity
coexistence in the same `~/.gemini/`, and macOS-only path resolution.
Full suite: 972 passing.
Closes #399.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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 two installer targets so
codegraph installconfigures Gemini CLI and the Antigravity IDE out of the box, closes #399.~/.gemini/settings.json+~/.gemini/GEMINI.md(or project-local equivalents). Preserves pre-existing top-level settings likesecurity.authand sibling MCP servers.~/.gemini/config/mcp_config.json(post-migration, detected via the.migratedmarker Antigravity itself drops). Falls back to the legacy~/.gemini/antigravity/mcp_config.jsonfor pre-migration builds; install migrates a stale legacy entry, uninstall sweeps both. Antigravity-managed sibling fields (e.g. the"disabled": trueflag added when a user disables a server through the IDE) survive re-install.Antigravity quirks the target handles
These caused codegraph to silently fail to appear in Antigravity's MCP server list on initial implementation; both are now in the installer.
type: "stdio"is rejected — Antigravity silently drops MCP entries that carry this field. The working entries it manages itself omit it, so the antigravity target omits it too. (All other targets keeptype: "stdio"— only Antigravity is picky about this.)/usr/bin:/bin:/usr/sbin:/sbin) that doesn't include nvm. A barecodegraphcommand name fails to spawn even whenwhich codegraphworks in the user's shell. The target resolvescodegraphto its absolute path at install time on macOS. Linux GUI apps inherit user PATH and Windows reads env PATH directly, so both keep the bare command.End-to-end validation
/mcpreports🟢 codegraph - Ready (10 tools);codegraph_statusexecuted and returned the real index state (188 files, 2854 nodes). Real Antigravity IDE shows codegraph in Customizations → Installed MCP Servers after restart.node:22-bookworm) — 116 installer tests pass; CLI install + uninstall round-trip verified, including the unified-path detection.Test plan
security.auth, GEMINI.md sibling content; local path writes to./.gemini/settings.json+ project-root./GEMINI.mdtypefield, siblingdisabledflag preserved, install migrates a legacy entry to unified, uninstall sweeps both paths~/.gemini/; uninstalling one preserves the other's MCP entry🤖 Generated with Claude Code