[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-78618":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":23,"hasPages":23,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":30,"readmeContent":31,"aiSummary":32,"trendingCount":16,"starSnapshotCount":16,"syncStatus":33,"lastSyncTime":34,"discoverSource":35},78618,"opencode-antigravity-auth","NoeFabris\u002Fopencode-antigravity-auth","NoeFabris","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.","",null,"TypeScript",10786,26,32,35,0,38,71,140,114,39.29,"MIT License",false,"main",[26,27,28,29],"claude","gemini","google","opencode","2026-06-12 02:03:48","# Antigravity + Gemini CLI OAuth Plugin for Opencode\n\n[![npm version](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002Fopencode-antigravity-auth.svg)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fopencode-antigravity-auth)\n[![npm beta](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002Fopencode-antigravity-auth\u002Fbeta.svg?label=beta)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fopencode-antigravity-auth)\n[![npm downloads](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fdw\u002Fopencode-antigravity-auth.svg)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fopencode-antigravity-auth)\n[![License: MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-yellow.svg)](LICENSE)\n[![X (Twitter)](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FX-@dopesalmon-000000?style=flat&logo=x)](https:\u002F\u002Fx.com\u002Fdopesalmon)\n\nEnable 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.\n\n## What You Get\n\n- **Claude Opus 4.6, Sonnet 4.6** and **Gemini 3.1 Pro\u002FFlash** via Google OAuth\n- **Multi-account support** — add multiple Google accounts, auto-rotates when rate-limited\n- **Dual quota system** — access both Antigravity and Gemini CLI quotas from one plugin\n- **Thinking models** — extended thinking for Claude and Gemini 3 with configurable budgets\n- **Google Search grounding** — enable web search for Gemini models (auto or always-on)\n- **Auto-recovery** — handles session errors and tool failures automatically\n- **Plugin compatible** — works alongside other OpenCode plugins (oh-my-opencode, dcp, etc.)\n\n---\n\n\u003Cdetails open>\n\u003Csummary>\u003Cb>⚠️ Terms of Service Warning — Read Before Installing\u003C\u002Fb>\u003C\u002Fsummary>\n\n> [!CAUTION]\n> Using this plugin (and any proxy for Antigravity) violates Google's Terms of Service. A number of users have reported their Google accounts being **banned** or **shadow-banned** (restricted access without explicit notification).\n>\n> **By using this plugin, you acknowledge:**\n> - This is an unofficial tool not endorsed by Google\n> - Your account may be suspended or permanently banned\n> - You assume all risks associated with using this plugin\n>\n\n\u003C\u002Fdetails>\n\n---\n\n## Installation\n\n\u003Cdetails open>\n\u003Csummary>\u003Cb>For Humans\u003C\u002Fb>\u003C\u002Fsummary>\n\n**Option A: Let an LLM do it**\n\nPaste this into any LLM agent (Claude Code, OpenCode, Cursor, etc.):\n\n```\nInstall the opencode-antigravity-auth plugin and add the Antigravity model definitions to ~\u002F.config\u002Fopencode\u002Fopencode.json by following: https:\u002F\u002Fraw.githubusercontent.com\u002FNoeFabris\u002Fopencode-antigravity-auth\u002Fdev\u002FREADME.md\n```\n\n**Option B: Manual setup**\n\n1. **Add the plugin** to `~\u002F.config\u002Fopencode\u002Fopencode.json`:\n\n   ```json\n   {\n     \"plugin\": [\"opencode-antigravity-auth@latest\"]\n   }\n   ```\n\n   > Want bleeding-edge features? Use `opencode-antigravity-auth@beta` instead.\n\n2. **Login** with your Google account:\n\n   ```bash\n   opencode auth login\n   ```\n\n3. **Add models** — choose one:\n   - Run `opencode auth login` → Google → OAuth with Google (Antigravity) → select **\"Configure models in opencode.json\"** (auto-configures all models)\n   - Or manually copy the [full configuration](#models) below\n\n4. **Use it:**\n\n   ```bash\n   opencode run \"Hello\" --model=google\u002Fantigravity-claude-opus-4-6-thinking --variant=max\n   ```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>For LLM Agents\u003C\u002Fb>\u003C\u002Fsummary>\n\n### Step-by-Step Instructions\n\n1. Edit the OpenCode configuration file at `~\u002F.config\u002Fopencode\u002Fopencode.json`\n   \n   > **Note**: This path works on all platforms. On Windows, `~` resolves to your user home directory (e.g., `C:\\Users\\YourName`).\n\n2. Add the plugin to the `plugin` array\n\n3. Add the model definitions from the [Full models configuration](#models) section\n\n4. Set `provider` to `\"google\"` and choose a model\n\n### Verification\n\n```bash\nopencode run \"Hello\" --model=google\u002Fantigravity-claude-opus-4-6-thinking --variant=max\n```\n\n\u003C\u002Fdetails>\n\n---\n\n## Models\n\n### Model Reference\n\n**Antigravity quota** (default routing for Claude and Gemini):\n\n| Model | Variants | Notes |\n|-------|----------|-------|\n| `antigravity-gemini-3-pro` | low, high | Gemini 3 Pro with thinking |\n| `antigravity-gemini-3.1-pro` | low, high | Gemini 3.1 Pro with thinking (rollout-dependent) |\n| `antigravity-gemini-3-flash` | minimal, low, medium, high | Gemini 3 Flash with thinking |\n| `antigravity-claude-sonnet-4-6` | — | Claude Sonnet 4.6 |\n| `antigravity-claude-opus-4-6-thinking` | low, max | Claude Opus 4.6 with extended thinking |\n\n**Gemini CLI quota** (separate from Antigravity; used when `cli_first` is true or as fallback):\n\n| Model | Notes |\n|-------|-------|\n| `gemini-2.5-flash` | Gemini 2.5 Flash |\n| `gemini-2.5-pro` | Gemini 2.5 Pro |\n| `gemini-3-flash-preview` | Gemini 3 Flash (preview) |\n| `gemini-3-pro-preview` | Gemini 3 Pro (preview) |\n| `gemini-3.1-pro-preview` | Gemini 3.1 Pro (preview, rollout-dependent) |\n| `gemini-3.1-pro-preview-customtools` | Gemini 3.1 Pro Preview Custom Tools (preview, rollout-dependent) |\n\n> **Routing Behavior:**\n> - **Antigravity-first (default):** Gemini models use Antigravity quota across accounts.\n> - **CLI-first (`cli_first: true`):** Gemini models use Gemini CLI quota first.\n> - When a Gemini quota pool is exhausted, the plugin automatically falls back to the other pool.\n> - Claude and image models always use Antigravity.\n> Model names are automatically transformed for the target API (e.g., `antigravity-gemini-3-flash` → `gemini-3-flash-preview` for CLI).\n\n**Using variants:**\n```bash\nopencode run \"Hello\" --model=google\u002Fantigravity-claude-opus-4-6-thinking --variant=max\n```\n\nFor details on variant configuration and thinking levels, see [docs\u002FMODEL-VARIANTS.md](docs\u002FMODEL-VARIANTS.md).\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Full models configuration (copy-paste ready)\u003C\u002Fb>\u003C\u002Fsummary>\n\nAdd this to your `~\u002F.config\u002Fopencode\u002Fopencode.json`:\n\n```json\n{\n  \"$schema\": \"https:\u002F\u002Fopencode.ai\u002Fconfig.json\",\n  \"plugin\": [\"opencode-antigravity-auth@latest\"],\n  \"provider\": {\n    \"google\": {\n      \"models\": {\n        \"antigravity-gemini-3-pro\": {\n          \"name\": \"Gemini 3 Pro (Antigravity)\",\n          \"limit\": { \"context\": 1048576, \"output\": 65535 },\n          \"modalities\": { \"input\": [\"text\", \"image\", \"pdf\"], \"output\": [\"text\"] },\n          \"variants\": {\n            \"low\": { \"thinkingLevel\": \"low\" },\n            \"high\": { \"thinkingLevel\": \"high\" }\n          }\n        },\n        \"antigravity-gemini-3.1-pro\": {\n          \"name\": \"Gemini 3.1 Pro (Antigravity)\",\n          \"limit\": { \"context\": 1048576, \"output\": 65535 },\n          \"modalities\": { \"input\": [\"text\", \"image\", \"pdf\"], \"output\": [\"text\"] },\n          \"variants\": {\n            \"low\": { \"thinkingLevel\": \"low\" },\n            \"high\": { \"thinkingLevel\": \"high\" }\n          }\n        },\n        \"antigravity-gemini-3-flash\": {\n          \"name\": \"Gemini 3 Flash (Antigravity)\",\n          \"limit\": { \"context\": 1048576, \"output\": 65536 },\n          \"modalities\": { \"input\": [\"text\", \"image\", \"pdf\"], \"output\": [\"text\"] },\n          \"variants\": {\n            \"minimal\": { \"thinkingLevel\": \"minimal\" },\n            \"low\": { \"thinkingLevel\": \"low\" },\n            \"medium\": { \"thinkingLevel\": \"medium\" },\n            \"high\": { \"thinkingLevel\": \"high\" }\n          }\n        },\n        \"antigravity-claude-sonnet-4-6\": {\n          \"name\": \"Claude Sonnet 4.6 (Antigravity)\",\n          \"limit\": { \"context\": 200000, \"output\": 64000 },\n          \"modalities\": { \"input\": [\"text\", \"image\", \"pdf\"], \"output\": [\"text\"] }\n        },\n        \"antigravity-claude-opus-4-6-thinking\": {\n          \"name\": \"Claude Opus 4.6 Thinking (Antigravity)\",\n          \"limit\": { \"context\": 200000, \"output\": 64000 },\n          \"modalities\": { \"input\": [\"text\", \"image\", \"pdf\"], \"output\": [\"text\"] },\n          \"variants\": {\n            \"low\": { \"thinkingConfig\": { \"thinkingBudget\": 8192 } },\n            \"max\": { \"thinkingConfig\": { \"thinkingBudget\": 32768 } }\n          }\n        },\n        \"gemini-2.5-flash\": {\n          \"name\": \"Gemini 2.5 Flash (Gemini CLI)\",\n          \"limit\": { \"context\": 1048576, \"output\": 65536 },\n          \"modalities\": { \"input\": [\"text\", \"image\", \"pdf\"], \"output\": [\"text\"] }\n        },\n        \"gemini-2.5-pro\": {\n          \"name\": \"Gemini 2.5 Pro (Gemini CLI)\",\n          \"limit\": { \"context\": 1048576, \"output\": 65536 },\n          \"modalities\": { \"input\": [\"text\", \"image\", \"pdf\"], \"output\": [\"text\"] }\n        },\n        \"gemini-3-flash-preview\": {\n          \"name\": \"Gemini 3 Flash Preview (Gemini CLI)\",\n          \"limit\": { \"context\": 1048576, \"output\": 65536 },\n          \"modalities\": { \"input\": [\"text\", \"image\", \"pdf\"], \"output\": [\"text\"] }\n        },\n        \"gemini-3-pro-preview\": {\n          \"name\": \"Gemini 3 Pro Preview (Gemini CLI)\",\n          \"limit\": { \"context\": 1048576, \"output\": 65535 },\n          \"modalities\": { \"input\": [\"text\", \"image\", \"pdf\"], \"output\": [\"text\"] }\n        },\n        \"gemini-3.1-pro-preview\": {\n          \"name\": \"Gemini 3.1 Pro Preview (Gemini CLI)\",\n          \"limit\": { \"context\": 1048576, \"output\": 65535 },\n          \"modalities\": { \"input\": [\"text\", \"image\", \"pdf\"], \"output\": [\"text\"] }\n        },\n        \"gemini-3.1-pro-preview-customtools\": {\n          \"name\": \"Gemini 3.1 Pro Preview Custom Tools (Gemini CLI)\",\n          \"limit\": { \"context\": 1048576, \"output\": 65535 },\n          \"modalities\": { \"input\": [\"text\", \"image\", \"pdf\"], \"output\": [\"text\"] }\n        }\n      }\n    }\n  }\n}\n```\n\n> **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.\n\n\u003C\u002Fdetails>\n\n---\n\n## Multi-Account Setup\n\nAdd multiple Google accounts for a higher combined quota. The plugin automatically rotates between accounts when one is rate-limited.\n\n```bash\nopencode auth login  # Run again to add more accounts\n```\n\n**Account management options (via `opencode auth login`):**\n- **Configure models** — Auto-configure all plugin models in opencode.json\n- **Check quotas** — View remaining API quota for each account\n- **Manage accounts** — Enable\u002Fdisable specific accounts for rotation\n\nFor details on load balancing, dual quota pools, and account storage, see [docs\u002FMULTI-ACCOUNT.md](docs\u002FMULTI-ACCOUNT.md).\n\n---\n\n## Troubleshooting\n\n> **Quick Reset**: Most issues can be resolved by deleting `~\u002F.config\u002Fopencode\u002Fantigravity-accounts.json` and running `opencode auth login` again.\n\n### Configuration Path (All Platforms)\n\nOpenCode uses `~\u002F.config\u002Fopencode\u002F` on **all platforms** including Windows.\n\n| File | Path |\n|------|------|\n| Main config | `~\u002F.config\u002Fopencode\u002Fopencode.json` |\n| Accounts | `~\u002F.config\u002Fopencode\u002Fantigravity-accounts.json` |\n| Plugin config | `~\u002F.config\u002Fopencode\u002Fantigravity.json` |\n| Debug logs | `~\u002F.config\u002Fopencode\u002Fantigravity-logs\u002F` |\n\n> **Windows users**: `~` resolves to your user home directory (e.g., `C:\\Users\\YourName`). Do NOT use `%APPDATA%`.\n\n> **Custom path**: Set `OPENCODE_CONFIG_DIR` environment variable to use a custom location.\n\n> **Windows migration**: If upgrading from plugin v1.3.x or earlier, the plugin will automatically find your existing config in `%APPDATA%\\opencode\\` and use it. New installations use `~\u002F.config\u002Fopencode\u002F`.\n\n---\n\n### Multi-Account Auth Issues\n\nIf you encounter authentication issues with multiple accounts:\n\n1. Delete the accounts file:\n   ```bash\n   rm ~\u002F.config\u002Fopencode\u002Fantigravity-accounts.json\n   ```\n2. Re-authenticate:\n   ```bash\n   opencode auth login\n   ```\n\n---\n\n### 403 Permission Denied (`rising-fact-p41fc`)\n\n**Error:**\n```\nPermission 'cloudaicompanion.companions.generateChat' denied on resource \n'\u002F\u002Fcloudaicompanion.googleapis.com\u002Fprojects\u002Frising-fact-p41fc\u002Flocations\u002Fglobal'\n```\n\n**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.\n\n**Solution:**\n1. Go to [Google Cloud Console](https:\u002F\u002Fconsole.cloud.google.com\u002F)\n2. Create or select a project\n3. Enable the **Gemini for Google Cloud API** (`cloudaicompanion.googleapis.com`)\n4. Add `projectId` to your accounts file:\n   ```json\n   {\n     \"accounts\": [\n       {\n         \"email\": \"your@email.com\",\n         \"refreshToken\": \"...\",\n         \"projectId\": \"your-project-id\"\n       }\n     ]\n   }\n   ```\n\n> **Note**: Do this for each account in a multi-account setup.\n\n---\n\n### Gemini Model Not Found\n\nAdd this to your `google` provider config:\n\n```json\n{\n  \"provider\": {\n    \"google\": {\n      \"npm\": \"@ai-sdk\u002Fgoogle\",\n      \"models\": { ... }\n    }\n  }\n}\n```\n\n---\n\n### Gemini 3 Models 400 Error (\"Unknown name 'parameters'\")\n\n**Error:**\n```\nInvalid JSON payload received. Unknown name \"parameters\" at 'request.tools[0]'\n```\n\n**Causes:**\n- Tool schema incompatibility with Gemini's strict protobuf validation\n- MCP servers with malformed schemas\n- Plugin version regression\n\n**Solutions:**\n1. **Update to latest beta:**\n   ```json\n   { \"plugin\": [\"opencode-antigravity-auth@beta\"] }\n   ```\n\n2. **Disable MCP servers** one-by-one to find the problematic one\n\n3. **Add npm override:**\n   ```json\n   { \"provider\": { \"google\": { \"npm\": \"@ai-sdk\u002Fgoogle\" } } }\n   ```\n\n---\n\n### MCP Servers Causing Errors\n\nSome MCP servers have schemas incompatible with Antigravity's strict JSON format.\n\n**Common symptom:**\n```bash\nInvalid function name must start with a letter or underscore\n```\n\nSometimes it shows up as:\n```bash\nGenerateContentRequest.tools[0].function_declarations[12].name: Invalid function name must start with a letter or underscore\n```\n\nThis usually means an MCP tool name starts with a number (for example, a 1mcp key like `1mcp_*`). Rename the MCP key to start with a letter (e.g., `gw`) or disable that MCP entry for Antigravity models.\n\n**Diagnosis:**\n1. Disable all MCP servers in your config\n2. Enable one-by-one until error reappears\n3. Report the specific MCP in a [GitHub issue](https:\u002F\u002Fgithub.com\u002FNoeFabris\u002Fopencode-antigravity-auth\u002Fissues)\n\n---\n\n### \"All Accounts Rate-Limited\" (But Quota Available)\n\n**Cause:** Cascade bug in `clearExpiredRateLimits()` in hybrid mode (fixed in recent beta).\n\n**Solutions:**\n1. Update to latest beta version\n2. If persists, delete accounts file and re-authenticate\n3. Try switching `account_selection_strategy` to `\"sticky\"` in `antigravity.json`\n\n---\n\n### Session Recovery\n\nIf you encounter errors during a session:\n1. Type `continue` to trigger the recovery mechanism\n2. If blocked, use `\u002Fundo` to revert to pre-error state\n3. Retry the operation\n\n---\n\n### Using with Oh-My-OpenCode\n\n**Important:** Disable the built-in Google auth to prevent conflicts:\n\n```json\n\u002F\u002F ~\u002F.config\u002Fopencode\u002Foh-my-opencode.json\n{\n  \"google_auth\": false,\n  \"agents\": {\n    \"frontend-ui-ux-engineer\": { \"model\": \"google\u002Fantigravity-gemini-3-pro\" },\n    \"document-writer\": { \"model\": \"google\u002Fantigravity-gemini-3-flash\" }\n  }\n}\n```\n\n---\n\n### Infinite `.tmp` Files Created\n\n**Cause:** When account is rate-limited and plugin retries infinitely, it creates many temp files.\n\n**Workaround:**\n1. Stop OpenCode\n2. Clean up: `rm ~\u002F.config\u002Fopencode\u002F*.tmp`\n3. Add more accounts or wait for rate limit to expire\n\n---\n\n### OAuth Callback Issues\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Safari OAuth Callback Fails (macOS)\u003C\u002Fb>\u003C\u002Fsummary>\n\n**Symptoms:**\n- \"fail to authorize\" after successful Google login\n- Safari shows \"Safari can't open the page\"\n\n**Cause:** Safari's \"HTTPS-Only Mode\" blocks `http:\u002F\u002Flocalhost` callback.\n\n**Solutions:**\n\n1. **Use Chrome or Firefox** (easiest):\n   Copy the OAuth URL and paste into a different browser.\n\n2. **Disable HTTPS-Only Mode temporarily:**\n   - Safari > Settings (⌘,) > Privacy\n   - Uncheck \"Enable HTTPS-Only Mode\"\n   - Run `opencode auth login`\n   - Re-enable after authentication\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Port Conflict (Address Already in Use)\u003C\u002Fb>\u003C\u002Fsummary>\n\n**macOS \u002F Linux:**\n```bash\n# Find process using the port\nlsof -i :51121\n\n# Kill if stale\nkill -9 \u003CPID>\n\n# Retry\nopencode auth login\n```\n\n**Windows (PowerShell):**\n```powershell\nnetstat -ano | findstr :51121\ntaskkill \u002FPID \u003CPID> \u002FF\nopencode auth login\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Docker \u002F WSL2 \u002F Remote Development\u003C\u002Fb>\u003C\u002Fsummary>\n\nOAuth callback requires browser to reach `localhost` on the machine running OpenCode.\n\n**WSL2:**\n- Use VS Code's port forwarding, or\n- Configure Windows → WSL port forwarding\n\n**SSH \u002F Remote:**\n```bash\nssh -L 51121:localhost:51121 user@remote\n```\n\n**Docker \u002F Containers:**\n- OAuth with localhost redirect doesn't work in containers\n- Wait 30s for manual URL flow, or use SSH port forwarding\n\n\u003C\u002Fdetails>\n\n---\n\n### Configuration Key Typo: `plugin` not `plugins`\n\nThe correct key is `plugin` (singular):\n\n```json\n{\n  \"plugin\": [\"opencode-antigravity-auth@beta\"]\n}\n```\n\n**Not** `\"plugins\"` (will cause \"Unrecognized key\" error).\n\n---\n\n### Migrating Accounts Between Machines\n\nWhen copying `antigravity-accounts.json` to a new machine:\n1. Ensure the plugin is installed: `\"plugin\": [\"opencode-antigravity-auth@beta\"]`\n2. Copy `~\u002F.config\u002Fopencode\u002Fantigravity-accounts.json`\n3. If you get \"API key missing\" error, the refresh token may be invalid — re-authenticate\n\n## Known Plugin Interactions\nFor details on load balancing, dual quota pools, and account storage, see [docs\u002FMULTI-ACCOUNT.md](docs\u002FMULTI-ACCOUNT.md).\n\n---\n\n## Plugin Compatibility\n\n### @tarquinen\u002Fopencode-dcp\n\nDCP creates synthetic assistant messages that lack thinking blocks. **List this plugin BEFORE DCP:**\n\n```json\n{\n  \"plugin\": [\n    \"opencode-antigravity-auth@latest\",\n    \"@tarquinen\u002Fopencode-dcp@latest\"\n  ]\n}\n```\n\n### oh-my-opencode\n\nDisable built-in auth and override agent models in `oh-my-opencode.json`:\n\n```json\n{\n  \"google_auth\": false,\n  \"agents\": {\n    \"frontend-ui-ux-engineer\": { \"model\": \"google\u002Fantigravity-gemini-3-pro\" },\n    \"document-writer\": { \"model\": \"google\u002Fantigravity-gemini-3-flash\" },\n    \"multimodal-looker\": { \"model\": \"google\u002Fantigravity-gemini-3-flash\" }\n  }\n}\n```\n\n> **Tip:** When spawning parallel subagents, enable `pid_offset_enabled: true` in `antigravity.json` to distribute sessions across accounts.\n\n### Plugins you don't need\n\n- **gemini-auth plugins** — Not needed. This plugin handles all Google OAuth.\n\n---\n\n## Configuration\n\nCreate `~\u002F.config\u002Fopencode\u002Fantigravity.json` for optional settings:\n\n```json\n{\n  \"$schema\": \"https:\u002F\u002Fraw.githubusercontent.com\u002FNoeFabris\u002Fopencode-antigravity-auth\u002Fmain\u002Fassets\u002Fantigravity.schema.json\"\n}\n```\n\nMost users don't need to configure anything — defaults work well.\n\n### Model Behavior\n\n| Option | Default | What it does |\n|--------|---------|--------------\n| `keep_thinking` | `false` | Preserve Claude's thinking across turns. **Warning:** enabling may degrade model stability. |\n| `session_recovery` | `true` | Auto-recover from tool errors |\n| `cli_first` | `false` | Route Gemini models to Gemini CLI first (Claude and image models stay on Antigravity). |\n\n### Account Rotation\n\n| Your Setup | Recommended Config |\n|------------|-------------------|\n| **1 account** | `\"account_selection_strategy\": \"sticky\"` |\n| **2-5 accounts** | Default (`\"hybrid\"`) works great |\n| **5+ accounts** | `\"account_selection_strategy\": \"round-robin\"` |\n| **Parallel agents** | Add `\"pid_offset_enabled\": true` |\n\n### Quota Protection\n\n| Option | Default | What it does |\n|--------|---------|--------------|\n| `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. |\n| `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. |\n| `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. |\n\n> **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.\n\n### Rate Limit Scheduling\n\nControl how the plugin handles rate limits:\n\n| Option | Default | What it does |\n|--------|---------|--------------|\n| `scheduling_mode` | `\"cache_first\"` | `\"cache_first\"` = wait for same account (preserves prompt cache), `\"balance\"` = switch immediately, `\"performance_first\"` = round-robin |\n| `max_cache_first_wait_seconds` | `60` | Max seconds to wait in cache_first mode before switching accounts |\n| `failure_ttl_seconds` | `3600` | Reset failure count after this many seconds (prevents old failures from permanently penalizing accounts) |\n\n**When to use each mode:**\n- **cache_first** (default): Best for long conversations. Waits for the same account to recover, preserving your prompt cache.\n- **balance**: Best for quick tasks. Switches accounts immediately when rate-limited for maximum availability.\n- **performance_first**: Best for many short requests. Distributes load evenly across all accounts.\n\n### App Behavior\n\n| Option | Default | What it does |\n|--------|---------|--------------|\n| `quiet_mode` | `false` | Hide toast notifications |\n| `debug` | `false` | Enable debug file logging (`~\u002F.config\u002Fopencode\u002Fantigravity-logs\u002F`) |\n| `debug_tui` | `false` | Show debug logs in the TUI log panel (independent from `debug`) |\n| `auto_update` | `true` | Auto-update plugin |\n\nFor all options, see [docs\u002FCONFIGURATION.md](docs\u002FCONFIGURATION.md).\n\n**Environment variables:**\n```bash\nOPENCODE_CONFIG_DIR=\u002Fpath\u002Fto\u002Fconfig opencode  # Custom config directory\nOPENCODE_ANTIGRAVITY_DEBUG=1 opencode         # Enable debug file logging\nOPENCODE_ANTIGRAVITY_DEBUG=2 opencode         # Verbose debug file logging\nOPENCODE_ANTIGRAVITY_DEBUG_TUI=1 opencode     # Enable TUI log panel debug output\n```\n\n---\n\n## Troubleshooting\n\nSee the full [Troubleshooting Guide](docs\u002FTROUBLESHOOTING.md) for solutions to common issues including:\n\n- Auth problems and token refresh\n- \"Model not found\" errors\n- Session recovery\n- Gemini CLI permission errors\n- Safari OAuth issues\n- Plugin compatibility\n- Migration guides\n\n---\n\n## Documentation\n\n- [Configuration](docs\u002FCONFIGURATION.md) — All configuration options\n- [Multi-Account](docs\u002FMULTI-ACCOUNT.md) — Load balancing, dual quota pools, account storage\n- [Model Variants](docs\u002FMODEL-VARIANTS.md) — Thinking budgets and variant system\n- [Troubleshooting](docs\u002FTROUBLESHOOTING.md) — Common issues and fixes\n- [Architecture](docs\u002FARCHITECTURE.md) — How the plugin works\n- [API Spec](docs\u002FANTIGRAVITY_API_SPEC.md) — Antigravity API reference\n\n---\n\n## Support\n\nIf this plugin saves you time, consider supporting its development:\n\n[![ko-fi](https:\u002F\u002Fko-fi.com\u002Fimg\u002Fgithubbutton_sm.svg)](https:\u002F\u002Fko-fi.com\u002FS6S81QBOIR)\n\n---\n\n## Credits\n\n- [opencode-gemini-auth](https:\u002F\u002Fgithub.com\u002Fjenslys\u002Fopencode-gemini-auth) by [@jenslys](https:\u002F\u002Fgithub.com\u002Fjenslys)\n- [CLIProxyAPI](https:\u002F\u002Fgithub.com\u002Frouter-for-me\u002FCLIProxyAPI)\n\n## License\n\nMIT License. See [LICENSE](LICENSE) for details.\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Legal\u003C\u002Fb>\u003C\u002Fsummary>\n\n### Intended Use\n\n- Personal \u002F internal development only\n- Respect internal quotas and data handling policies\n- Not for production services or bypassing intended limits\n\n### Warning\n\nBy using this plugin, you acknowledge:\n\n- **Terms of Service risk** — This approach may violate ToS of AI model providers\n- **Account risk** — Providers may suspend or ban accounts\n- **No guarantees** — APIs may change without notice\n- **Assumption of risk** — You assume all legal, financial, and technical risks\n\n### Disclaimer\n\n- Not affiliated with Google. This is an independent open-source project.\n- \"Antigravity\", \"Gemini\", \"Google Cloud\", and \"Google\" are trademarks of Google LLC.\n\n\u003C\u002Fdetails>\n","该项目通过OAuth使Opencode能够与Antigravity（Google的IDE）进行身份验证，从而允许用户使用其Google凭据访问如gemini-3.1-pro和claude-opus-4-6-thinking等模型。项目采用TypeScript编写，具备多账户支持、双配额系统、扩展思考模式配置以及自动恢复等功能特点。适用于需要利用Antigravity提供的API限额并希望通过官方不支持的方式增强开发或研究能力的技术人员。注意，使用此插件可能违反Google的服务条款，存在账号被封禁的风险。",2,"2026-06-11 03:57:01","high_star"]