# OpenCode + opencode-antigravity-auth setup (Pro/Opus primary, Flash/Sonnet budget subagents; no effort pins)

> Source: <https://gist.github.com/saadev0/0e3f43d24c3f05903f9c4bd732e961d0>
> Published: 2026-07-13 14:40:01+00:00

Portable setup for **OpenCode** with ** opencode-antigravity-auth** (Google OAuth → Antigravity quota for Gemini + Claude).

Notthe Antigravity IDE. This is OpenCode’s Google/Gemini auth path only.

**Gist:** [https://gist.github.com/saadev0/0e3f43d24c3f05903f9c4bd732e961d0](https://gist.github.com/saadev0/0e3f43d24c3f05903f9c4bd732e961d0)

| Role | Model id | Notes |
|---|---|---|
Primary (default / `build` ) |
`google/antigravity-gemini-3.1-pro` |
Main coding |
Primary (`plan` ) |
`google/antigravity-claude-opus-4-6-thinking` |
Planning / deep work |
Budget subagent (`explore` , titles, summary, compaction, `small_model` ) |
`google/antigravity-gemini-3.5-flash` |
Search / light utility |
Budget subagent (`general` ) |
`google/antigravity-claude-sonnet-4-6` |
Tool-call / general subagent |

**Effort/variants are not pinned.** Variants (`low`

/ `high`

/ `max`

/ …) stay available so you or the agent can choose per task. Subagents use **budget model families**, not primary Pro/Opus.

| File | Install path |
|---|---|
`opencode.jsonc` |
`~/.config/opencode/opencode.jsonc` |
`antigravity.json` |
`~/.config/opencode/antigravity.json` |
`package.json` |
`~/.config/opencode/package.json` (optional deps pin) |
`README.md` |
this doc |

Do **not** copy OAuth secrets or `antigravity-accounts.json`

into a public gist.

```
# 1) Install OpenCode (if needed) — https://opencode.ai/docs

# 2) Config dir
mkdir -p ~/.config/opencode
cd ~/.config/opencode

# 3) Pull this gist
BASE="https://gist.githubusercontent.com/saadev0/0e3f43d24c3f05903f9c4bd732e961d0/raw"
curl -fsSL "$BASE/opencode.jsonc" -o opencode.jsonc
curl -fsSL "$BASE/antigravity.json" -o antigravity.json
curl -fsSL "$BASE/package.json" -o package.json

# 4) Install plugin dependency
npm install

# 5) Google OAuth login (Antigravity accounts)
opencode auth login
# Select Google / Antigravity provider, complete browser OAuth.
# Re-run to add more accounts for rotation.

# 6) Verify models
opencode models | grep antigravity
# Expect:
#   google/antigravity-gemini-3.1-pro
#   google/antigravity-claude-opus-4-6-thinking
#   google/antigravity-gemini-3.5-flash
#   google/antigravity-claude-sonnet-4-6

# 7) Smoke test
opencode run "Hello" --model=google/antigravity-gemini-3.1-pro
opencode run "Hello" --model=google/antigravity-claude-opus-4-6-thinking
opencode run "Hello" --model=google/antigravity-gemini-3.5-flash
BASE="https://gist.githubusercontent.com/saadev0/0e3f43d24c3f05903f9c4bd732e961d0/raw"
mkdir -p ~/.config/opencode && cd ~/.config/opencode
curl -fsSL "$BASE/opencode.jsonc" -o opencode.jsonc
curl -fsSL "$BASE/antigravity.json" -o antigravity.json
curl -fsSL "$BASE/package.json" -o package.json
npm install
```

- Loads plugin:
`opencode-antigravity-auth@latest`

- Whitelists only the four Antigravity models above
- Declares model limits, modalities, and
**optional** variants (not forced) - Agent model
**family** map:- primary → Pro / Opus
- subagent / utility → Flash / Sonnet

- No
`variant: "high"`

/`variant: "low"`

on agents

| Key | Value | Why |
|---|---|---|
`account_selection_strategy` |
`hybrid` |
Good multi-account default |
`auto_update` |
`false` |
Avoid silent plugin overwrites of local patches |
`debug` |
`true` |
Logs under `~/.config/opencode/antigravity-logs/` |
`quota_fallback` |
`false` |
No silent Gemini CLI / alternate routing |
`cli_first` |
`false` |
Prefer Antigravity quota first |

Optional later:

```
{
  "pid_offset_enabled": true   // parallel subagents across accounts
}
```

- Credentials:
`~/.config/opencode/antigravity-accounts.json`

(local only, never gist) - Add accounts:
`opencode auth login`

again - Reset auth: delete
`antigravity-accounts.json`

, re-login - ToS risk: unofficial Google OAuth path — use an established account; see upstream README

Upstream plugin: [opencode-antigravity-auth](https://github.com/NoeFabris/opencode-antigravity-auth)

`opencode.jsonc`

alone is enough for model **registration** (whitelist + agent map).

These **optional** patches live under:

`~/.config/opencode/node_modules/opencode-antigravity-auth/`

They are **wiped on npm reinstall/update** (hence `auto_update: false`

).

| Change | Purpose |
|---|---|
Register `antigravity-gemini-3.5-flash` in plugin `models.js` |
Official plugin list may lag 3.5 Flash |
Aliases `gemini-3.5-flash-{minimal,low,medium,high}` in `model-resolver.js` |
Tier suffixes resolve cleanly |
`SEARCH_MODEL = "gemini-3.5-flash"` in `constants.js` |
Search tool uses budget Flash |
No silent default `-low` / `-high` on bare models |
Effort only when you pick a variant |
Opus variant `high` (= max budget 32768) |
Friendly label alongside `max` |

After `npm install`

, re-apply patches if you rely on them, or keep a local fork.

```
# Only when you want an explicit effort tier
opencode run "..." --model=google/antigravity-gemini-3.1-pro --variant=high
opencode run "..." --model=google/antigravity-claude-opus-4-6-thinking --variant=high
opencode run "..." --model=google/antigravity-gemini-3.5-flash --variant=medium
```

Without `--variant`

, the plugin does not invent low/high for you.

| Symptom | Fix |
|---|---|
| Model missing from list | Ensure `opencode.jsonc` whitelist + models block; restart OpenCode |
| 403 / project denied | Set `projectId` on each account in `antigravity-accounts.json` ; enable Cloud Code Assist API |
| OAuth callback fails (Safari) | Use Chrome/Firefox or disable Safari HTTPS-Only for localhost |
| Rate limited | Add more Google accounts; wait; check quotas via auth menu |
| Plugin update wiped 3.5 Flash | Re-install configs from this gist; re-apply local patches; keep `auto_update: false` |

**Source of truth for a new machine:** this gist**Live machine config:**`~/.config/opencode/opencode.jsonc`

+`antigravity.json`

- After changing live config, push updates back into this gist (same files)

Maintained for [saadev0](https://gist.github.com/saadev0) · OpenCode Google auth via Antigravity OAuth
