Introduction¶
opencode-usage is a DSH bundle plugin. It places the rolling/weekly/monthly quota usage rates and reset times into the composer dock of the dsh Web UI, allowing the quota information to be viewed directly in the session interface.
What is it¶
opencode-usage is maintained by AmaTsumeAkira and is licensed under the MIT License. It follows the dsh bundle format. Its core goal is to display the OpenCode Go quota badge in the dsh Web UI, including usage rates for the three quota windows, reset countdown, last fetch time, and refresh status.
Core Features¶
- Display the rolling/weekly/monthly quota windows in color-coded percentages in the composer dock and show the reset countdown.
- Display the last fetch time (
updated M/D HH:mm), and showupdating…while refreshing. - Click the OpenCode Go badge to manually refresh the quota.
- Auto-refresh every 5 minutes.
- The API key is parsed only within the harness process via the credentials service and passed to curl via environment variables; it is not serialized to the browser or logs.
Installation and Usage¶
The plugin package is pre-built artifacts; lib/ has been committed to the repository, and there are no install scripts, so git installation does not require the pnpm allowBuilds grant.
Install from GitHub:
dsh plugin --profile web add github:AmaTsumeAkira/opencode-usage
You can also install from a local directory:
dsh plugin --profile web add ./opencode-usage
Uninstall the plugin:
dsh plugin --profile web remove opencode-usage
Typical Usage¶
The plugin requires the OPENCODE_GO_API_KEY to be configured. It can be provided via environment variable or ~/.dsh/.credentials.yaml:
# ~/.dsh/.credentials.yaml
OPENCODE_GO_API_KEY: your-opencode-go-api-key
Once configured, the OpenCode Go badge in the composer dock will display the quota information. If the API key is not configured, the badge displays “Fetch failed”.
There are two ways to refresh:
- Wait for the automatic refresh every 5 minutes;
- Manually refresh by clicking the OpenCode Go badge.
Use Cases and Notes¶
- Suitable for users who want to view the OpenCode Go quota usage rates, reset times, and refresh status directly in the dsh Web UI.
- The
OPENCODE_GO_API_KEYmust be configured before use. - The plugin runs with the current dsh process permissions; check the source code and license before installing.
- The plugin parses the key via the credentials service and does not expose it to the browser or logs; however, credentials should still be managed according to environment requirements.
Links¶
GitHub: https://github.com/AmaTsumeAkira/opencode-usage