DSH Plugins Marketplace

DSH Plugins

Plugins

/

Terminal & Clients

/

@dsh-external/dsh-usage-stats

@

@dsh-external/dsh-usage-stats

Manifest valid

Usage Statistics: Aggregates the total token usage and model distribution across all sessions, displayed on the settings page

UI (client)hasBundlePatch

@dsh-external/dsh-usage-stats

English | 中文

DeepSeek Harness (DSH) 用量统计插件:聚合所有会话的 token 使用量(输入 / 输出 / 缓存读 / 缓存写),按模型与按天明细,并在设置页展示,可配置单价估算费用。

topic license GitHub

功能

  • 聚合总览:全部会话的 token 总量、请求数、会话数。
  • 按模型明细:每个 provider/model 的请求数与各项 token。
  • 按天明细:每日用量列表 + 简易趋势图。
  • 单价与费用估算:内置常见 provider 单价,可在设置页按模型覆盖,支持 USD/RMB 显示。
  • 加载优化:后台预热 + 会话变化防抖重扫 + 增量按会话缓存 + stale-while-revalidate,打开设置页不阻塞。

安装

① 插件市场一键安装

若已安装 dsh-market 插件市场:

  1. 打开 Settings → Plugin Market
  2. 搜索 dsh-usage-stats(或 @dsh-external/dsh-usage-stats)
  3. 点 安装,刷新页面即可在设置页看到「用量统计」

插件市场只收录其 registry 里列出的源;若搜索不到,请先用下面②/③/④安装,再考虑把它加入市场 registry。

② dsh plugin add(官方安装命令)

本包已声明 dsh.bundle manifest,可用官方命令直接安装:

dsh plugin --profile web add @dsh-external/dsh-usage-stats

包未发布 npm 时会回退为 GitHub 源码安装,依赖网络可达 github.com。

③ dsh-super-injector 直接注入

dev_inject_plugin <本仓库目录>

④ 克隆 + 打包安装

git clone https://github.com/dustinmoon78/dsh-usage-stats.git
cd dsh-usage-stats
bash scripts/build.sh      # 校验 lib 并产出 tgz
# 在目标环境安装/注入产出的 tgz

数据流

遍历 ctx.sessionPersistence 的会话快照(listSnapshots / list),inspect/readFrom 读取事件,折叠 assistant/message 与 assistant/chunk(usage) 的 token 字段,按当前生效的 provider/model(request/header)归属。

API

方法路径说明
GET/dsh-usage-stats/api总览(?refresh=1 强制重扫)
POST/dsh-usage-stats/api/prices保存单价/汇率
curl -s 'http://127.0.0.1:<port>/dsh-usage-stats/api'

返回结构含 total、byModel(每模型含 byDay)、byDay、sessionCount、generatedAt、prices、refreshing。

依赖

  • 宿主须提供服务:webServer、sessionPersistence、sessionProjectionCache。
  • 运行时 peer:cordis(>=4.0.0-rc <5)。

License

BSD-3-Clause

Comments

Loading…

From the same category

dsh-purge

by kingcharleslzy-ai

Community-maintained dsh-purge fork with host-policy patches, prompt and rule settings, diagnostics, separate update-check and install controls, and local backup/rollback.

Tools & CapabilitiesTerminal & ClientsManifest valid

★ 9.3k

MIT

JavaScript

Nov 16, 2026

dsh plugin --profile web add dsh-purge-community

by ccch1mneyyy

DSH 官方公众号收录的 TUI 补位插件:Claude Code 风,鲸鱼顶栏/实时状态/流式思考/双击 Esc 回滚/上下文进度+TPS。npm 一键装。 DSH official WeChat featured TUI plugin — Claude Code style: whale bar, live status, streaming thoughts, double-Esc rol

Terminal & ClientsManifest valid

★ 7.8k

↓ 19.2k/wk

MIT

TypeScript

Nov 17, 2026

dsh plugin --profile terminal add @deepseek-harness-tui/dsh-tui

by mmparko

DeepSeek Harness 破甲 (mirror of YuJunZhiXue/dsh-purge) — 上游即将删库,此为本仓库全量镜像:含全部分支/73 个 tag/完整提交历史。原作者署名与二开要求见 README 署名章节。

Terminal & ClientsManifest valid

★ 5.2k

↓ 19.5k/wk

MIT

JavaScript

Oct 13, 2026

dsh plugin --profile web add dsh-purge

by bowenliang123

The best DeepSeek Harness plugin for context insight and management, with context dashboard / browser / sidebar and context command, for context statistics, composition, breakdown, evolution details,

Tools & CapabilitiesUI & ExperienceTerminal & ClientsManifest valid

★ 5.2k

↓ 127.5k/wk

Apache-2.0

TypeScript

Nov 16, 2026

dsh plugin --profile web add dsh-context

by strukto-ai

The World's First Virtual Terminal for AI Agents

Terminal & ClientsManifest valid

★ 3.8k

↓ 519/wk

Apache-2.0

TypeScript

Nov 17, 2026

dsh plugin --profile agent add @struktoai/mirage-dsh

by c1overzz

DSH 插件:每天替你刷一轮 B站,读字幕挑出值得的、写一份日报,值得的 @ 你

Tools & CapabilitiesNotifications & IntegrationsTerminal & ClientsManifest valid

★ 1.4k

↓ 10.5k/wk

MIT

JavaScript

Nov 12, 2026

dsh plugin --profile web add dsh-bili-scroll