npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@shaywong/opencode-antigravity-auth

v1.3.2-beta.2

Published

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

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.

Fork notice: This project is based on https://github.com/NoeFabris/opencode-antigravity-auth and modified by @shaywong. License: MIT (see LICENSE).

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.)

[!CAUTION] Using this plugin may violate Google's Terms of Service. A small number of users have reported their Google accounts being banned or shadow-banned (restricted access without explicit notification).

High-risk scenarios:

  • 🚨 Fresh Google accounts have a very high chance of getting banned
  • 🚨 New accounts with Pro/Ultra subscriptions are frequently flagged and banned

By using this plugin, you acknowledge:

  • This is an unofficial tool not endorsed by Google
  • Your account may be suspended or permanently banned
  • You assume all risks associated with using this plugin

Recommendation: Use an established Google account that you don't rely on for critical services. Avoid creating new accounts specifically for this plugin.


Installation

Option A: Let an LLM do it

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

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

Option B: Manual setup

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

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

    Want bleeding-edge features? Use @shaywong/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=antigravity/antigravity-claude-sonnet-4-5-thinking --variant=max

Step-by-Step Instructions

  1. Edit the OpenCode configuration file at ~/.config/opencode/opencode.json

    Note: This path works on all platforms. On Windows, ~ resolves to your user home directory (e.g., C:\Users\YourName).

  2. Add the plugin to the plugin array

  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=antigravity/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=antigravity/antigravity-claude-sonnet-4-5-thinking --variant=max

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

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

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["@shaywong/opencode-antigravity-auth@latest"],
  "provider": {
    "antigravity": {
      "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.


Troubleshoot

Quick Reset: Most issues can be resolved by deleting ~/.config/opencode/antigravity-accounts.json and running opencode auth login again.

Configuration Path (All Platforms)

OpenCode uses ~/.config/opencode/ on all platforms including Windows.

| File | Path | |------|------| | Main config | ~/.config/opencode/opencode.json | | Accounts | ~/.config/opencode/antigravity-accounts.json | | Plugin config | ~/.config/opencode/antigravity.json | | Debug logs | ~/.config/opencode/antigravity-logs/ |

Windows users: ~ resolves to your user home directory (e.g., C:\Users\YourName). Do NOT use %APPDATA%.


Multi-Account Auth Issues

If you encounter authentication issues with multiple accounts:

  1. Delete the accounts file:
    rm ~/.config/opencode/antigravity-accounts.json
  2. Re-authenticate:
    opencode auth login

403 Permission Denied (rising-fact-p41fc)

Error:

Permission 'cloudaicompanion.companions.generateChat' denied on resource
'//cloudaicompanion.googleapis.com/projects/rising-fact-p41fc/locations/global'

Cause: Plugin falls back to a default project ID when no valid project is found. This works for Antigravity but fails for Gemini CLI models.

Solution:

  1. Go to Google Cloud Console
  2. Create or select a project
  3. Enable the Gemini for Google Cloud API (cloudaicompanion.googleapis.com)
  4. Add projectId to your accounts file:
    {
      "accounts": [
        {
          "email": "[email protected]",
          "refreshToken": "...",
          "projectId": "your-project-id"
        }
      ]
    }

Note: Do this for each account in a multi-account setup.


Gemini Model Not Found

Add this to your google provider config:

{
  "provider": {
    "google": {
      "npm": "@ai-sdk/google",
      "models": { ... }
    }
  }
}

Gemini 3 Models 400 Error ("Unknown name 'parameters'")

Error:

Invalid JSON payload received. Unknown name "parameters" at 'request.tools[0]'

Causes:

  • Tool schema incompatibility with Gemini's strict protobuf validation
  • MCP servers with malformed schemas
  • Plugin version regression

Solutions:

  1. Update to latest beta:

    { "plugin": ["@shaywong/opencode-antigravity-auth@beta"] }
  2. Disable MCP servers one-by-one to find the problematic one

  3. Add npm override:

    { "provider": { "antigravity": { "npm": "@ai-sdk/google" } } }

MCP Servers Causing Errors

Some MCP servers have schemas incompatible with Antigravity's strict JSON format.

Diagnosis:

  1. Disable all MCP servers in your config
  2. Enable one-by-one until error reappears
  3. Report the specific MCP in a GitHub issue

"All Accounts Rate-Limited" (But Quota Available)

Cause: Cascade bug in clearExpiredRateLimits() in hybrid mode (fixed in recent beta).

Solutions:

  1. Update to latest beta version
  2. If persists, delete accounts file and re-authenticate
  3. Try switching account_selection_strategy to "sticky" in antigravity.json

Session Recovery

If you encounter errors during a session:

  1. Type continue to trigger the recovery mechanism
  2. If blocked, use /undo to revert to pre-error state
  3. Retry the operation

Using with Oh-My-OpenCode

Important: Disable the built-in Google auth to prevent conflicts:

// ~/.config/opencode/oh-my-opencode.json
{
  "google_auth": false,
  "agents": {
  "frontend-ui-ux-engineer": { "model": "antigravity/antigravity-gemini-3-pro" },
  "document-writer": { "model": "antigravity/antigravity-gemini-3-flash" }
  }
}

Infinite .tmp Files Created

Cause: When account is rate-limited and plugin retries infinitely, it creates many temp files.

Workaround:

  1. Stop OpenCode
  2. Clean up: rm ~/.config/opencode/*.tmp
  3. Add more accounts or wait for rate limit to expire

OAuth Callback Issues

Symptoms:

  • "fail to authorize" after successful Google login
  • Safari shows "Safari can't open the page"

Cause: Safari's "HTTPS-Only Mode" blocks http://localhost callback.

Solutions:

  1. Use Chrome or Firefox (easiest): Copy the OAuth URL and paste into a different browser.

  2. Disable HTTPS-Only Mode temporarily:

    • Safari > Settings (⌘,) > Privacy
    • Uncheck "Enable HTTPS-Only Mode"
    • Run opencode auth login
    • Re-enable after authentication

macOS / Linux:

# Find process using the port
lsof -i :51121

# Kill if stale
kill -9 <PID>

# Retry
opencode auth login

Windows (PowerShell):

netstat -ano | findstr :51121
taskkill /PID <PID> /F
opencode auth login

OAuth callback requires browser to reach localhost on the machine running OpenCode.

WSL2:

  • Use VS Code's port forwarding, or
  • Configure Windows → WSL port forwarding

SSH / Remote:

ssh -L 51121:localhost:51121 user@remote

Docker / Containers:

  • OAuth with localhost redirect doesn't work in containers
  • Wait 30s for manual URL flow, or use SSH port forwarding

Configuration Key Typo: plugin not plugins

The correct key is plugin (singular):

{
  "plugin": ["@shaywong/opencode-antigravity-auth@beta"]
}

Not "plugins" (will cause "Unrecognized key" error).


Migrating Accounts Between Machines

When copying antigravity-accounts.json to a new machine:

  1. Ensure the plugin is installed: "plugin": ["@shaywong/opencode-antigravity-auth@beta"]
  2. Copy ~/.config/opencode/antigravity-accounts.json
  3. If you get "API key missing" error, the refresh token may be invalid — re-authenticate

Known Plugin Interactions

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": [
    "@shaywong/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": "antigravity/antigravity-gemini-3-pro" },
  "document-writer": { "model": "antigravity/antigravity-gemini-3-flash" },
  "multimodal-looker": { "model": "antigravity/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 optional settings:

{
  "$schema": "https://raw.githubusercontent.com/shay-wong/opencode-antigravity-auth/main/assets/antigravity.schema.json"
}

Most users don't need to configure anything — defaults work well.

Model Behavior

| Option | Default | What it does | |--------|---------|-------------- | keep_thinking | false | Preserve Claude's thinking across turns. Warning: enabling may degrade model stability. | | session_recovery | true | Auto-recover from tool errors | | web_search.default_mode | "off" | Gemini Google Search: "auto" or "off" |

Account Rotation

| Your Setup | Recommended Config | |------------|-------------------| | 1 account | "account_selection_strategy": "sticky" | | 2-5 accounts | Default ("hybrid") works great | | 5+ accounts | "account_selection_strategy": "round-robin" | | Parallel agents | Add "pid_offset_enabled": true |

Rate Limit Scheduling

Control how the plugin handles rate limits:

| Option | Default | What it does | |--------|---------|--------------| | scheduling_mode | "cache_first" | "cache_first" = wait for same account (preserves prompt cache), "balance" = switch immediately, "performance_first" = round-robin | | max_cache_first_wait_seconds | 60 | Max seconds to wait in cache_first mode before switching accounts | | failure_ttl_seconds | 3600 | Reset failure count after this many seconds (prevents old failures from permanently penalizing accounts) |

When to use each mode:

  • cache_first (default): Best for long conversations. Waits for the same account to recover, preserving your prompt cache.
  • balance: Best for quick tasks. Switches accounts immediately when rate-limited for maximum availability.
  • performance_first: Best for many short requests. Distributes load evenly across all accounts.

App Behavior

| Option | Default | What it does | |--------|---------|--------------| | quiet_mode | false | Hide toast notifications | | debug | false | Enable debug logging | | auto_update | true | Auto-update plugin |

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.

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.