Guide · Open source
How to use opencode-antigravity-auth: setup, login and models
Updated · written with AI from the project's own documentation and checked against our catalogue data
opencode-antigravity-auth is an unofficial MIT-licensed plugin for Opencode, the terminal coding tool. It signs you in to Google through OAuth so Opencode can call models that Antigravity (Google's IDE) provides, including Gemini and Claude models, using Antigravity's rate limits. This guide covers the requirements, installation, login, model selection, the /antigravity menu and where credentials are stored.
Quick start
- 1Check prerequisites. Confirm you have Opencode 2.1.2 or newer, Node.js 20 or newer, and a Google account with Antigravity access.
- 2Add the plugin. Add opencode-antigravity-auth@2.1.2 to the plugins array in ~/.config/opencode/opencode.json.
- 3Log in to Google. Run opencode auth login google and choose Google OAuth (Antigravity).
- 4List models. Run opencode models to see the models your enabled accounts can use.
- 5Run a prompt. Use opencode run with an antigravity-* model name and your prompt.
- 6Manage accounts. Open /antigravity or /ag inside Opencode to switch accounts and check quotas.
What you need before you install
The plugin only works inside Opencode, so you need Opencode installed first. The README requires OpenCode 2.1.2 or newer and Node.js 20 or newer.
You also need a Google account with Antigravity access. The README says availability of models depends on your Google plan.
- OpenCode 2.1.2 or newer
- Node.js 20 or newer
- A Google account with Antigravity access
Install the plugin in your Opencode config
The plugin is installed by adding it to your Opencode config file, not by running a shell command. Open ~/.config/opencode/opencode.json and add the plugin entry shown below. The README pins the version as 2.1.2 in this example.
To use a local checkout instead of the published package, the README says to run npm ci and npm run build, then replace the package name with the checkout's absolute path.
- Config file location: ~/.config/opencode/opencode.json
- The $schema line is part of the example in the README
{
"$schema": "https://opencode.ai/config.json",
"plugins": ["opencode-antigravity-auth@2.1.2"]
}Log in to Google through Opencode
After adding the plugin, run the login command in your terminal. When prompted, choose Google OAuth (Antigravity). The README says existing accounts are reused, so you do not need to add them again.
Accounts are saved to ~/.config/opencode/antigravity-accounts.json. The README notes this file contains credentials, so back it up before moving to another machine and treat it as sensitive.
opencode auth login googleChoose an Antigravity model and run a prompt
Run opencode models to list the models available to your enabled accounts. Models are cached for an hour, and availability depends on your Google plan.
To use Google OAuth, select a model whose name starts with antigravity-. While Antigravity OAuth is selected, native Google API-key models are hidden. They come back when you switch to an API-key connection.
The README examples below show a plain prompt and a model with a #max suffix.
- Models come from your enabled accounts and are cached for one hour
- Only antigravity-* models are used with Google OAuth
opencode models
opencode run --model=google/antigravity-gemini-3.8-flash-high "Hello"
opencode run --model=google/antigravity-claude-opus-4-6-thinking#max "Hello"Use the /antigravity menu to manage accounts and quotas
Inside Opencode, open /antigravity or its short form /ag. The menu lets you see logged-in accounts, the current selection and cached quota percentages with reset times. You can switch accounts by selecting their row.
The account list shows the lowest cached quota across Claude, Gemini Pro and Gemini Flash. To refresh saved quota data, choose Check quotas / verify enabled accounts. Refresh quotas if an older cache shows a percentage without a reset time.
- See accounts, the current selection and cached quotas with reset times
- Switch to an enabled account by selecting its row
- Check Antigravity and Gemini CLI quotas
- Add an account, or use Manage account… to verify, enable, disable, re-authenticate or delete one
- Refresh the model list
Manage several accounts and check the risks
Disabling an account removes it from rotation and from routine quota checks. Use this to keep an account in the list without using it.
The README says this plugin is unofficial and that Google may restrict accounts that use third-party clients. The source does not promise account safety, so weigh that risk before relying on the plugin for work that cannot be interrupted.
- Disabled accounts are excluded from rotation and routine quota checks
- Google may restrict accounts using third-party clients, according to the README
Development and testing
The README lists these development commands. The runtime test uses synthetic credentials, and authenticated model and menu checks need a logged-in Google account.
The README also says Opencode 1.18.29 or newer remains supported through the legacy entrypoint, where the account menu opens from opencode auth login. Its docs cover V2 migration, configuration and troubleshooting.
- Docs listed in the README: docs/OPENCODE-V2.md, docs/CONFIGURATION.md, docs/TROUBLESHOOTING.md
npm ci
npm run typecheck
npm test
npm run build
OPENCODE_BIN=/path/to/opencode npm run test:e2e:v2What people use it for
- Use Gemini and Claude models from Antigravity inside Opencode with your Google credentials
- Switch between several Google accounts and compare their cached quota and reset times
- Check Antigravity and Gemini CLI quotas before starting a long coding session
- Disable an account temporarily so it is excluded from rotation without deleting it
Frequently asked questions
Is opencode-antigravity-auth free?
The repository is licensed under MIT, which the README states. The source does not list prices. Access to models depends on your Google plan, so check your Google account for what Antigravity access includes.
What are the requirements for opencode-antigravity-auth?
The README requires OpenCode 2.1.2 or newer and Node.js 20 or newer. You also need a Google account with Antigravity access, because model availability depends on your plan.
How do I install opencode-antigravity-auth?
Add opencode-antigravity-auth@2.1.2 to the plugins array in ~/.config/opencode/opencode.json. Then run opencode auth login google and choose Google OAuth (Antigravity).
Where does opencode-antigravity-auth store my login?
Accounts are stored in ~/.config/opencode/antigravity-accounts.json. The README says this file contains credentials, so back it up before moving machines and keep it private.
Is it safe to use opencode-antigravity-auth?
The README calls the plugin unofficial and warns that Google may restrict accounts that use third-party clients. The source does not guarantee account safety, so do not rely on it for work you cannot afford to lose access to.
Why don't I see my Google API-key models?
While Antigravity OAuth is selected, native Google API-key models are hidden, according to the README. They return when you switch to an API-key connection.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use this plugin if you already work in Opencode, have a Google account with Antigravity access, and are comfortable editing a JSON config and running terminal commands. Pick something else if you need guaranteed account safety, do not use Opencode, or cannot meet the OpenCode and Node.js minimums.
Install options & downloads