DeepSeek Harness (DSH) is a plugin-based platform that lets you extend functionality by combining packages. If you are using OpenCode Go and need to monitor remaining quota for rolling 5 hours, weekly, and monthly, the dsh-opencode-go-quota plugin can automatically fetch usage dashboard data, display the remaining percentage as a game-like health bar beside the conversation input box, and provide a full card view in Settings.
This plugin is maintained by weijianguizhou and follows the MIT License.
Core Features¶
The plugin provides the following capabilities:
* Real-time quota display: Fetches and parses the OpenCode Go usage dashboard and displays the remaining percentage.
* Conversation HUD: Shows three quota levels (5h / Week / Month) as health bars below the conversation input box. Hover to view the reset countdown.
* Settings card: Provides a full progress bar display in “Settings → Plugin Configuration”.
* Manual refresh: Click the button to immediately trigger data fetching without a restart.
* Auto refresh: Automatically fetches and parses data at the configured interval.
Installation and Enabling¶
The installation process requires you to specify the name of the DSH profile you are using (such as web, desktop, or tui).
- Open a terminal and run the installation command:
dsh plugin --profile web add https://github.com/weijianguizhou/dsh-opencode-go-quota
> Replace `web` with your actual profile name.
- After installation, DSH will append this combination package to the configuration of that profile. Once the installation steps are complete, you need to restart the corresponding profile to load the plugin.
Configuration¶
Credentials are stored locally only. The plugin reads the configuration file first and falls back to environment variables when configuration values are missing.
1. Configuration File (Recommended)¶
Insert the following content into your profile’s cordis.patch.yml file:
- insert:
- id: opencode-go-quota
name: dsh-opencode-go-quota
config:
workspaceId: '你的workspaceId'
authCookie: '你的browser-auth-cookie'
timeoutMs: 10000
refreshMinutes: 5
2. Environment Variables (Fallback)¶
If credentials are not provided in the configuration file, the plugin attempts to read the following environment variables:
export OPENCODE_GO_WORKSPACE_ID=...
export OPENCODE_GO_AUTH_COOKIE=...
authCookie is marked as sensitive inside the plugin and will not appear in any logs or responses.
Obtaining Credentials¶
authCookie is HttpOnly and may be stored with browser App-Bound Encryption, so it cannot be extracted automatically by script and must be obtained manually.
- Log in to opencode.ai using a browser.
- Go to the Go usage page (the page where Rolling / Weekly / Monthly are visible).
- Press F12 to open Developer Tools, switch to the Network tab, and refresh the page.
- Click the first
opencode.aidocument request in the list (Type isdocument). - On the right, find the
Cookieline under Headers → Request Headers. - Copy the entire string after
auth=.
Get workspaceId: Check the dashboard URL, which has the format https://opencode.ai/workspace/<this part>/go. The middle segment is the workspaceId.
Note: Cookies are usually valid for about 90 days. You need to obtain a new one after expiration.
Additional Desktop Steps (Important)¶
In DSH Desktop (not the Web service), the settings namespace must be explicitly added to the allowlist to be read by the frontend. Otherwise, the HUD and card will not be displayed.
- Find the file in the desktop installation directory:
<DSH Desktop>/resources/app.asar.unpacked/node_modules/@deepseek-ai/dsh-host-apiproxy/lib/index.js
- In that file, find the
WEB_SETTINGS_NAMESPACESarray and add"opencode-go-quota":
const WEB_SETTINGS_NAMESPACES = [
"agent-loop",
"shell",
"locale",
"permission",
"ui-conversation",
"ui-theme",
"web-search-deepseek",
"opencode-go-quota", // <-- 添加这一行
];
- Save and restart DSH Desktop.
Note: Desktop updates overwrite the
app.asar.unpackeddirectory, so this patch must be reapplied after each update.
Verify That It Is Working¶
After installation and configuration, restart DSH and enter the conversation interface:
- HUD: A row of
OpenCode Gohealth bars should appear below the input box. - Settings card: Go to “Settings → Plugin Configuration”. You should see the “OpenCode Go Remaining Quota” card.
If it displays “Not configured”, the credentials are not filled in correctly. If it displays “Load failed”, the Cookie is likely expired or the dashboard structure has changed.
Development and Build¶
DSH plugins require that ./client exports a prebuilt bundle (in the form of window.__ModuleLoader__.load). The lib/client.js in the repository is already committed. If you modify the source code, rebuild:
npm install
npm run build
npm run check
npm test
Use Cases and Notes¶
- Use cases: You need to check OpenCode Go remaining quotas frequently and want to monitor usage without leaving the conversation interface.
- Notes: The plugin runs with the permissions of the current DSH process. It is recommended to review the source code before installing. Desktop users must complete the allowlist configuration step.
For more details and source code, visit the GitHub repository.