feat: add Google Antigravity CLI (agy) as first-class APM target#1770
Open
sergio-sisternes-epam wants to merge 2 commits into
Open
feat: add Google Antigravity CLI (agy) as first-class APM target#1770sergio-sisternes-epam wants to merge 2 commits into
sergio-sisternes-epam wants to merge 2 commits into
Conversation
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>
Contributor
There was a problem hiding this comment.
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"), |
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.
TL;DR
Adds
antigravityas a first-class APM target, enablingapm install --target antigravityand 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/*.mdfor instructions. Without a dedicated target, APM users must manually maintain Antigravity CLI configuration files.Approach
Follow the established target-addition pattern:
"antigravity"toKNOWN_TARGETSwithroot_dir=".agent",compile_family="agents",deploy_root=".agents".target_detection.py(TargetType, signal whitelist, canonical sets, descriptions, etc.).AntigravityClientAdapterextendsGeminiClientAdapter(samemcpServersJSON schema insettings.json), overriding only the directory paths and target name..agent/settings.json. Instructions deploy as rules.Key design decisions
antigravity(no aliases)compile_family="agents"(emits AGENTS.md)mcpServersJSON schema, avoids code duplication.agent/rules/)Files changed
Source (13 files)
src/apm_cli/adapters/client/antigravity.py-- MCP client adaptertargets.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 useself.target_name)Tests (5 files)
test_scope.py,test_data_driven_dispatch.py,test_kiro_target.py,test_targets_registry_completeness.py,test_no_policy_flag.pyDocumentation (10 files)
targets-matrix.md,manifest-schema.mdprimitives-and-targets.md,what-is-apm.mdide-tool-integration.mdinstall-mcp-servers.mdcompile.mdcommands.md,package-authoring.md,workflow.mdValidation
GeminiClientAdapter.configure_mcp_serverto useself.target_name