You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Summary
Add support for authenticating with Gemini using the same OAuth login flow as the official Gemini CLI. This
enables users to authenticate with their Google account directly, matching the experience provided by gemini-cli.
Problem
Currently, Gemini authentication in OpenCode requires manual API key configuration. The official Gemini CLI
uses an OAuth flow that provides a smoother user experience with browser-based Google account login.
Proposed Solution
Integrate the Gemini CLI OAuth flow into OpenCode's plugin system:
Implement PKCE-based OAuth flow for secure authentication
Handle token exchange and refresh automatically
Cache access tokens with proper expiry handling
Support both interactive (browser) and headless authentication modes
Manage GCP project context for API requests
Implementation
The implementation adds a new gemini plugin under packages/opencode/src/plugin/gemini/ with:
oauth.ts - OAuth authorization and token exchange
token.ts - Token refresh logic
cache.ts - Access token caching
auth.ts - Auth state helpers
project.ts - GCP project management
request.ts / request-helpers.ts - Authenticated API requests
server.ts - Local callback server for OAuth redirect
index.ts - Plugin entry point
Verification
Test OAuth flow in browser-enabled environment
Test token refresh after expiry
Verify API requests work with obtained credentials
Activity
github-actions commentedon Jan 12, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if your specific case addresses something different.
thdxr commentedon Mar 25, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.