Introduction

When using the OpenCode Go plan to run tasks, checking how much quota is left and when it resets usually requires leaving the current interface to check elsewhere. One check isn’t enough; you also have to remember the time of the last check to estimate consumption, and if you aren’t careful, you might hit the limit.

dsh-opg-usage solves this problem by embedding the quota panel directly into the DSH interface, keeping a persistent floating capsule so you can refresh it as you watch. Below is an introduction to its features, installation, and usage.

What is it

dsh-opg-usage is a DSH Web plugin maintained by M4sh1r0-444 under the MIT license. It is a draggable, collapsible floating capsule displaying the usage percentage, remaining percentage, and reset countdown for the OpenCode Go plan across three quota windows: rolling window, this week, and this month.

The plugin is split into two halves: the Host side registers a local API route to read credentials, request the OpenCode official quota interface, and return normalized JSON; the Client side registers to the Web client’s shell.overlay slot, polls the route, and renders the capsule.

Core Features

The capabilities provided by the plugin are listed below (all documented in the README):

  1. A floating capsule in the top-right corner, defaulting to Go · Week X% · Month Y%, uses green/yellow/red dots to indicate quota health—turning yellow if used over 50%, and red if over 80%.

  2. Click the capsule to expand the full panel, where you can see the used/remaining percentages, progress bars, status badges, and reset countdowns for the three windows.

  3. Hold the capsule or panel title bar to drag it freely; the position is automatically constrained within the viewport and won’t be dragged off-screen.

  4. Refreshes automatically every 60 seconds, but also supports manual refresh via the ⟳ button; if there is a connection error, it shows the specific reason and allows retry.

  5. The panel floats above all interfaces, including the expanded right panel of better-sidebar—the shell.overlay layer it registers has been elevated.

  6. Adapts to light/dark themes using DSH theme tokens; no manual color switching is required.

Installation and Enablement

This plugin doesn’t have commands like dsh plugin add; installation is done by manually editing the DSH web profile’s package.json, adding the GitHub dependency, and registering the bundles:

{
  "dependencies": {
    "dsh-opg-usage": "github:M4sh1r0-444/dsh-opg-usage"
  },
  "dsh": {
    "profile": {
      "bundles": [ "...", "dsh-opg-usage" ]
    }
  }
}

The file path is ~/.dsh/profiles/<name>/package.json, where <name> should be replaced with your profile name.

Then, run the installation and restart:

cd ~/.dsh/profiles/<name>
pnpm install
# Restart DSH

The plugin will automatically mount the host side and connect to the Web client without further configuration. The current version is 0.1.0, requiring Node >= 18. The plugin is pure JavaScript with no build steps and no third-party runtime dependencies; the host side only uses the built-in Node fetch.

Typical Usage

After installation and restart, daily operations consist of just a few actions:

  • Capsule: Click to expand/collapse; hold to drag and adjust position.
  • Panel: Click ⟳ for manual refresh; click “Collapse” to fold back into the capsule.

Data comes from the OpenCode official quota interface https://opencode.ai/zen/go/v1/usage. Regarding credentials, the plugin automatically reads the opencode-go entry (API key starting with sk-) from ~/.local/share/opencode/auth.json, and no manual configuration is needed.

The three windows seen after expanding the panel correspond to the rolling / weekly / monthly fields returned by the Host side, each window containing percent, remaining, and resetsAt.

Use Cases and Notes

Suitable for users who use both DSH and the OpenCode Go plan and want to monitor quota availability without leaving the interface while running tasks. If you need to decide task pacing when quota is tight, the resident capsule plus 60-second auto-refresh is generally sufficient.

Before installation, there are a few points to confirm:

  1. The plugin runs with the current dsh process permissions and will read local auth.json and make requests to opencode.ai. Before installation, it is recommended to review the repository source code to ensure the behavior meets expectations. The license is MIT, clearly stated in both README and package.json.

  2. Regarding privacy, the README states that all requests are completed locally: the Host process requests opencode.ai directly without passing through any third party; the API key is only used to request the OpenCode official interface and is not logged or uploaded.

  3. The plugin relies on the shell.overlay slot. When used alongside better-sidebar on the same screen, the layer is elevated so the panel won’t be obscured.

Conclusion

dsh-opg-usage focuses on a specific task: turning OpenCode Go quota data into a persistent, draggable, auto-refreshing interface element; installation only requires editing a single profile file. If you are using this plan, it is worth a try.

  • GitHub Repository: https://github.com/M4sh1r0-444/dsh-opg-usage
  • Community Directory Page: https://www.skillhub.cn/plugins/M4sh1r0-444/dsh-opg-usage

Please note that the community directory is an independent site and has no official affiliation with DeepSeek / Hypersphere.