opencode-quota icon indicating copy to clipboard operation
opencode-quota copied to clipboard

[feature]: Gemini CLI integration

Open capyBearista opened this issue 7 months ago • 4 comments

Pre-flight checks

  • [x] I searched existing issues and did not find a duplicate request.
  • [x] I reviewed current behavior on the production released OpenCode version.

OpenCode version reviewed

1.14.25

Problem statement

There is currently no way to review usage of the Gemini CLI plans (this is different from Google Antigravity).

Proposed change

I propose the possible integration of Gemini CLI usage tracking after the user has linked their account via the opencode-gemini-auth plugin (https://github.com/jenslys/opencode-gemini-auth), which uses the opencode auth login flow and captures OAuth from Google.

For context, usage of Gemini CLI models is split across three buckets, irrespective of model series: pro, flash, and flash-preview. Consequently, using gemini-3.1-pro-preview will also cut into available usage for gemini-2.5-pro.

opencode-gemini-auth offers a command (/gquota) that prompts the agent to use a plugin-added tool, gemini_quota, to output model usage. It would be neat to have the three buckets displayed using opencode-quota instead of requiring a tool be available 24/7.

Image

For reference: Gemini CLI plans

Alternatives considered

No response

Acceptance criteria

  • [ ] opencode-quota sidebar displays information about at least one of the bucket's usage
  • [ ] opencode-quota notification displays information about at least one of the bucket's usage
  • [ ] opencode-quota Gemini CLI integration only requires one additional plugin: opencode-gemini-auth
  • [ ] opencode-quota detects Gemini CLI integration by adding google-gemini-cli to enabledProviders array

capyBearista avatar Apr 25 '26 18:04 capyBearista

@capyBearista Thanks for suggestion, I'm assuming this lets people use the "bundled" api credits if they already have a Google AI plan?

slkiser avatar Apr 25 '26 21:04 slkiser

@slkiser Yup! Although I believe it's usable even with the free tier. Gemini CLI offers pretty generous model usage as long as you sign in with your Google account.

capyBearista avatar Apr 25 '26 22:04 capyBearista

Added in v3.3.0, please comment if it doesn't work. Also thanks for letting me know about Gemini CLI (google has way too many soon to be killed off products).

slkiser avatar Apr 26 '26 01:04 slkiser

It really does, but hopefully this one lives on for a little longer lol.

That was so fast! By the way, may I suggest a change to how the usage buckets are shown?

Current state looks like:

Image

It seems like some models are being repeated. Since models' usage capacities are strictly grouped by their "quality" (e.g. Gemini 3.1 Pro usage also consumes Gemini 2.5 Pro capacity while Gemini 3 Flash usage also consumes Gemini 2.5 Flash capacity), I think it would be cleaner if the quota window displayed the bars like this:

Image

I just created a PR #61 for this.

capyBearista avatar Apr 26 '26 20:04 capyBearista