
KeLearns/dsh-token-usage
dsh-token-usage
dsh-token-usage is a community DeepSeek Harness plugin. Read the repository README before installing.
Install
npx @deepseek-ai/dsh plugin --profile web add @kelearns/dsh-token-usageRestart `dsh web` after install. Bundle APIs can change during the developer preview.
README badge
[](https://dshhub.dev/plugins/kelearns-dsh-token-usage)Paste this into your README. The star count updates with every catalog sync.
From the README
Excerpt from KeLearns/dsh-token-usage, cleaned of badges and images.
@kelearns/dsh-token-usage
Token usage heatmap for the DeepSeek Harness (dsh) web GUI — a GitHub-style
contribution graph for daily / weekly / cumulative token consumption, with a
summary bubble, hover details, and activity insights. Mounted through the
official dsh plugin mechanism (dsh plugin add) — no dsh source changes.
A "Token Activity" entry appears in the settings sidebar.
Screenshots
Daily heatmap — dark theme, English (12-month window)
Three views — dark theme, English
| Daily | Weekly | Cumulative |
|---|---|---|
| <img src="screenshots/promo-en-dark-daily.png" width="200" alt="Daily view"> | <img src="screenshots/promo-en-dark-weekly.png" width="200" alt="Weekly view"> | <img src="screenshots/promo-en-dark-cum.png" width="200" alt="Cumulative view"> |
Light theme & Chinese UI
| Light (English) | 深色主题(简体中文) |
|---|---|
| <img src="screenshots/promo-en-light-daily.png" width="300" alt="Light theme, English"> | <img src="screenshots/promo-zh-dark-daily.png" width="300" alt="Dark theme, Chinese"> |
Features
- Summary bubble — one rounded container with 5 statistics divided by vertical rules: total / peak-day / longest session / current streak / longest streak;
- Three views — Daily (per-day color levels), Weekly (per-week stacked cells: week total ÷ (max week / 7) cells, deepest color), Cumulative (per-week cumulative stack: total ÷ 7 per cell, newest column always full);
- Window switch — last 3 / 6 / 12 months (default 12); fixed 12px cells, 12-month view scrolls horizontally and auto-scrolls to the latest week;
- Hover details — hovering a cell shows that day's total, that week's total, or the week-to-date cumulative as of that day (localized zh/en);
- Activity insights — most used model / reasoning effort / tool, peak hour, daily & monthly averages, most active weekday, most active day; sorted by label length, two equal columns with a continuous center divider;
- i18n — zh / en, follows the document language live;
- Themes — light & dark palettes, follows the dsh application theme;
- Auto refresh — re-scans changed session files every 60s and on focus;
- Cross-platform — pure Node stdlib on the host side (
fs/path/os/zlib), works on Windows, macOS and Linux; the browser half is platform-agnostic.
Install (official mechanism)
Requires pnpm on PATH:
npm install -g pnpm
From npm (recommended):
dsh plugin --profile web add @kelearns/dsh-token-usage
Listed in awesome-dsh-plugin curated registry; also searchable as
token-usagein the Plugin Market tab of dsh settings (dsh-market).
Local development install (run from this repository's root — link:.
resolves to the current directory):
dsh plugin --profile web add link:.
Remove:
dsh plugin --profile web remove @kelearns/dsh-token-usage
The installer reads
cordis.patch.yml(thedsh.bundle.patchmanifest field) and applies the plugin row automatically — no manual patch editing. Restart dsh web to activate.
Manual equivalent (no CLI)
- Put the package into the profile node_modules:
$DSH_HOME/profiles/web/node_modules/@kelearns/dsh-token-usage; - Append this block to
$DSH_HOME/cordis.patch.yml(idempotent):
…

