This plugin adds Gemini CLI upstream provider support to CLIProxyAPI through the native plugin ABI. It does not restore the host-side /v1internal:generateContent or /v1internal:streamGenerateContent inbound routes; those endpoints are used only as upstream Cloud Code API targets.
- Parses
geminiandgemini-cliauth storage files. - Expands one physical auth file into multiple virtual auths when
project_idscontains more than one Google Cloud project. - Supports host Web OAuth through the host
/v0/management/oauth-callbackflow. - Supports command-line login through
--geminicli-login. - After a successful OAuth login, automatically enables the Gemini Code Assist
EXPERIMENTALrelease channel for saved project IDs so preview models are available. - Executes generate, stream, and token count requests through the host HTTP client when the host invokes the executor.
- Translates OpenAI, Responses, Claude, Gemini, and Codex payloads to the Gemini CLI provider envelope.
- Applies Gemini CLI thinking config under
request.generationConfig.thinkingConfig.
--geminicli-login: starts an interactive Gemini CLI login.--geminicli-project-id: sets the preferred project for the saved auth.
Use the host --no-browser flag to skip opening the browser automatically during command-line login. After opening the login URL, the command can accept a pasted callback URL when the local HTTP callback is unavailable. OAuth login saves a single physical auth file; multiple projects are kept in project_ids and expanded as virtual auths when the file is loaded. After login finalization, the plugin best-effort configures each project for the EXPERIMENTAL release channel via the Cloud AI Companion API (releaseChannelSettings + settingBindings). Login still succeeds if that configuration call fails. OAuth login timeout and polling interval are fixed in code. Proxy handling comes from the host configuration; the plugin has no plugin-specific proxy option.
The plugin stores provider-owned auth JSON with type: "gemini-cli". A single physical storage file can include:
{
"type": "gemini-cli",
"email": "user@example.com",
"project_id": "primary-project",
"project_ids": ["primary-project", "secondary-project"],
"access_token": "access-token",
"refresh_token": "refresh-token"
}The first auth is the physical auth. Additional projects are exposed as virtual auths with metadata.virtual=true, metadata.parent_auth_id, attributes.project_id, and attributes.runtime_only=true.
The executor targets the Cloud Code upstream endpoints:
POST https://cloudcode-pa.googleapis.com/v1internal:generateContentPOST https://cloudcode-pa.googleapis.com/v1internal:streamGenerateContent?alt=ssePOST https://cloudcode-pa.googleapis.com/v1internal:countTokens
The plugin injects Authorization, User-Agent, and X-Goog-Api-Client headers before dispatching through the host HTTP client.
This project is licensed under the MIT License.
Copyright (c) 2026.6-present Router-For.ME