opencode-antigravity-acp
Health Uyari
- License — License: MIT
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Low visibility — Only 8 GitHub stars
Code Basarisiz
- os.homedir — User home directory access in src/acp-client.ts
- process.env — Environment variable access in src/acp-client.ts
- exec() — Shell command execution in src/history-sanitizer.ts
- exec() — Shell command execution in src/mcp-relay.ts
- fs.rmSync — Destructive file system operation in test/plugin.test.ts
- network request — Outbound network request in test/plugin.test.ts
Permissions Gecti
- Permissions — No dangerous permissions requested
Bu listing icin henuz AI raporu yok.
Use your Antigravity subscription models in OpenCode via the official agy acp protocol, with Code Mode, MCP tools, skills, AGENTS.md, and cross-model context handoff.
opencode-antigravity-acp
Use your Antigravity subscription models inside OpenCode Desktop & CLI through Google's official local agy acp stdio protocol — v0.2.0 T3-Code-style swap-freely: seamless cross-model switching via plain-text-only handoff, Pure ACP by default, with an explicit opt-in single Code Mode MCP server.

Terms of Service & Compliance — Read First
This plugin drives only the official local agy acp --stdio --process-per-session Agent Client Protocol server installed by Google. It never extracts OAuth tokens, never spoofs IDE/API headers, and never replays private HTTP endpoints.
- Antigravity Terms: https://antigravity.google/terms
- Why third-party clients are restricted: https://antigravity.google/docs/faq#why-cant-i-use-third-party-software-such-as-claude-code-openclaw-or-opencode-with-my-antigravity-login
- ACP authentication docs: https://antigravity.google/docs/ide/extensions/acp#authentication
- Community ToS clarification: https://discuss.ai.google.dev/t/tos-clarification-is-opencode-antigravity-acp-official-agy-acp-in-opencode-permitted-under-the-antigravity-terms-of-service/202970/2
Auth boundary: oauth-personal vs GEMINI_API_KEY vs agent-platform
- Consumer default (
oauth-personal): thin personal Google sign-in via your localagyCLI. Afterinitialize, the plugin calls officialauthenticatewith{ methodId: "oauth-personal" }. Use this for normal personal Antigravity usage. GEMINI_API_KEY(gemini-api-key): ifGEMINI_API_KEYis set (orANTIGRAVITY_ACP_AUTH_METHOD=gemini-api-key), the plugin authenticates with{ methodId: "gemini-api-key" }using the Developer API key path documented for ACP. Benign already-authenticated responses are ignored so cached/env auth keeps working.agent-platform: setANTIGRAVITY_ACP_AUTH_METHOD=agent-platform(withGOOGLE_CLOUD_PROJECT/GOOGLE_CLOUD_LOCATION+ Application Default Credentials) for Gemini Enterprise Agent Platform usage.- You can force a method explicitly with
ANTIGRAVITY_ACP_AUTH_METHOD=oauth-personal|oauth-business|gemini-api-key|agent-platform.
You are responsible for complying with the Antigravity Terms of Service, quota limits, and any Google policy changes. Every request runs against your real Antigravity account and shares your quota.
Why ACP instead of OAuth / API-proxy plugins?
Plugins like OAuth token extractors or local reverse proxies pull credentials out of local storage and replay private Cloud Code / Antigravity HTTP endpoints with spoofed headers. Combined with automated retry loops on 429 responses, that pattern routinely triggers abuse bans.
This plugin follows the same official-harness architecture used by tools like T3 Code and Zed ACP:
| Aspect | OAuth / Proxy Plugins | opencode-antigravity-acp (Strict Thin ACP) |
|---|---|---|
| Auth & headers | Extracts OAuth tokens; spoofs IDE/API headers | None — spawns your local signed-in agy acp binary directly + official authenticate |
| Protocol | Unofficial private HTTP API emulation | Official stdio JSON-RPC Agent Client Protocol (agy acp --stdio --process-per-session) |
| Prompt injection | Raw outer-harness system prompts / tool schemas leak upstream | Zero — input.system = [], input.tools = {}, no <workspace_tools_bridge> / <workspace_context> |
| History replay | Replays foreign model turns verbatim (incl. tool calls) | Never replays tool/reasoning state — cross-model switches send a plain-text-only handoff ([Historical user/assistant], 16k cap) + latest prompt |
| 429 / Quota error handling | Often retries repeatedly in tight loops | Fail-fast circuit breaker halts on attempt #1 and trips a 60s persisted cooldown |
Features
- Seamless cross-model switching (v0.2.0, T3-Code-style
create_with_handoff): switch freely between Antigravity ACP and normal OpenCode models in the same session — no lock-outs, no lost context. Normal ACP-to-ACP flow sends ONLY the raw latest human prompt + image attachments viabuildThinAcpPromptBlocks. Switching back after normal-model turns starts a freshagy acpsession (session/new) and restores the earlier conversation via a plain-text-only handoff (buildTextOnlyHandoffPromptBlocks: ONLY[Historical user]/[Historical assistant]text, 16k cap, dropping all reasoning, tool calls, tool results, schemas, todos, approvals) followed by the latest prompt. No tool/reasoning replay, ever. Toggling ACP modes reconnects automatically with the same seamless restore. - Pure ACP by default + optional single Code Mode MCP:
mcpServers: [](zero bridged MCPs, 100% nativeagy acp) unless you opt in via the ACP popover (Pure ACPvs+ Code Mode). Opt-in attaches only the singleocCode Mode MCP server with zero prompt injection. - Explicit ACP
authenticate()+ oauth env scrub: afterinitialize, the bridge calls officialauthenticate(oauth-personalby default,gemini-api-keywhenGEMINI_API_KEYis set, orANTIGRAVITY_ACP_AUTH_METHODoverride), ignoring benign already-authenticated errors. When spawningagy acpforoauth-personal, ambientGEMINI_API_KEY/GOOGLE_API_KEY/GOOGLE_APPLICATION_CREDENTIALSare scrubbed so stray keys never collide with the personal login (kept forgemini-api-key/agent-platform). - Dynamic Live Model & Reasoning Effort Discovery: Queries
agy acp(session/newconfigOptions+models.availableModels), caches the catalog in OpenCode plugin storage (6h TTL, deduplicated across open workspaces), and exposes all models with their individual reasoning efforts (low,medium,high,xhighwhere supported) without family-collapsing in OpenCode Desktop. - Zero Impact on Normal OpenCode Usage:
McpRelayServer(only used for opt-in Code Mode) andagy acpprocesses start lazily only when anantigravity-acp/*model is invoked. Normal OpenCode providers keep full Code Mode and prompt/response paths untouched. - Native OpenCode Desktop Controls & Slash Commands: Compact
ACPcomposer popover for switching Approval Modes (Auto,Accept edits,Ask,Plan), ACP modes (Pure ACPvs+ Code Mode), or refreshing models (/agy-reload)./agy-resetstays available as a background slash command. Selecting an Antigravity model pre-warmsagy acpin the background, so the status pill movesStandby→Starting...→Connectedbefore you even send the first message.
Safety Guardrails & Honest Risks
Built-in Guardrails
- Zero token extraction / zero spoofing: Never reads Antigravity auth databases or modifies official
agyheaders or binaries. - Zero outer-harness injection: Outer
systeminstructions and tool schemas are cleared (input.system = [],input.tools = {}) for ACP models. NoappendSystemPromptis ever passed tosession/new/session/resume. Only the raw latest human prompt + attachments (or a plain-text-only handoff + latest prompt on model switch) leave OpenCode. - No tool/reasoning replay: Cross-model switches carry over ONLY plain-text
[Historical user]/[Historical assistant]turns (16k cap). Reasoning, tool calls/results, schemas, todos, and approvals are dropped — Antigravity always owns a clean native session after a switch. - Fail-fast attempt-1 circuit breaker: Detects upstream API/quota errors (
RESOURCE_EXHAUSTED,code 429,code 403,PERMISSION_DENIED,API error (attempt N)), cancels/killsagy acpimmediately, trips a persisted 60-second cooldown, and suppresses automatic replay after server restarts. - Clean plugin disable / reload: Disposing mid-turn terminates the AI SDK stream cleanly without emitting retryable error chunks so OpenCode doesn't enter retry loops.
Honest Risks to Know
- Not zero-risk: Every request runs against your real Antigravity account and shares your Antigravity usage quota. Upstream terms of service, rate limits, or
agy acpflags can change at Google's discretion. - Local CLI requirement: Requires
agyinstalled and authenticated on your machine. - GUI surface stability: The Desktop popover uses OpenCode v2's
gui-experimentalAPI (@opencode/plugin/gui), which is marked experimental by OpenCode and may evolve in future OpenCode releases.
Prerequisites
- OpenCode
>= 2.3.2 - Antigravity CLI (
agy) installed and signed in (agy --versionshould work)- If OpenCode Desktop launches from a GUI menu without
~/.local/binor/opt/homebrew/bininPATH, the plugin automatically probes common install paths and also supports settingAGY_BIN=/path/to/agy.
- If OpenCode Desktop launches from a GUI menu without
Installation
Option 1: Install via OpenCode CLI (Recommended)
opencode plugin add opencode-antigravity-acp
opencode service restart
(You can also install directly from GitHub via opencode plugin add github:system1970/opencode-antigravity-acp.)
Option 2: Clone into OpenCode's Auto-Discovered Plugin Folder
OpenCode v2 automatically discovers local plugins placed under ~/.config/opencode/plugins/ (no build step required — the compiled dist/gui-experimental.cjs bundle is included):
git clone https://github.com/system1970/opencode-antigravity-acp ~/.config/opencode/plugins/opencode-antigravity-acp
opencode service restart
After restarting the OpenCode service, press Ctrl+R in OpenCode Desktop (if already open) and select any model under Antigravity (ACP) in the model picker.
Controls & Slash Commands
When an Antigravity (ACP) model is active, an ACP pill appears above the composer:
- Approval mode:
Auto— Approves edits and shell commands automatically.Accept edits— Approves file edits; prompts before shell commands.Ask— Prompts before file edits and shell commands.Plan— Creates a plan before executing changes.
- Tool bridge:
Pure ACP(default) —mcpServers: [], zero bridged MCPs, 100% nativeagy acp.+ Code Mode— Attaches only the singleocCode Mode MCP server (reconnects automatically with conversation preserved, zero prompt injection).
- Actions & Slash commands:
/agy-reset— Disposes and resets the active Antigravity ACP session for the current session (background command)./agy-reload— Forces live model & reasoning-effort discovery fromagy acpand reloads providers.
Development
bun install
bun run typecheck
bun test
bun run build
Contributing & Security
- See CONTRIBUTING.md for development workflow and safety invariants.
- See SECURITY.md for the security model and reporting guidelines.
License
MIT © system1970
Yorumlar (0)
Yorum birakmak icin giris yap.
Yorum birakSonuc bulunamadi