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

opencode-antigravity-authlogin

v1.7.1

Published

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

Readme

Antigravity + Gemini CLI OAuth Plugin for Opencode

npm version npm downloads License: MIT

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

Fork of NoeFabris/opencode-antigravity-auth — this fork adds the AI Credits Overages fallback (1.7.0). See Credits for the full upstream chain.

What You Get

  • Claude Opus 4.6, Sonnet 4.6 and Gemini 3.1 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)
  • AI Credits Overages — automatically fall back to paid AI Credits when free quota is exhausted
  • Auto-recovery — handles session errors and tool failures automatically
  • Plugin compatible — works alongside other OpenCode plugins (oh-my-opencode, dcp, etc.)

Installation

Option A: Let an LLM do it

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

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

Option B: Manual setup

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

    {
      "plugin": ["opencode-antigravity-authlogin@latest"]
    }
  2. Login with your Google account:

    opencode auth login
  3. Add models — choose one:

    • Run opencode auth login → Google → OAuth with Google (Antigravity) → select "Configure models in opencode.json" (auto-configures all models)
    • Or manually copy the full configuration below
  4. Use it:

    opencode run "Hello" --model=google/antigravity-claude-opus-4-6-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=google/antigravity-claude-opus-4-6-thinking --variant=max

Models

Model Reference

Antigravity quota (default routing for Claude and Gemini):

| Model | Variants | Notes | |-------|----------|-------| | antigravity-gemini-3-pro | low, high | Gemini 3 Pro with thinking | | antigravity-gemini-3.1-pro | low, high | Gemini 3.1 Pro with thinking (rollout-dependent) | | antigravity-gemini-3-flash | minimal, low, medium, high | Gemini 3 Flash with thinking | | antigravity-claude-sonnet-4-6 | — | Claude Sonnet 4.6 | | antigravity-claude-opus-4-6-thinking | low, max | Claude Opus 4.6 with extended thinking |

Gemini CLI quota (separate from Antigravity; used when cli_first is true or as fallback):

| 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) | | gemini-3.1-pro-preview | Gemini 3.1 Pro (preview, rollout-dependent) | | gemini-3.1-pro-preview-customtools | Gemini 3.1 Pro Preview Custom Tools (preview, rollout-dependent) |

Routing Behavior:

  • Antigravity-first (default): Gemini models use Antigravity quota across accounts.
  • CLI-first (cli_first: true): Gemini models use Gemini CLI quota first.
  • When a Gemini quota pool is exhausted, the plugin automatically falls back to the other pool.
  • Claude and image models always use Antigravity. Model names are automatically transformed for the target API (e.g., antigravity-gemini-3-flashgemini-3-flash-preview for CLI).

Using variants:

opencode run "Hello" --model=google/antigravity-claude-opus-4-6-thinking --variant=max

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

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["opencode-antigravity-authlogin@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.1-pro": {
          "name": "Gemini 3.1 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-6": {
          "name": "Claude Sonnet 4.6 (Antigravity)",
          "limit": { "context": 200000, "output": 64000 },
          "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
        },
        "antigravity-claude-opus-4-6-thinking": {
          "name": "Claude Opus 4.6 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"] }
        },
        "gemini-3.1-pro-preview": {
          "name": "Gemini 3.1 Pro Preview (Gemini CLI)",
          "limit": { "context": 1048576, "output": 65535 },
          "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
        },
        "gemini-3.1-pro-preview-customtools": {
          "name": "Gemini 3.1 Pro Preview Custom Tools (Gemini CLI)",
          "limit": { "context": 1048576, "output": 65535 },
          "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
        }
      }
    }
  }
}

Backward Compatibility: Legacy model names with antigravity- prefix (e.g., antigravity-gemini-3-flash) still work. The plugin automatically handles model name transformation for both Antigravity and Gemini CLI APIs.


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

Account management options (via opencode auth login):

  • Configure models — Auto-configure all plugin models in opencode.json
  • Check quotas — View remaining API quota for each account
  • Manage accounts — Enable/disable specific accounts for rotation

Plugin Compatibility

@tarquinen/opencode-dcp

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

{
  "plugin": [
    "opencode-antigravity-authlogin@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.


Configuration

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

{
  "$schema": "https://raw.githubusercontent.com/D4ch1au/opencode-antigravity-authlogin/main/assets/antigravity.schema.json"
}

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

Configuration Paths

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

Custom path: Set OPENCODE_CONFIG_DIR environment variable to use a custom location.

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 | | cli_first | false | Route Gemini models to Gemini CLI first (Claude and image models stay on Antigravity). |

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 |

Quota Protection

| Option | Default | What it does | |--------|---------|--------------| | soft_quota_threshold_percent | 90 | Skip account when quota usage exceeds this percentage. Prevents Google from penalizing accounts that fully exhaust quota. Set to 100 to disable. | | quota_refresh_interval_minutes | 15 | Background quota refresh interval. After successful API requests, refreshes quota cache if older than this interval. Set to 0 to disable. | | soft_quota_cache_ttl_minutes | "auto" | How long quota cache is considered fresh. "auto" = max(2 × refresh interval, 10 minutes). Set a number (1-120) for fixed TTL. |

How it works: Quota cache is refreshed automatically after API requests (when older than quota_refresh_interval_minutes) and manually via "Check quotas" in opencode auth login. The threshold check uses soft_quota_cache_ttl_minutes to determine cache freshness - if cache is older, the account is considered "unknown" and allowed (fail-open). When ALL accounts exceed the threshold, the plugin waits for the earliest quota reset time (like rate limit behavior). If wait time exceeds max_rate_limit_wait_seconds, it errors immediately.

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.

AI Credits Overages

When an account's free quota is exhausted (QUOTA_EXHAUSTED 429), the plugin automatically injects enabledCreditTypes: ["GOOGLE_ONE_AI"] to use paid AI Credits instead of rotating to another account. Credits exhaustion is tracked per-account with a 5-hour TTL, so accounts with available credits stay schedulable.

This feature is on by default and requires no configuration. Debug output tagged credits-precheck: (proactive injection) and credits-429: (reactive retry) is visible when debug logging is enabled.

App Behavior

| Option | Default | What it does | |--------|---------|--------------| | quiet_mode | false | Hide toast notifications | | debug | false | Enable debug file logging (~/.config/opencode/antigravity-logs/) | | debug_tui | false | Show debug logs in the TUI log panel (independent from debug) | | auto_update | true | Auto-update plugin |

Environment variables:

OPENCODE_CONFIG_DIR=/path/to/config opencode  # Custom config directory
OPENCODE_ANTIGRAVITY_DEBUG=1 opencode         # Enable debug file logging
OPENCODE_ANTIGRAVITY_DEBUG=2 opencode         # Verbose debug file logging
OPENCODE_ANTIGRAVITY_DEBUG_TUI=1 opencode     # Enable TUI log panel debug output

Credits

This project is a fork with the following upstream lineage:

Changes in this fork over NoeFabris/[email protected]:

  • AI Credits Overages fallback (1.7.0) — automatically inject enabledCreditTypes: ["GOOGLE_ONE_AI"] when free quota is exhausted, with per-account credits-exhausted tracking (5h TTL).

All credit for the underlying plugin architecture, Antigravity integration, and account rotation logic belongs to the upstream maintainers.