Settings usage dashboard: tokens, requests, output tokens, and cache-hit rate from session logs, with a stacked chart and a breakdown table by provider, model, or workspace.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:NOirBRight/dsh-usage-monitor
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).
README
English | 中文
Usage dashboard for DeepSeek Harness. It folds provider-reported token usage out of session logs and charts it in Settings.
Compatibility
Host DSH peers and development dependencies use the open lower-bound range >=0.1.7-alpha.2. The lockfile resolves DSH 0.1.7-rc.2 packages and Cordis 4.0.4. Optional peers let the plugin remain loadable outside the supported set.
package.json#dsh.compatibility.dshReleases records DSH 0.1.7-alpha.2, 0.1.7-rc.1, and 0.1.7-rc.2 as compatible evidence, not an allowlist. Unknown newer Hosts warn once and keep the normal mount path. Only a reproduced failure is blocklisted.
What it shows
- Tokens, requests, output tokens, and cache-hit rate
- Stacked chart with Metric (token / request), By (provider / model / workspace), Group (day / week)
- Week, month, and custom ranges
- A responsive overview with a full-width token summary, compact secondary metrics, a stacked chart, and token-share cards that follow the current By grouping
- On narrow screens, the cards collapse to one column and the chart legend scrolls horizontally
Escape closes an open Metric, By, or Group menu and restores focus to its trigger. With no menu open, Escape remains available to the Settings dialog.
Subscription quotas are not fetched.
Installation
Host development dependencies resolve to the rc.2 package set; see Compatibility. Install from GitHub:
dsh plugin --profile web add --force https://github.com/NOirBRight/dsh-usage-monitor/releases/latest/download/dsh-usage-monitor-0.2.20.tgz
dsh web
The repository tracks release-ready lib artifacts, so GitHub installation needs no build-script allowlist. A source checkout can use a link installation after running pnpm run build.
Then open Settings → Usage.
Data
Reads live and persisted logs through the public ctx.sessionQuery.readSession API; sessionPersistence.list supplies cache revisions only. The usage RPC uses the authenticated /api/plugin-rpc/usage-monitor Fetch route. It does not inspect private persistence methods or session file paths. Unreadable sessions are omitted; only folded usage aggregates are returned.
Release
pnpm run check runs the full gate in order: unit tests, TypeScript typecheck, deterministic build-parity (clean temp build vs tracked lib/), package build, and a real npm pack + immutable fixtures/rc1-0.1.7 validation + offline install + Host/client import smoke. The pack check reads only the repository-owned 0.1.7-rc.1 manifest/tarballs, verifies the official tag/commit and registry integrity, preserves versioned parent edges, and uses a fresh pnpm consumer with an invalid registry, offline/no-scripts/no-audit/no-fund settings, empty NODE_PATH, and scoped local-tarball overrides; it uses neither --legacy-peer-deps nor omit/force bypasses. The owner archive is written only below the prefixed temporary directory. It does not rewrite lib/ before comparison, so a stale, missing or hand-edited artifact fails.
For a tag, run pnpm run check:strict (the same test, typecheck, parity, build, and pack order with PARITY_CHECK_HEAD=1; it fails if the committed lib/ still differs from the source — the v0.2.5 drift guard). Keep src as the source of truth and commit the rebuilt lib/.
The Settings → Usage nav icon is a DOM patch via ctx.effect + MutationObserver on document.body; see src/client/nav-icon.ts for the ctx.effect disposer and the accepted Alpha.4 DOM risk.
Release installation (Latest)
Session-log usage dashboard with responsive metric cards, charting, and provider shares. The published pack contains built Host/Client files only; it has no sibling-repository source, workstation path, link:, or workspace: dependency. Pack-check uses a frozen DSH 0.1.7-rc.1 graph; the development lockfile resolves DSH dependencies to 0.1.7-rc.2.
Latest installation (the URL never contains a version):
dsh plugin --profile web add --force \
https://github.com/NOirBRight/dsh-usage-monitor/releases/latest/download/dsh-usage-monitor-0.2.20.tgz
Fixed-version installation:
dsh plugin --profile web add --force \
https://github.com/NOirBRight/dsh-usage-monitor/releases/download/v0.2.20/dsh-usage-monitor-0.2.20.tgz
Update, uninstall, and verify:
# Update to the latest Release
dsh plugin --profile web add --force \
https://github.com/NOirBRight/dsh-usage-monitor/releases/latest/download/dsh-usage-monitor-0.2.20.tgz
# Verify the loaded version
dsh plugin --profile web list
# Uninstall only this plugin
dsh plugin --profile web remove dsh-usage-monitor
Configuration: use the plugin section in Settings for Web UI plugins, or the profile dsh.profile.bundles entry for Host-only plugins. Start with this README's minimal YAML/JSON example and provide credentials/backend addresses explicitly.
Rollback: rerun the fixed v0.2.19 command, verify the profile list, then restart the Web service once. Inspect journalctl --user -u dsh-web.service; never put a source checkout in the production profile.
Links
More in this category
bowenliang123/dsh-context★ 1791
DSH context insight panel: Context dashboard + /context command + Context browser — one-stop context lifecycle management with categorized composition, content details, evolution trends, compaction/injection events, and stats.
Han-1413141/dsh-cost-meter★ 361
Per-session and daily API cost, budget with usage %, official balance, history dashboard, and one-click official price sync with peak/off-peak pricing.
wssfk12138/dsh-damage-pulse★ 237
Tracks DeepSeek token usage, per-call and session costs, and account balance with cache-aware charge animations in the DSH Web UI.
zh667/TokenLedger★ 202
Sidebar usage panel that attributes tokens to the relay site that served each request, read from your existing provider config: today/month/all-time totals, per-site and per-model breakdowns, a year activity heatmap, and New API / Sub2API / DeepSeek balances.
Ychris12138/dsh-usage-stats★ 167
Multi-provider usage dashboard with provider/model token breakdowns, calendar drill-downs, account balances, and OpenCode Go / Z.ai subscription quota tracking.
PolinniZhong/dsh-personal-center★ 118
Personal center for DeepSeek Harness: cross-session usage statistics, per-model cost estimation, global custom instructions, a global font-size adjuster, a data-driven desktop pet with bitmap & vector skins, and a conversation status overview, all local and offline.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.