feat(installer): add Gemini CLI + Antigravity IDE targets (#399) (#458)

`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 commit is contained in:
Colby Mchenry
2026-05-26 11:29:18 -05:00
committed by GitHub
co-authored by Claude Opus 4.7
parent 7479c5e82b
commit 180ba785ce
8 changed files with 753 additions and 9 deletions
+10
View File
@@ -9,6 +9,16 @@ and adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added
- **Installer targets for Gemini CLI and the Antigravity IDE.** `codegraph install` (and the interactive prompt) now detect and configure two more agents out of the box:
- **Gemini CLI** (also covers the rebranded Antigravity CLI) — writes `mcpServers.codegraph` to `~/.gemini/settings.json` (global) or `./.gemini/settings.json` (local), and the codegraph usage block into `~/.gemini/GEMINI.md` / `./GEMINI.md`. Existing top-level settings (e.g. `security.auth`) and sibling MCP servers are preserved.
- **Antigravity IDE** — writes `mcpServers.codegraph` to Antigravity's unified MCP config at `~/.gemini/config/mcp_config.json` (post-migration, signalled by the `.migrated` marker Antigravity itself drops). Falls back to the legacy `~/.gemini/antigravity/mcp_config.json` for users on a pre-migration Antigravity build. On install, a stale codegraph entry in the legacy path is migrated to the new file automatically. Uninstall sweeps both. Antigravity-managed sibling fields (e.g. the `"disabled": true` flag the IDE adds when a user disables a server through the UI) are preserved across re-installs.
- The Antigravity entry omits the `type: "stdio"` field the other targets use — Antigravity rejects entries that carry it.
- On macOS, the Antigravity entry resolves `codegraph` to its absolute path at install time (e.g. an nvm-managed `~/.nvm/.../bin/codegraph`). macOS GUI apps launched from Dock/Finder get a stripped PATH that doesn't include nvm, so a bare command name fails to spawn — even when `which codegraph` works in your shell. Linux GUI apps inherit user PATH and Windows uses env `PATH` directly, so both keep the bare command.
- The IDE shares `GEMINI.md` with Gemini CLI, so the two targets compose naturally when both are installed; the antigravity target deliberately doesn't touch `GEMINI.md` so uninstalling Antigravity alone leaves CLI instructions intact.
Both targets are tested on the same parameterized contract as the existing five agents (idempotent install, sibling preservation, install/uninstall round-trip), with extra coverage for migration-marker detection, legacy → unified entry migration, sibling `disabled` field preservation, and the cross-target case where Gemini CLI and Antigravity IDE coexist in the same `~/.gemini/`. Closes #399.
## [0.9.5] - 2026-05-25
### Added