@mcd0luo/dsh-opencode-statusline
v0.3.0
Published
OpenCode Go statusline for dsh web: context usage, Go subscription usage, working directory
Maintainers
Readme
@mcd0luo/dsh-opencode-statusline
Claude Code style statusline for dsh web UI.
Shows a status block at the bottom of the web app's sidebar:
- 目录 — current session's working directory
- 上下文 — context-window usage bar (from dsh's
contextPressuresession projection) - Go 用量 — OpenCode Go subscription usage (rolling / weekly / monthly, colored bars + reset countdown)

The Go usage is fetched server-side from the OpenCode Go API; the API key is read
from the dsh credentials service (OPENCODE_API_KEY), never exposed to the browser.
Install
Requires dsh and an OpenCode Go subscription.
本包是 Celestea 系列成员,由基座 @mcd0luo/dsh-celestea 的 bundle 统一挂载
(基座补丁给每个成员预留带条件的挂载行,本包装进 profile 后下次启动自动启用)。
基座必须显式安装一次(dsh plugin 只把直接依赖挂进 bundles):
# 1. 一次性:安装基座(设置中心 + 系列挂载点)
dsh plugin --profile web add @mcd0luo/dsh-celestea
# 2. 安装本包,重启后自动挂载
dsh plugin --profile web add @mcd0luo/dsh-opencode-statusline0.3.0 之前的老版本需要手动两步:装依赖后在
~/.dsh/profiles/web/cordis.patch.yml添加 statusline 行(并手写 config); 0.3.0+ 不要再手写这行,否则 loader 会报duplicate loader entry id。
Store your Go API key with the credentials service (the web Models page writes it,
or add OPENCODE_API_KEY: sk-... to ~/.dsh/.credentials.yaml).
Restart dsh web and hard-refresh the browser (Ctrl+Shift+R). The status block
appears at the bottom of the sidebar (expand the sidebar if collapsed).
Configuration
0.3.0+ 的配置接入 Celestea 设置中心:设置 → Celestea → statusline(表单
编辑、实时生效、顶部显示"当前生效"——/api/statusline/status)。
| key | type | default | description |
|---|---|---|---|
| usageUrl | url | https://opencode.ai/zen/go/v1/usage | OpenCode Go usage endpoint |
| apiKeyEnv | string | OPENCODE_API_KEY | credential name resolved through the dsh credentials service |
| cacheTtlMs | int | 60000 | how long a usage response is cached server-side |
| fetchTimeoutMs | int | 2500 | upstream request timeout |
Build
npm run buildlib/client.js (the browser bundle) is generated from src/client.js; lib/index.js
(the host plugin) is copied from src/index.js.
Compatibility
Tested with @deepseek-ai/dsh 0.1.0-rc.6. The client registers into the
sidebar.footer.action slot and reads the contextPressure session projection;
both are internal dsh web contracts and may change in future releases.
