OpenCode auth plugin for Google Antigravity: account manager, auto-refresh, wire-protocol transform. /agy use|list|status.
  • JavaScript 100%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-17 14:04:30 +02:00
lib feat(search): fall back from gemini-2.5-flash to gemini-3-flash on 429 2026-09-17 14:04:30 +02:00
vendor refactor: convert typescript pipeline to plain js 2026-09-17 13:47:47 +02:00
.gitignore refactor: convert typescript pipeline to plain js 2026-09-17 13:47:47 +02:00
index.js fix(status): show quota as used percent instead of remaining 2026-09-17 13:57:26 +02:00
package.json refactor: convert typescript pipeline to plain js 2026-09-17 13:47:47 +02:00
README.md refactor: convert typescript pipeline to plain js 2026-09-17 13:47:47 +02:00

duh-agy-auth

Native Antigravity (Google Cloud Code Assist) OAuth provider plugin for OpenCode. Serves both Gemini and Claude model families through a single Google account, and includes a google_search tool for real-time web search and URL analysis.

Install

git clone <repo-url>

opencode.jsonc:

{ "plugin": ["file:<clone-dir>/duh-agy-auth"] }

Restart opencode. No install, no build, zero dependencies. Models are declared in your opencode.jsonc provider.google block.

Auth

opencode auth login opens an account-first manager: pick an account to act on it (switch / deactivate / reactivate / remove), or Add account to browser-login — with an "Add another account? (y/n)" loop for bulk import.

opencode auth logout is native.

Accounts store

~/.config/opencode/duh-agy-accounts.json — plugin-private store. The active account is mirrored into auth.json, which remains the session source of truth.

Commands

Command Effect
/agy or /agy list list accounts, active marker, token TTL
/agy use accN|email switch active account (refreshes first)
/agy status [acc] active account email, project id, token TTL

google_search is on by default; opt out with ["file:<clone-dir>/duh-agy-auth", { "google_search": false }].

Env

  • OPENCODE_CONFIG_DIR (account store location, default ~/.config/opencode)
  • XDG_DATA_HOME (auth mirror location, default ~/.local/share)