설치
npx -y @deepseek-ai/dsh plugin --profile web add github:markzhang12345/dsh-opencode-go-usage이 설치 명령은 GitHub 저장소 주소에서 생성된 확인되지 않은 시작점입니다.
README
유지 관리자가 작성한 문서 스냅샷입니다.
dsh-opencode-go-usage
A DeepSeek Harness web plugin that shows your OpenCode Go coding-plan usage as a live, number-only readout in the chat composer dock — OpenCode Go 5h 39% Weekly 15% Monthly 13% — refreshed every 60 seconds. It auto-enables per session: each session's widget renders only while that session's model provider is opencode-go, and hides otherwise.
Features
- Live readout in the chat composer dock band (
conversation.composer.dock): 5h rolling / weekly / monthly percentages with reset times on hover - Refreshes every 60s
- Auto-enabled per session: each chat session's widget shows only when that session's model provider is
opencode-go(independent across concurrent sessions) - No progress bars, plain numbers only
Install
In your dsh profile (here web):
dsh plugin --profile web add <this-repo-uri-or-file-path>
Add the plugin row to your profile's patch layer ($DSH_HOME/profiles/web/cordis.patch.yml):
- insert:
- id: opencode-go-usage
name: 'dsh-opencode-go-usage'
Restart dsh web so the host half and the served client bundle are picked up.
Configuration
Host-side tunables live on the plugin row in cordis.yml:
- id: opencode-go-usage
name: dsh-opencode-go-usage
config:
baseUrl: https://opencode.ai/zen/go/v1/usage # default
timeoutMs: 15000 # default
| Key | Default | Meaning |
|---|---|---|
baseUrl | https://opencode.ai/zen/go/v1/usage | The usage endpoint. |
timeoutMs | 15000 | Fetch timeout in milliseconds. |
The usage endpoint
GET https://opencode.ai/zen/go/v1/usage
Authorization: Bearer <API_KEY>
<API_KEY> is the Anthropic-compatible OpenCode Go key (sk-opencode-…). The endpoint returns:
{
"usage": {
"rolling": { "status": "ok", "percent": 39, "resetsAt": "2026-08-17T12:30:33.430Z" },
"weekly": { "status": "ok", "percent": 15, "resetsAt": "2026-08-24T00:00:00.430Z" },
"monthly": { "status": "ok", "percent": 13, "resetsAt": "2026-09-01T04:14:25.430Z" }
}
}
percent is 0–100; resetsAt is ISO-8601. The endpoint is not yet in OpenCode's public docs.
API key resolution order
- DSH credentials seam / environment
OPENCODE_GO_API_KEY— also what the models page fills in (deriveKeyRef("opencode-go")), so no extra setup is needed when opencode-go is added under Settings → Models. - OpenCode
~/.local/share/opencode/auth.json→ theopencode-goentry (fallbackopencode) withtype: "api".
How it works
A dual-face plugin. The host half publishes the opencodeUsage Typert Remote service (it only resolves the key and fetches the session-agnostic usage data); the client bundle mounts it and renders the dock readout over the /api RPC carrier. Per-session visibility is decided on the client: each dock widget reads its own session's model directory (ctx.modelDirectories) and hides unless that session's provider is opencode-go.
| File | Role |
|---|---|
index.js | Host half — OpencodeUsageGateway (TypertRemoteService, service key opencodeUsage) |
typert.host.js | Hand-written Typert host manifest, registered via exports["./typert"] |
client.js | Browser bundle in window.__ModuleLoader__.load format — mounts the Remote, registers the dock entry, renders the readout |
Development
The plugin is plain ESM, no build step. Host files import @deepseek-ai/* peers; the client bundle is hand-written in the lazy-CJS format the harness client loader serves under /plugins.
Known limitations
- The usage endpoint is undocumented and may change; parsing is defensive and non-200 responses surface as a friendly status rather than a crash.
- Quota limits / reset times come from the response; endpoint drift is handled gracefully.
- The dock widget is hidden entirely while the current provider is not
opencode-go(no placeholder line).
License
MIT
저장소 정보
- 언어
- JavaScript
- 라이선스
- MIT
- 마지막 업데이트
- 2026. 8. 17. PM 3:01
신중하게 설치하기
소스 코드, 권한, 수명 주기 스크립트, 의존성 및 네트워크 접근을 검토하고 신뢰하지 않는 플러그인은 격리 환경에서 테스트하세요.