Antigravity auth, account management, quota inspection, runtime metadata extraction, and bridge support for OpenCode.
This is one of the best-maintained Antigravity plugins for OpenCode. The focus is simple: stay as close as possible to the real installed Antigravity app instead of hardcoding brittle request behavior.
Tip
Sponsor OpenAI account subscription upgrades @ discounted rates.
Gemini Ultra Accounts @ $20 each
Instant delivery: https://upgrades.astck.com/
Use code repodiscount for $5 off
Important
The Antigravity language server and headless bridge path is the most stable way to use Antigravity from OpenCode. If you want the behavior closest to the IDE, use the installed Antigravity app and let this plugin read its runtime metadata and language server binaries. Looser request-only paths drift faster, hit rate limits sooner, and are more likely to cause account-state problems or bans.
- Google OAuth login for Antigravity-compatible accounts
- Multi-account storage, rotation, quota inspection, and verification
- Runtime metadata extraction from the installed Antigravity app
- Bridge support for the Antigravity language server and headless flows
- Runtime model discovery with safe fallback catalogs
/ag-accountsTUI for account management inside OpenCode
- Windows is the primary supported path for the Antigravity bridge and local app discovery
- Node.js 20+
- Bun available if you want to run the local helper commands exactly as documented below
- An installed Antigravity app if you want runtime metadata extraction and the most stable bridge behavior
Default installed Antigravity app root on Windows:
C:\Users\<you>\AppData\Local\Programs\Antigravity\resources\app
For the stock GitHub/OpenCode release, the safest mental model is:
opencode.jsonloads the server plugintui.jsonloads the TUI plugin- bridge-backed models only work if the root server plugin is loaded correctly
If you only add the TUI side, /ag-accounts can appear while model requests still fail.
If the package is installed through OpenCode's plugin installer, OpenCode can detect both the server and TUI targets from this package and patch the right config files automatically.
git clone https://github.com/vibheksoni/opencode-antigravity-auth.git
cd opencode-antigravity-auth
npm install
npm run buildUse the active opencode.json or opencode.jsonc.
Common locations:
- project-local:
<workspace>\.opencode\opencode.json - custom config dir:
%OPENCODE_CONFIG_DIR%\opencode.json - default user config:
%USERPROFILE%\.config\opencode\opencode.json
Local development example:
{
"plugin": [
[
"C:\\absolute\\path\\to\\opencode-antigravity-auth",
{
"force_headless": true,
"cleanup_on_exit": true,
"debug": true
}
]
]
}Published plugin example:
{
"plugin": [
[
"opencode-antigravity-auth@latest",
{
"force_headless": true,
"cleanup_on_exit": true
}
]
]
}Recommended manual config for stock OpenCode:
opencode.json
{
"plugin": [
[
"C:\\absolute\\path\\to\\opencode-antigravity-auth",
{
"force_headless": true,
"cleanup_on_exit": true,
"debug": false
}
]
]
}Default tuple plugin behavior when these values are omitted:
force_headless: truecleanup_on_exit: truedebug: falsesingle_headless: falseapp_dir: auto-detect from the installed Antigravity app
Current OpenCode splits server plugins and TUI plugins.
That means the slash commands and account UI do not come from the main server plugin entry. They come from the separate TUI entry.
That means:
opencode-antigravity-authhandles the server/auth/runtime sideopencode-antigravity-auth/tuihandles slash commands and the account manager UI
If bun run account -- list works but /ag-accounts does not appear, the usual cause is that the TUI plugin was never added to tui.json, or the TUI config points at the package root instead of the explicit /tui entry.
Use the active tui.json.
Common locations:
- project-local:
<workspace>\.opencode\tui.json - custom config dir:
%OPENCODE_CONFIG_DIR%\tui.json - default user config:
%USERPROFILE%\.config\opencode\tui.json
Installed plugin example:
{
"plugin": [
"opencode-antigravity-auth/tui"
]
}Recommended manual config for stock OpenCode:
tui.json
{
"plugin": [
"C:\\absolute\\path\\to\\opencode-antigravity-auth/tui"
]
}Local path example for current OpenCode:
{
"plugin": [
"C:\\absolute\\path\\to\\opencode-antigravity-auth/tui"
]
}If your environment prefers backslashes in the path portion, this also works:
{
"plugin": [
"C:\\absolute\\path\\to\\opencode-antigravity-auth\\tui"
]
}Important:
- put the server plugin in
opencode.json - put the TUI plugin in
tui.json - for the TUI side, prefer the explicit
/tuientry instead of the package root - do not point
opencode.jsonat/tui - do not point
tui.jsonat the package root unless your local setup explicitly requires it
After adding the TUI entry, restart OpenCode and then use:
/ag-accounts/ag
This plugin also reads its own config file:
- project-local:
<workspace>\.opencode\antigravity.json - user-level:
%OPENCODE_CONFIG_DIR%\antigravity.jsonor%USERPROFILE%\.config\opencode\antigravity.json
Example:
{
"debug": true,
"debug_tui": false,
"keep_thinking": false,
"session_recovery": true,
"auto_resume": false,
"account_selection_strategy": "hybrid",
"scheduling_mode": "cache_first",
"quota_refresh_interval_minutes": 15
}opencode
opencode auth loginChoose:
- Provider:
google - Method:
OAuth with Google (Antigravity) - OAuth client:
StandardorGCP ToS
Inside OpenCode use:
/ag-accounts/ag
From there you can:
- add accounts
- verify accounts
- check quotas
- inspect per-account details
- write model definitions into
opencode.json - tune load balancer settings
For current OpenCode releases, the separate TUI entry is important:
- server plugin spec:
opencode-antigravity-auth - TUI plugin spec:
opencode-antigravity-auth/tui
For local path installs:
- server plugin path:
C:\path\to\opencode-antigravity-auth - TUI plugin path:
C:\path\to\opencode-antigravity-auth\tui
Without the TUI plugin entry:
- the standalone helper can still work
- auth/runtime behavior may still exist
- but
/ag-accountsand other TUI-side commands will not load
What this looks like in practice:
opencode.jsonloads the auth/provider/bridge logictui.jsonloads the slash commands, dialogs, and account manager
If you only configure the root package and skip the /tui entry, the plugin can look partially installed while the UI commands still never appear.
Bridge-backed models such as:
antigravity-server-bridge/antigravity-bridge-claude-sonnet-4.6-thinkingantigravity-server-bridge/antigravity-bridge-gemini-3-flash
depend on the root server plugin being loaded successfully.
If the root server plugin is missing or misconfigured, you can end up with a visible bridge provider but no runtime bridge URL, which leads to OpenCode errors like:
"undefined/chat/completions" cannot be parsed as a URL.
If you see that:
- verify the root plugin is present in
opencode.json - verify the TUI entry is separate in
tui.json - fully restart OpenCode after changing plugin config
If Antigravity is installed in the default Windows location, this is usually enough:
{
"plugin": [
[
"opencode-antigravity-auth@latest"
]
]
}If your Antigravity install lives elsewhere, add app_dir:
{
"plugin": [
[
"opencode-antigravity-auth@latest",
{
"app_dir": "C:\\Users\\<you>\\AppData\\Local\\Programs\\Antigravity\\resources\\app",
"force_headless": true,
"cleanup_on_exit": true,
"debug": true
}
]
]
}There are two separate config layers:
These live in opencode.json or opencode.jsonc and control plugin registration plus bridge-oriented runtime options.
Useful tuple options:
app_dirdebuglog_dirforce_headlesssingle_headlesscleanup_on_exitbridge.force_headlessbridge.single_headlessbridge.cleanup_on_exitbridge.debugbridge.log_dirbridge.app_dir
If you do not set them, the bridge defaults are:
force_headless: truecleanup_on_exit: truedebug: falsesingle_headless: false
This is the plugin's own runtime config file and controls behavior such as:
keep_thinkingsession_recoveryauto_resumeresume_textaccount_selection_strategyscheduling_modequota_refresh_interval_minutessoft_quota_threshold_percentcli_firstauto_update
Bridge mode uses the installed Antigravity app to discover:
- runtime version
- OAuth client IDs and secrets
- language server binaries
Windows language server binaries are expected under:
<app_dir>\extensions\antigravity\bin
If the standard app install exists, you usually do not need to configure anything else.
If you want the bridge to prefer a specific installed client or binary:
- set tuple option
app_dir - or set
OPENCODE_ANTIGRAVITY_APP_DIR - or set
CODEIUM_LANGUAGE_SERVER_BINto a specific language server binary
After building, you can use the standalone helper:
bun run account
bun run account -- add
bun run account -- add --no-browser
bun run account -- add --gcp-tos
bun run account -- list
bun run account -- clearThese are the environment variables the code actually reads today.
OPENCODE_ANTIGRAVITY_APP_DIROPENCODE_ANTIGRAVITY_CLIENT_IDOPENCODE_ANTIGRAVITY_CLIENT_SECRETOPENCODE_ANTIGRAVITY_GCP_TOS_CLIENT_IDOPENCODE_ANTIGRAVITY_GCP_TOS_CLIENT_SECRETOPENCODE_ANTIGRAVITY_GCP_TOSOPENCODE_ANTIGRAVITY_OAUTH_BINDOPENCODE_ANTIGRAVITY_DEBUGOPENCODE_ANTIGRAVITY_DEBUG_TUIOPENCODE_ANTIGRAVITY_CONSOLE_LOG
OPENCODE_ANTIGRAVITY_BRIDGE_FORCE_HEADLESSOPENCODE_ANTIGRAVITY_BRIDGE_DEBUGOPENCODE_ANTIGRAVITY_BRIDGE_DEBUG_HEADLESSOPENCODE_ANTIGRAVITY_BRIDGE_BASE_URLCODEIUM_LANGUAGE_SERVER_BIN
OPENCODE_CONFIG_DIROPENCODE_GLOBAL_DATA_DIR
OPENCODE_IMAGE_ASPECT_RATIO
Important nuance:
quiet_mode,toast_scope,log_dir,account_selection_strategy,scheduling_mode, and similar knobs are runtime config keys- some source comments still mention env overrides for those keys
- the list above is the set of env vars actually read directly by runtime code today
Debug files go under:
%OPENCODE_CONFIG_DIR%\antigravity-logswhenOPENCODE_CONFIG_DIRis set- otherwise
%USERPROFILE%\.config\opencode\antigravity-logs
The TUI config writer and /ag-accounts actions now also respect OPENCODE_CONFIG_DIR, so source-mode and wrapper launches update the same config root the runtime is using.
Useful markers in the debug logs:
tui-inittui-quota-opentui-quota-resultstoken-refresh-starttoken-refresh-successtoken-refresh-interop-fallbackquota-check-errorbridge-headless-startedbridge-account-selectedbridge-chat-success
/ag-accounts -> Configure models writes plugin model definitions into the active OpenCode config file.
That action now respects:
OPENCODE_CONFIG_DIR- existing
opencode.jsonc - existing
opencode.json
It will not silently write to the wrong config root when you are launching OpenCode from a custom wrapper or source checkout.
Build:
npm run buildRegenerate schema:
npm run build:schemaRun tests:
npm testRun targeted tests:
npm test -- --run src/plugin/token.test.ts src/plugin/quota.test.ts src/plugin/logger.test.ts src/plugin/debug.test.ts
npm test -- --run src/plugin/config/schema.test.ts src/plugin/config/updater.test.ts src/bridge/options.test.ts- The plugin tries to extract runtime metadata from the local app first, then falls back cleanly
- Model discovery can fail with live
403responses on some accounts, so static fallback models remain important - Quota inspection merges Antigravity buckets with Gemini CLI quota reporting
- The bridge keeps a headless fallback path because it matches the IDE more closely than direct request emulation
Credit to the original work at NoeFabris/opencode-antigravity-auth.
This repo has diverged significantly from that older implementation and continues to be maintained around the current Antigravity app behavior, Windows bridge support, runtime metadata extraction, quota tooling, and OpenCode integration.