DeepSeek Harness Plugin

ShallBay/dsh-token-stats

Category Usage & Billing Added 2026-10-21

Token usage dashboard for the whole harness: billed tokens from every session are rolled up per session and turn (uncached input, cache read, cache write and output) with a peak/off-peak CNY cost estimate, and a "Token 用量" entry above Settings in the sidebar opens the dashboard at /token-stats, in a new tab on the web and in an in-app popup on the Desktop. The page recollects and repaints every 60 seconds while the tab is visible. Usage is read from the same session event stream dsh-token-meter consumes, accepting 0.1.x assistant/chunk and 0.2.x assistant/message and assistant/attempt, and counting an attempt repeated after an llm retry as its own billed call; cold history is seeded once from a persisted rollup file and afterwards only logs whose mtime or size changed are re-parsed. Host half and client half ship in the one package.

Install

# from a prebuilt release tarball

dsh plugin --profile web add "https://github.com/ShallBay/dsh-token-stats/releases/latest/download/dsh-token-stats.tgz"

# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)

dsh plugin --profile web add github:ShallBay/dsh-token-stats

Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).

Links

More in this category

View the whole category →

Community comments

Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.