Skip to content

feat: add Google Antigravity CLI (agy) as first-class APM target#1770

Open
sergio-sisternes-epam wants to merge 2 commits into
mainfrom
sergio-sisternes-epam/feat-antigravity-cli-target
Open

feat: add Google Antigravity CLI (agy) as first-class APM target#1770
sergio-sisternes-epam wants to merge 2 commits into
mainfrom
sergio-sisternes-epam/feat-antigravity-cli-target

Conversation

@sergio-sisternes-epam

Copy link
Copy Markdown
Collaborator

TL;DR

Adds antigravity as a first-class APM target, enabling apm install --target antigravity and auto-detection via .agent/ directory presence. Google's Antigravity CLI (agy) is the successor to Gemini CLI and uses a distinct workspace layout.

Closes #1650

Problem

Google has sunset Gemini CLI in favour of Antigravity CLI (agy). The new tool uses .agent/ as its project-scope config root (vs .gemini/), ~/.antigravity/ for user-scope config, and .agent/rules/*.md for instructions. Without a dedicated target, APM users must manually maintain Antigravity CLI configuration files.

Approach

Follow the established target-addition pattern:

  1. TargetProfile -- added "antigravity" to KNOWN_TARGETS with root_dir=".agent", compile_family="agents", deploy_root=".agents".
  2. Target detection -- registered in all 10+ locations in target_detection.py (TargetType, signal whitelist, canonical sets, descriptions, etc.).
  3. MCP adapter -- AntigravityClientAdapter extends GeminiClientAdapter (same mcpServers JSON schema in settings.json), overriding only the directory paths and target name.
  4. Integrators -- wired into hook, command, and MCP integrators. Commands use TOML (same as Gemini). Hooks merge into .agent/settings.json. Instructions deploy as rules.
  5. Documentation -- updated 10 doc pages and 3 apm-usage skill resource files.

Key design decisions

Decision Rationale
Target name antigravity (no aliases) Matches the canonical tool name; aliases can be added later
compile_family="agents" (emits AGENTS.md) Antigravity uses the cross-tool AGENTS.md context file
Inherits from GeminiClientAdapter Same mcpServers JSON schema, avoids code duplication
NOT flag-gated Gemini CLI sunset makes this GA-ready; no experimental gate needed
Instructions as rules (.agent/rules/) Antigravity's native rule format

Files changed

Source (13 files)

  • New: src/apm_cli/adapters/client/antigravity.py -- MCP client adapter
  • Modified: targets.py, target_detection.py, factory.py, hook_integrator.py, command_integrator.py, mcp_integrator.py, compile/cli.py, install.py, deps/cli.py, _helpers.py, errors.py, gemini.py (refactored to use self.target_name)

Tests (5 files)

  • Updated exhaustiveness tests: test_scope.py, test_data_driven_dispatch.py, test_kiro_target.py, test_targets_registry_completeness.py, test_no_policy_flag.py

Documentation (10 files)

  • Reference: targets-matrix.md, manifest-schema.md
  • Concepts: primitives-and-targets.md, what-is-apm.md
  • Integration: ide-tool-integration.md
  • Consumer: install-mcp-servers.md
  • Producer: compile.md
  • apm-usage skill: commands.md, package-authoring.md, workflow.md

Validation

  • All 17,145 unit tests pass
  • Lint (ruff check + format + pylint R0801 + auth-signals) clean
  • No code duplication -- refactored GeminiClientAdapter.configure_mcp_server to use self.target_name

Sergio Sisternes and others added 2 commits June 13, 2026 15:07
Register 'antigravity' target with full subsystem wiring:

- TargetProfile in KNOWN_TARGETS (root_dir=.agent/, compile_family=agents)
- Target detection: TargetType, signal whitelist, canonical sets, descriptions
- AntigravityClientAdapter for MCP (extends GeminiClientAdapter, same
  mcpServers JSON schema in .agent/settings.json)
- Factory registration in _MCP_CLIENT_REGISTRY
- Hook integrator: event map (BeforeTool/AfterTool/SessionEnd), merge config
- Command integrator: antigravity_command format_id (TOML, same as Gemini)
- MCP integrator: runtime detection (agy binary) and stale config cleanup
- CLI help text updated across compile, install, and deps commands
- Refactored GeminiClientAdapter.configure_mcp_server to use self.target_name
  for log/display strings, eliminating duplication with the new adapter

Closes #1650

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update all doc pages, reference tables, and apm-usage skill
resource files to include the antigravity target alongside
existing targets.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 13, 2026 14:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds antigravity (Google Antigravity CLI / agy) as a first-class APM target, wiring it into target resolution, MCP client config, hook/command integration, tests, and documentation so projects can apm install --target antigravity and auto-detect via .agent/.

Changes:

  • Added Antigravity target profile + detection signals, and registered it in CLI help/target sets.
  • Introduced AntigravityClientAdapter (Gemini-derived) and updated MCP runtime stale-cleanup + scripts-based runtime detection.
  • Updated unit tests and docs / apm-usage reference material to include Antigravity in target matrices and workflows.

Reviewed changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/unit/integration/test_targets_registry_completeness.py Adds Antigravity adapter to registry completeness assertions.
tests/unit/integration/test_kiro_target.py Updates expected help output target list to include antigravity.
tests/unit/integration/test_data_driven_dispatch.py Adds antigravity buckets to partition parity coverage.
tests/unit/install/test_no_policy_flag.py Updates install help assertions to include antigravity.
tests/unit/core/test_scope.py Adds antigravity to known-target scope assertions.
src/apm_cli/integration/targets.py Defines the Antigravity TargetProfile (root .agent/, skills in .agents/).
src/apm_cli/integration/mcp_integrator.py Cleans .agent/settings.json MCP entries; detects antigravity/agy in scripts.
src/apm_cli/integration/hook_integrator.py Wires Antigravity hook config merge + sidecar reinjection mapping.
src/apm_cli/integration/command_integrator.py Routes Antigravity commands through the Gemini TOML writer path.
src/apm_cli/factory.py Registers antigravity in the MCP client adapter factory registry.
src/apm_cli/core/target_detection.py Adds antigravity to canonical targets, signals, descriptions, and ordering.
src/apm_cli/core/errors.py Updates the “no harness detected” signal list text.
src/apm_cli/commands/install.py Extends CLI help text for --runtime / --target to include antigravity.
src/apm_cli/commands/deps/cli.py Extends deps clean help text to include antigravity.
src/apm_cli/commands/compile/cli.py Extends compile help text to include antigravity.
src/apm_cli/commands/_helpers.py Updates scaffolded apm.yml “Accepted values” comment to include antigravity.
src/apm_cli/adapters/client/gemini.py Refactors MCP configure messages to use self.target_name for reuse.
src/apm_cli/adapters/client/antigravity.py New MCP client adapter implementing Antigravity’s settings path layout.
packages/apm-guide/.apm/skills/apm-usage/workflow.md Updates workflow guidance to mention Antigravity in compile/bundle notes.
packages/apm-guide/.apm/skills/apm-usage/package-authoring.md Documents Antigravity-specific hooks file naming + target tokens + command deploy.
packages/apm-guide/.apm/skills/apm-usage/commands.md Updates apm install docs for runtime list, detection signals, and compile-only targets list.
docs/src/content/docs/reference/targets-matrix.md Adds antigravity to the targets capability matrix + per-target details.
docs/src/content/docs/reference/manifest-schema.md Adds antigravity to schema allowed values and target descriptions.
docs/src/content/docs/producer/compile.md Includes antigravity in compile guidance and per-target rules table.
docs/src/content/docs/integrations/ide-tool-integration.md Adds Antigravity to the IDE/tool integration overview.
docs/src/content/docs/consumer/install-mcp-servers.md Documents Antigravity MCP config paths for project/user scope.
docs/src/content/docs/concepts/what-is-apm.md Adds .agent/ to the list of harness directories APM deploys into.
docs/src/content/docs/concepts/primitives-and-targets.md Adds antigravity to target taxonomy + detection list.

Comment on lines 66 to +67
".codex/, .gemini/, GEMINI.md, "
".opencode/, .windsurf/"
".agent/, .opencode/, .windsurf/"
Comment on lines 713 to +714
"# Accepted values: copilot, claude, cursor, opencode, codex, gemini, "
"windsurf, all\n"
"antigravity, windsurf, kiro, all\n"
name="antigravity",
root_dir=".agent",
primitives={
"instructions": PrimitiveMapping("rules", ".md", "antigravity_rules"),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Google Antigravity CLI (agy) Support

2 participants