Skip to content

[feature]: Add Command Code GOAT quota provider with 5-hour, weekly, and monthly usage limits #250

Description

Pre-flight checks

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

OpenCode version reviewed

1.18.1

Problem statement

Command Code GOAT provides usage limits across multiple quota windows, including 5-hour, weekly, and monthly limits.

Currently, opencode-quota does not support Command Code GOAT as a quota provider, so users who use Command Code models through OpenCode cannot see their remaining GOAT quota together with other providers in the OpenCode TUI.

Command Code already exposes these usage windows in its own interface, for example:

  • 5-hour limit
  • Weekly limit
  • Monthly limit
  • Usage percentage / remaining percentage
  • Reset time for each applicable window

It would be useful for opencode-quota to retrieve and display these limits in the same way it already handles quota information from other supported providers.

The main use case is to monitor Command Code GOAT quota directly inside OpenCode without having to switch to the Command Code UI just to check remaining usage.

Proposed change

Add Command Code GOAT as a supported quota provider.

At minimum, the provider should:

  • Detect or authenticate an existing Command Code account/session using the same safe credential-handling approach as other opencode-quota providers.
  • Retrieve the current Command Code GOAT usage limits.
  • Parse the available quota windows:
    • 5-hour limit
    • Weekly limit
    • Monthly limit
  • Display used or remaining percentage for each window.
  • Display reset time when that information is available.
  • Support the existing opencode-quota presentation mechanisms, including /quota, the sidebar quota panel, and compact TUI status where applicable.

For example, a compact representation could look like:

Command Code: 5h 0% | W 0% | M 26%

or, when configured to display remaining quota:

Command Code: 5h 100% | W 100% | M 74%

Ideally this should be implemented as a normal provider adapter so that it follows the existing opencode-quota architecture and does not require special handling elsewhere in the UI.

Alternatives considered

I considered monitoring Command Code GOAT usage separately through the Command Code UI or through an external script/tool.

However, both approaches require maintaining a separate quota view outside OpenCode and do not integrate with the existing opencode-quota UI, such as /quota, the sidebar panel, or compact TUI status.

A custom local patch to opencode-quota could also add this provider, but native upstream support would be preferable because it could reuse the existing provider abstraction, authentication handling, caching, refresh logic, and quota-window rendering.

For these reasons, adding Command Code GOAT as a first-class quota provider in opencode-quota seems like the most maintainable solution.

Thank you for your consideration.

Acceptance criteria

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions