JSPM

  • Created
  • Published
  • Downloads 6963
  • Score
    100M100P100Q138843F
  • License MIT

Google Antigravity IDE OAuth auth plugin for Opencode - access Gemini 3 Pro and Claude 4.5 using Google credentials

Package Exports

  • opencode-antigravity-auth
  • opencode-antigravity-auth/dist/index.js
  • opencode-antigravity-auth/dist/src/constants
  • opencode-antigravity-auth/dist/src/constants.js
  • opencode-antigravity-auth/dist/src/plugin/request.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (opencode-antigravity-auth) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Antigravity + Gemini CLI OAuth Plugin for Opencode

npm version npm beta npm downloads License: MIT X (Twitter)

Enable Opencode to authenticate against Antigravity (Google's IDE) via OAuth so you can use Antigravity rate limits and access models like gemini-3-pro and claude-opus-4-5-thinking with your Google credentials.

What You Get

  • Claude Opus 4.5, Sonnet 4.5 and Gemini 3 Pro/Flash via Google OAuth
  • Multi-account support — add multiple Google accounts, auto-rotates when rate-limited
  • Dual quota system — access both Antigravity and Gemini CLI quotas from one plugin
  • Thinking models — extended thinking for Claude and Gemini 3 with configurable budgets
  • Google Search grounding — enable web search for Gemini models (auto or always-on)
  • Auto-recovery — handles session errors and tool failures automatically
  • Plugin compatible — works alongside other OpenCode plugins (oh-my-opencode, dcp, etc.)

Installation

For Humans

Option A: Let an LLM do it

Paste this into any LLM agent (Claude Code, OpenCode, Cursor, etc.):

Install the opencode-antigravity-auth plugin and add the Antigravity model definitions to ~/.config/opencode/opencode.json by following: https://raw.githubusercontent.com/NoeFabris/opencode-antigravity-auth/dev/README.md

Option B: Manual setup

  1. Add the plugin to ~/.config/opencode/opencode.json:

    {
      "plugin": ["opencode-antigravity-auth@latest"]
    }

    Want bleeding edge features? Use opencode-antigravity-auth@beta instead.

  2. Login with your Google account:

    opencode auth login
  3. Add models — copy the full configuration below

  4. Use it:

    opencode run "Hello" --model=google/antigravity-claude-sonnet-4-5-thinking --variant=max
For LLM Agents

Step-by-Step Instructions

  1. Edit the OpenCode configuration file:

    • Linux/Mac: ~/.config/opencode/opencode.json
    • Windows: %APPDATA%\opencode\opencode.json
  2. Add the plugin to the plugins array:

    {
      "plugin": ["opencode-antigravity-auth@latest"]
    }
  3. Add the model definitions from the Full models configuration section

  4. Set provider to "google" and choose a model

Verification

opencode run "Hello" --model=google/antigravity-claude-sonnet-4-5-thinking --variant=max

Models

Model Reference

Antigravity quota (Claude + Gemini 3):

Model Variants Notes
antigravity-gemini-3-pro low, high Gemini 3 Pro with thinking
antigravity-gemini-3-flash minimal, low, medium, high Gemini 3 Flash with thinking
antigravity-claude-sonnet-4-5 Claude Sonnet 4.5
antigravity-claude-sonnet-4-5-thinking low, max Claude Sonnet with extended thinking
antigravity-claude-opus-4-5-thinking low, max Claude Opus with extended thinking

Gemini CLI quota (separate from Antigravity):

Model Notes
gemini-2.5-flash Gemini 2.5 Flash
gemini-2.5-pro Gemini 2.5 Pro
gemini-3-flash-preview Gemini 3 Flash (preview)
gemini-3-pro-preview Gemini 3 Pro (preview)

Using variants:

opencode run "Hello" --model=google/antigravity-claude-sonnet-4-5-thinking --variant=max

For details on variant configuration and thinking levels, see docs/MODEL-VARIANTS.md.

Full models configuration (copy-paste ready)

Add this to your ~/.config/opencode/opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["opencode-antigravity-auth@latest"],
  "provider": {
    "google": {
      "models": {
        "antigravity-gemini-3-pro": {
          "name": "Gemini 3 Pro (Antigravity)",
          "limit": { "context": 1048576, "output": 65535 },
          "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
          "variants": {
            "low": { "thinkingLevel": "low" },
            "high": { "thinkingLevel": "high" }
          }
        },
        "antigravity-gemini-3-flash": {
          "name": "Gemini 3 Flash (Antigravity)",
          "limit": { "context": 1048576, "output": 65536 },
          "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
          "variants": {
            "minimal": { "thinkingLevel": "minimal" },
            "low": { "thinkingLevel": "low" },
            "medium": { "thinkingLevel": "medium" },
            "high": { "thinkingLevel": "high" }
          }
        },
        "antigravity-claude-sonnet-4-5": {
          "name": "Claude Sonnet 4.5 (Antigravity)",
          "limit": { "context": 200000, "output": 64000 },
          "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
        },
        "antigravity-claude-sonnet-4-5-thinking": {
          "name": "Claude Sonnet 4.5 Thinking (Antigravity)",
          "limit": { "context": 200000, "output": 64000 },
          "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
          "variants": {
            "low": { "thinkingConfig": { "thinkingBudget": 8192 } },
            "max": { "thinkingConfig": { "thinkingBudget": 32768 } }
          }
        },
        "antigravity-claude-opus-4-5-thinking": {
          "name": "Claude Opus 4.5 Thinking (Antigravity)",
          "limit": { "context": 200000, "output": 64000 },
          "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
          "variants": {
            "low": { "thinkingConfig": { "thinkingBudget": 8192 } },
            "max": { "thinkingConfig": { "thinkingBudget": 32768 } }
          }
        },
        "gemini-2.5-flash": {
          "name": "Gemini 2.5 Flash (Gemini CLI)",
          "limit": { "context": 1048576, "output": 65536 },
          "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
        },
        "gemini-2.5-pro": {
          "name": "Gemini 2.5 Pro (Gemini CLI)",
          "limit": { "context": 1048576, "output": 65536 },
          "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
        },
        "gemini-3-flash-preview": {
          "name": "Gemini 3 Flash Preview (Gemini CLI)",
          "limit": { "context": 1048576, "output": 65536 },
          "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
        },
        "gemini-3-pro-preview": {
          "name": "Gemini 3 Pro Preview (Gemini CLI)",
          "limit": { "context": 1048576, "output": 65535 },
          "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
        }
      }
    }
  }
}

Multi-Account Setup

Add multiple Google accounts for higher combined quotas. The plugin automatically rotates between accounts when one is rate-limited.

opencode auth login  # Run again to add more accounts

For details on load balancing, dual quota pools, and account storage, see docs/MULTI-ACCOUNT.md.


Plugin Compatibility

@tarquinen/opencode-dcp

DCP creates synthetic assistant messages that lack thinking blocks. List this plugin BEFORE DCP:

{
  "plugin": [
    "opencode-antigravity-auth@latest",
    "@tarquinen/opencode-dcp@latest"
  ]
}

oh-my-opencode

Disable built-in auth and override agent models in oh-my-opencode.json:

{
  "google_auth": false,
  "agents": {
    "frontend-ui-ux-engineer": { "model": "google/antigravity-gemini-3-pro" },
    "document-writer": { "model": "google/antigravity-gemini-3-flash" },
    "multimodal-looker": { "model": "google/antigravity-gemini-3-flash" }
  }
}

Tip: When spawning parallel subagents, enable pid_offset_enabled: true in antigravity.json to distribute sessions across accounts.

Plugins you don't need

  • gemini-auth plugins — Not needed. This plugin handles all Google OAuth.

Configuration

Create ~/.config/opencode/antigravity.json for advanced settings:

{
  "$schema": "https://raw.githubusercontent.com/NoeFabris/opencode-antigravity-auth/main/assets/antigravity.schema.json",
  "quiet_mode": false,
  "debug": false
}
Option Default What it does
quiet_mode false Hide toast notifications
debug false Enable debug logging
session_recovery true Auto-recover from tool errors
auto_resume true Auto-send "continue" after recovery
web_search.default_mode "off" Google Search grounding: "auto" or "off"

For all options, see docs/CONFIGURATION.md.

Environment variables:

OPENCODE_ANTIGRAVITY_DEBUG=1 opencode   # Enable debug logging
OPENCODE_ANTIGRAVITY_DEBUG=2 opencode   # Verbose logging

Troubleshooting

See the full Troubleshooting Guide for solutions to common issues including:

  • Auth problems and token refresh
  • "Model not found" errors
  • Session recovery
  • Gemini CLI permission errors
  • Safari OAuth issues
  • Plugin compatibility
  • Migration guides

Documentation


Support

If this plugin helps you, consider supporting its maintenance:

ko-fi


Credits

License

MIT License. See LICENSE for details.

Legal

Intended Use

  • Personal / internal development only
  • Respect internal quotas and data handling policies
  • Not for production services or bypassing intended limits

Warning

By using this plugin, you acknowledge:

  • Terms of Service risk — This approach may violate ToS of AI model providers
  • Account risk — Providers may suspend or ban accounts
  • No guarantees — APIs may change without notice
  • Assumption of risk — You assume all legal, financial, and technical risks

Disclaimer

  • Not affiliated with Google. This is an independent open-source project.
  • "Antigravity", "Gemini", "Google Cloud", and "Google" are trademarks of Google LLC.