Preface

DeepSeek Harness (DSH) adopts a plugin-based architecture that allows developers to extend functionality without modifying core code. When developing with OpenCode Go in the Web interface, developers need to pay constant attention to API usage. The usual approach is to open the settings page to check it or rely on external tools, which interrupts the workflow. This plugin aims to solve that problem by mounting the OpenCode Go usage meter directly below the input box, aligned with the input field’s width, ensuring usage status is always visible while writing code.

Plugin Positioning

This is a DeepSeek Harness Web GUI plugin maintained by user xv-chang. It does not depend on the OpenCode CLI tool and works entirely within the DSH runtime environment. The plugin reads OpenCode Go plan usage data and visualizes it as three progress bars persistently displayed below the input box in the chat interface.

Core Features

  1. Persistent display: The plugin registers in the conversation.composer.dock slot (order 10), placed alongside the DSH built-in statistics row, with its width strictly aligned to the input box.
  2. Three usage windows: It displays usage percentages and reset times for rolling (5-hour), weekly, and monthly dimensions.
  3. Health indicator: It shows a dot of different colors based on the usage percentage. Green means <60%, yellow means 60–85%, and red means ≥85%.
  4. Interactive details: On mouse hover, a Tooltip displays the current window’s name, limit, and reset time.
  5. Manual refresh: A small refresh button is provided, allowing users to manually trigger a re-request of usage data.
  6. Silent fallback: When the opencode-go provider is not configured or no API Key is found, the entire component is not rendered, avoiding UI noise; only network, HTTP, or parsing errors display an error row and a retry button.
  7. Internationalization: It supports Chinese and English, and the UI language follows DSH settings.

Installation and Activation

Installing this plugin requires the web profile.

dsh plugin --profile web add github:xv-chang/dsh-opencode-go-usage-dock

After installation, restart the dsh web process so that the Host-side and server-side client bundle take effect. The plugin automatically tries to register as a profile layer during installation (version 0.1.2+ required).

Configuration and Typical Usage

Before use, ensure the OpenCode Go endpoint has been configured in DSH.

  1. Add provider: In DSH settings, find the “Models” option and add the opencode-go provider.
  2. Configure API Key: Configure a valid OpenCode Go API Key in the credential store (usually in the format sk-opencode-…).
  3. Open a session: The plugin slot is session-scoped, so you must first open any chat session before the usage bar appears.
  4. Adjust configuration (optional): If the default endpoint or timeout does not meet your needs, you can modify them in the plugin configuration.
- id: opencode-go-usage-dock
  name: dsh-opencode-go-usage-dock
  config:
    baseUrl: https://opencode.ai/zen/go/v1/usage   # 默认值
    timeoutMs: 15000                               # 默认值

Notes

  • pnpm warning: pnpm peer dependency warnings may appear during installation (such as missing react or @deepseek-ai/*). This is normal and can be ignored. These dependencies are provided by the DSH runtime.
  • 401 error: If you see “API Key is invalid or expired (401)”, it means the API Key is incorrect or expired. Reissue it in the OpenCode dashboard and update the credential.
  • Limit reference: The limit numbers shown in the Tooltip follow the OpenCode Go plan and are for reference only; the API response itself does not include limit data.
  • No CLI dependency: This plugin is a DSH feature and does not read any OpenCode CLI configuration files or local credentials.

Conclusion

By moving usage monitoring below the input field, this plugin provides immediate control over OpenCode Go plan usage and reduces the cost of switching pages. For more plugin details or source code, visit the GitHub repository.