dsh-opencodego-status
开发工具 活跃维护

dsh-opencodego-status

Assidefok/dsh-opencodego-status

实时展示OpenCode Go最近5小时、每周与每月的使用时长,以轻量覆盖层悬浮呈现。无需切换窗口即可掌握编码时间投入,数据自动更新,界面简洁,方便快速洞察短中长期工时节奏。

0
Stars 标星
0
Forks 分支
0
Watchers 关注
0
Open Issues
JavaScript
主要语言
MIT
开源协议
15 KB
仓库大小
1 个月前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:Assidefok/dsh-opencodego-status
git clone https://github.com/Assidefok/dsh-opencodego-status.git
git clone git@github.com:Assidefok/dsh-opencodego-status.git
README.md main

dsh-opencodego-status

A floating overlay for the DeepSeek Harness Web UI that shows your OpenCode Go
usage — the 5-hour rolling limit, the weekly limit and the monthly limit — at a glance.

OpenCode Go usage overlay, collapsed pill

The collapsed pill lives in the corner of the window and shows the three percentages
with a colour dot per limit. Click it for progress bars, reset countdowns, the renewal
date, and the sign-in controls.

OpenCode Go usage overlay, expanded card

What you get

  • Collapsed pill — 5h · 7d · 30d percentages, coloured by how close you are to the
    limit (brand → warning from 60% → error from 80%), plus the weekly reset countdown.
  • Expanded card — one progress bar per limit, resets in and renews in countdowns,
    Refresh, Sign out, and a link to the OpenCode console.
  • Device-code sign-in — connect from the overlay; the code is shown in the card and
    approved in the browser. No password is ever typed into the overlay.
  • Silent token refresh — the stored session is refreshed before it expires.
  • English and Chinese UI, following the Harness locale service.
  • Theme-aware — every colour and border comes from the Harness theme tokens, so light
    and dark themes both look native.

The numbers come from the OpenCode Console Go subscription meters, the same source the
console page itself renders.

Requirements

  • DeepSeek Harness Web UI (0.2.x).
  • An OpenCode Go subscription. The overlay reads the Go plan meters; it shows
    Not connected when no OpenCode session is stored, and an error state when the
    subscription is missing or the API changes.

Install

dsh plugin --profile web add github:Assidefok/dsh-opencodego-status

Then refresh the Harness Web UI. A small pill appears in the top-right corner.

Connect

  1. Click the pill, then Connect.
  2. The card shows a short code (for example GNNM-XQHS) and an Open approval page
    button. Approve the device in the browser.
  3. The overlay switches to your live usage as soon as the console confirms.

The session is stored locally at $DSH_HOME/opencodego-status/state.json with 0600
permissions ($DSH_HOME defaults to ~/.dsh). Sign out in the card deletes it.
Tokens are sent only to opencode.ai; the browser half never receives them.

Configuration

The bundle row in the Harness profile's cordis.patch.yml accepts:

- id: opencodego-status
  name: dsh-opencodego-status
  config:
    enabled: true        # hide the overlay without uninstalling the bundle
    position: top-right  # top-right | top-left | bottom-right | bottom-left
    refreshSeconds: 60   # 15 – 3600
    showResets: true     # show reset countdowns

How it works

  • The host half (index.js) registers a prefix route at
    /api/opencodego-status and talks to the OpenCode Console:
    <origin>/console/auth/device/code, <origin>/console/auth/device/token (device
    grant and refresh grant) and <origin>/console/api/go/status.
  • The client half (client.js) registers one entry in the shell.overlay slot and
    polls /api/opencodego-status/status. It never sees an access token.
  • No dependencies, no build step: the client module is plain JavaScript and React comes
    from the Harness browser module table.

The console endpoint is not a documented public API. If OpenCode changes it, the
overlay degrades to an error state with a Retry button instead of breaking the UI.

License

MIT — see LICENSE.