opencode-gemini-oauth
v1.1.4
Published
OpenCode plugin for Google Gemini OAuth authentication (Antigravity)
Maintainers
Readme
opencode-gemini-oauth
OpenCode plugin for Google Gemini authentication via OAuth. Use your Google AI Pro subscription quota without API billing.
Features
- OAuth PKCE authentication with Google
- Automatic token refresh
- Request interception and transformation for Antigravity/Code Assist API
- Token storage with secure local file
Installation
Add to your opencode.json:
{
"plugins": ["opencode-gemini-oauth@latest"]
}Or use the local path for development:
{
"plugins": ["D:\\git\\opencode-gemini-oauth"]
}Configuration
In your opencode.json, configure the Google provider:
{
"provider": {
"google": {
"npm": "opencode-gemini-oauth"
}
}
}Usage
- Start OpenCode
- Select "OAuth with Google (Gemini)" authentication method
- Complete the OAuth flow in your browser
- Your Google AI Pro quota will be used for requests
Supported Models
gemini-2.5-progemini-2.5-flashgemini-2.0-flash- And other Gemini models available through your subscription
How It Works
This plugin:
- Authenticates via Google OAuth using PKCE flow
- Stores refresh tokens locally in
%APPDATA%/opencode/gemini-oauth-accounts.json - Intercepts API requests to
generativelanguage.googleapis.com - Transforms them to use the Code Assist endpoint with your OAuth token
- Automatically refreshes expired tokens
Credits
Based on the Antigravity OAuth flow used by Google's AI Studio and Cloud Code extensions.
License
MIT
