DSH Web GUI 的 Token 用量仪表盘 — 今日/本周/本月/累计汇总、按模型明细和堆叠柱状图,界面支持中/英/越/日。
安装
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:phungthien269/dsh-token-stats
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
Token usage dashboard for the DeepSeek Harness web GUI — displayed directly inside the app. No extra collection: it reads the 365-day local ledger the built-in Wallet plugin already records (every AI call: model, provider, day, input/output/cache tokens, cost when priced).
English · Tiếng Việt · 中文
Features

- Sidebar entry "Token Statistics" — opens a full-width dashboard in the center column (same interaction model as the Task Board plugin); works in both the expanded sidebar and the compact rail.
- Four summary cards — Today / This week / This month / All time (tokens + cost when pricing data exists).
- Stacked bar chart — pure SVG, one color per model, daily (30 days) / weekly (12 ISO weeks) / monthly (12 months), hover tooltips per model, K/M-scaled axis.
- Per-model table — input, output, cache read, total, share bar; sorted by total.
- 4-language UI — English (primary), Tiếng Việt, 中文, 日本語. Language picker in the dashboard header; the choice is remembered.
- Auto-refresh — refetches every 30 s while the dashboard is open, plus a manual refresh button.
- Zero dependencies, no build step — host half is plain ESM Node; client half is a single pre-bundled CJS module.
Install
dsh plugin --profile web add dsh-token-stats
Restart dsh web (or use the Market's one-click restart), then look for Token Statistics in the left sidebar.
Requires dsh ≥ 0.1.1-rc.2 (the sidebar DOM it integrates with). Read-only: the plugin never writes to the Wallet ledger.
How it works
- Host half registers
GET /api/token-stats/summary: all-time totals from~/.dsh/storages/wallet.jsonsessions, and day/week/month series from itshistory.events(timezone-aware, mtime-cached). - Client half mounts the sidebar entry (self-healing DOM injection) and the dashboard React view; charts are hand-rolled SVG — no chart library.
Data notes
- All-time totals come from the Wallet session ledger; the day/week/month series come from the Wallet event ledger (capped at 20,000 events / 365 days by the Wallet plugin). Models without pricing show tokens only.
Tiếng Việt
Dashboard thống kê token cho web GUI của DeepSeek Harness — hiển thị trực tiếp trong ứng dụng. Đọc sổ ghi 365 ngày có sẵn của plugin Wallet (mỗi lần gọi AI: model, ngày, token input/output/cache, chi phí khi có). Thẻ tổng quan Hôm nay / Tuần này / Tháng này / Tổng tất cả; biểu đồ cột xếp lớp theo model; bảng chi tiết từng model. Giao diện đa ngôn ngữ: Tiếng Việt, English, 中文, 日本語 — đổi ngay trong dashboard. Cài đặt: dsh plugin --profile web add dsh-token-stats, khởi động lại dsh web, mở mục "Thống kê Token" ở thanh bên.
中文
DeepSeek Harness Web GUI 的 Token 用量仪表盘 — 直接显示在界面内。读取内置 Wallet 插件的 365 天本地账本(每次 AI 调用:模型、日期、输入/输出/缓存 token、可用时的费用)。今日 / 本周 / 本月 / 累计四张汇总卡片;按模型堆叠的柱状图;模型明细表。界面支持越南语 / 英语 / 中文 / 日语,可在仪表盘内切换。安装:dsh plugin --profile web add dsh-token-stats,重启 dsh web,在侧边栏打开 "Token 统计"。
Submit to the Plugin Market
See docs/market-submission.md — publish to npm, then PR one entry into the awesome-dsh-plugin catalog (the Market picks it up automatically, usually within a day).
License
MIT — see LICENSE.
链接
同类插件
bowenliang123/dsh-context★ 1272
DSH 上下文洞察面板:Context 仪表盘 + /context命令 + Context 浏览器,查看 Context的分类组成、内容详情、演进趋势、压缩/注入事件、统计等一站式 Context 全生命周期管理。
Han-1413141/dsh-cost-meter★ 252
会话与当日 API 费用统计、预算图框(已用%)、官方余额、历史看板,支持峰谷计价与官方价格一键同步。
zh667/TokenLedger★ 193
侧边栏用量面板:把 Token 归属到实际服务该请求的中转站,站点从已有的 provider 配置中读出,无需额外配置;含今日/本月/累计三窗口、按站点与模型下钻、一年活跃度热力图,以及 New API / Sub2API / DeepSeek 余额。
wssfk12138/dsh-damage-pulse★ 147
在 DSH Web 界面追踪 DeepSeek Token 用量、单次与会话费用及账户余额,并显示缓存感知的扣费动画。
Ychris12138/dsh-usage-stats★ 139
多供应商用量看板:按供应商/模型统计 Token 与日期下钻,统一展示账户余额,并追踪 OpenCode Go / Z.ai 订阅额度。
feibi-mochi/deepseek-harness-control-center★ 67
DeepSeek Harness 监控、提醒、充值与会话控制中心:查看官方余额、本会话花费与 token、第三方 token 合计,提供完成提醒、官方充值、灵活布局及 Agent 辅助的会话控制。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。