Your agent gets a gemini tool. It hands a whole task to Gemini in Google's own Antigravity CLI (agy), on the Google AI plan you already pay for, and gets back a report: Gemini's answer, typed data when it passes a schema, the files that changed and anything Gemini was blocked from. Gemini sees the brief your agent writes and nothing from your chat, so it works like a colleague who just walked in. Type /gemini <task> to hand one over yourself.
You need OpenCode 2.4.3 or newer and the Antigravity CLI. Run agy once to sign in, then add the plugin to ~/.config/opencode/opencode.json:
{ "plugins": ["@carson2222/opencode-antigravity"] }Runs use your plan's quota. If you turned on AI credits in Antigravity, a run past your quota can spend them.
On Google AI Ultra, OpenCode is adding its own Google sign-in (anomalyco/opencode#67447, behind the google_ai_plan flag for now), which makes Gemini a regular OpenCode model. This plugin works on any plan, Pro included, and runs Antigravity's own agent with its own tools.
{
"plugins": [
{
"package": "@carson2222/opencode-antigravity",
"options": { "model": "gemini-4-carbon", "effort": "medium" }
}
]
}| Option | Default | Values |
|---|---|---|
model |
gemini-4-neon |
A Gemini model from agy models. |
effort |
high |
low, medium, high, xhigh or max. |
allowOtherModels |
false |
Also offer the non-Gemini models on your plan, like Claude. |
Your agent can pick another model and effort per call. Higher effort thinks longer and uses more quota. The plugin reads agy models at startup, which costs no quota, so new Google models show up without an update.
Runs take minutes. Called directly, gemini shows live progress. In Code Mode, your agent can fan out several runs at once, but the host shows only the nested call rows. With experimental.full_codemode, a call that outlasts Code Mode's timeout moves to the background and wakes your agent when the report arrives.
- By default, Gemini only reads. Each run passes its own settings that deny shell commands, file writes and MCP tools.
- Gemini reads the project, plus any absolute directories your agent passes as
folders, such as screenshots or a diff kept outside the project. A folder outside the project needs OpenCode's external directory permission.foldersworks only in read-only runs, since sandboxed commands can write to every folder Gemini can see. - Gemini's file reads skip secret files, even gitignored ones:
.envand.env.*(not.example,.sampleor.template), keys and certificates (.pem,.key,.p8,.p12,.pfx,.keystore,.jks,id_rsa*,id_ed25519*),.npmrc,.netrc,credentials*.json,service-account*.jsonand.tfvars. Antigravity's deny rules match exact paths only, so before each run the plugin lists these files in the whole repo and infolders, nested repos, worktrees and build output included (notnode_modules,.git,PodsorDerivedData), and denies each one, plus the target of any that is a symlink. A path through..or a symlink with another name resolves to the denied file and is refused, and read-only runs can't search file contents because search runs as a denied command. A run fails instead of starting unchecked when there are over 100,000 folders to scan or one can't be listed. Files created during the run, files reached through a symlinked folder, an ordinary-named symlink to a secret outside the project andfolders, and on a case-insensitive disk the same file asked for in different case (.ENV) aren't covered, and in a write run with commands, the plugin hasn't verified that Antigravity's sandbox applies these denies to commands. write: trueneeds OpenCode's edit permission, and lets Gemini write only inside the project. Commands also need your shell permission and run in Antigravity's terminal sandbox. MCP tools stay denied.- Your own Antigravity permissions still apply on top. Their deny rules win, and an allowed
command(...)there can run outside the sandbox. Your OpenCode per-file and per-command rules don't reach inside Gemini. - At most two runs go at once, and one write run per repo. Stop ends
agyand everything left in its process group.
The report's access says what Gemini was allowed to do, and denied lists what it was blocked from.
Important
On consumer Google AI plans, Google may use your Antigravity conversations to improve its products, and human reviewers may read them. Opt out in Antigravity Settings before you send Gemini work code.
Google's Terms of Service (section 6) and FAQ allow running the unmodified Antigravity CLI headless from another harness. The plugin runs your installed agy with documented flags, never reads ~/.gemini or your login, returns a report instead of a model completion, and never retries or switches models when your quota runs out.
bun install
bun test
bunx tsc --noEmit
bun run buildTo try a change, run bun run build and point a plugins entry at your checkout's absolute path. Releases publish to npm when a version bump lands on main.
MIT
