534119219/chicheng-stats
dsh Web 全局用量统计插件:在左侧栏"设置"按钮旁显示用量组件(一行小字或卡片,可在 设置 → 用量统计 中自由配置),点击打开完整的用量统计面板(Sub2API 风格的使用记录)。跨所有会话统计,包括 headless 定时任务等其他进程产生的会话。
catalog descriptioncatalog 简介 / catalog description:DSH 全局用量统计插件:高度可配置侧边栏组件(文字/卡片)+ 统计面板(模型分布/趋势/首字节/耗时明细)
Project Overview项目介绍
This is a native DSH web plugin that tracks cumulative usage of LLM API requests across all DSH sessions, including those generated by background processes like headless scheduled tasks. It adds a configurable display component to the DSH web sidebar next to the Settings button, and clicking the component opens a full statistics panel. It requires Node.js version 22 or higher (officially tested on Node 24) and an already initialized DSH web instance to work properly. The recommended installation method is via the DSH CLI command dsh plugin --profile web add github:534119219/chicheng-stats, but it can also be installed manually by editing your profile’s package.json.
The plugin supports two display modes for the sidebar component: text mode with custom templates and 12 predefined placeholders, and card mode with adjustable grid layout and styling options. All changes to component settings take effect within 5 seconds, so no restart of DSH is required to see your changes. It tracks real-time request usage, deduplicates requests by (turn, step), attributes each request to the correct model, and automatically backfills historical usage from existing session logs stored in your DSH home directory. It also displays DeepSeek platform balance and daily usage data when you hover your cursor over the sidebar component.
All aggregated statistics, individual request details, and user settings are persisted to the $DSH_HOME/stats directory via atomic debounced writes, so your data is never lost after DSH restarts. The plugin is completely read-only, so it never modifies any existing DSH session data and has zero impact on KV cache or overall model performance. If you configure a DEEPSEEK_PLATFORM_TOKEN, the plugin pulls official daily usage data directly from DeepSeek’s platform; otherwise, it estimates daily consumption from your API key balance and falls back to local statistics. All API key and token data stays on your local machine, so no sensitive data is shared with third parties.
这是一款专为DSH Web打造的原生用量统计插件,会在左侧边栏的设置按钮旁添加一个可自由配置的用量显示组件,点击即可打开完整的用量统计面板。它可以跨所有会话统计各个大模型调用的请求数和Token用量,包括headless定时任务等其他非交互进程产生的后台会话。
插件支持实时累计请求用量、按模型归属分类统计,侧边栏组件可自由配置显示模式、位置、文字样式、卡片布局,修改后实时生效无需重启。它还支持在鼠标悬停侧边组件时显示DeepSeek开放平台的余额和今日用量数据,启动后会自动回填历史会话的用量数据。
该插件要求已初始化运行的DSH Web环境和Node.js 22及以上版本,可通过dsh plugin命令一键安装,也可手动编辑profile的package.json完成安装。所有统计数据和用户设置都会持久化保存在DSH主目录中,插件本身只读,不会修改任何原有DSH会话数据。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:chicheng-stats(534119219/chicheng-stats)
仓库:https://github.com/534119219/chicheng-stats
本站详情页:https://www.yhbd.top/plugins/534119219-chicheng-stats/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证未声明 · ⭐ 7 · 最近提交 2026-08-26 · 主语言 JavaScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- No license declared - all rights reserved by default; ask the author before commercial use or redistribution未声明开源许可证 —— 默认「保留所有权利」,商用或再分发前先问作者
- Only 7 stars - very few users, little community feedback星标只有 7,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项
Compatibility兼容性
- DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
- External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
- Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册
Security安全性
- Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
- Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
- curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
- Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
- Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
- Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式
Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile web add github:534119219/chicheng-stats
把 534119219/chicheng-stats 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
chicheng-stats
dsh Web 全局用量统计插件:在左侧栏"设置"按钮旁显示用量组件(一行小字或卡片,可在 设置 → 用量统计 中自由配置),点击打开完整的用量统计面板(Sub2API 风格的使用记录)。跨所有会话统计,包括 headless 定时任务等其他进程产生的会话。
功能特性
- 实时累计:订阅
session/event,按(turn, step)去重计数每次 provider 请求的用量样本,并记录逐请求明细(时间 / 模型 / 会话 / 输入 / 缓存读 / 缓存写 / 输出); - 模型归属:从
request/header快照追踪每个请求使用的模型,支撑模型分布统计; - 可配置侧边栏组件:设置 → 用量统计 中可调整——
- 通用:显示模式(文字 / 卡片)、位置(设置按钮上方 / 下方);
- 文字模式:自定义模板 + 12 个占位符、字号、文字颜色、粗细、对齐、背景填充(含背景颜色)、圆角、内边距;
- 卡片模式:卡片大小、每行列数(1/2/4)、显示项目(勾选)、标题字号与颜色、数值字号与颜色、间隔、圆角、边框粗细与颜色、背景颜色(默认
#43454A); - 修改实时生效(约 5 秒内),无需重启;
- 统计面板:点击组件弹出面板——时间范围选择(今日 / 近7天 / 近30天 / 本月 / 全部)、提供方筛选(全部 / 各提供方,可查看单一提供方用量)、概览、模型分布、Token 使用趋势图(SVG)、用量明细表(含首字节 / 总耗时);
- DeepSeek 平台悬停提示:鼠标悬停侧边栏组件(文字/卡片/收起图标)时浮动显示 DeepSeek 开放平台数据——剩余金额、今日消费、今日 Token、今日请求。余额来自官方
/user/balance(读取DEEPSEEK_API_KEY);配置DEEPSEEK_PLATFORM_TOKEN后今日消费/Token 使用平台官方明细,否则今日消费为余额差估算(带≈),Token 回退为本地统计。数据只在悬停时展示,不进统计弹窗; - 历史回填 + 增量扫描:启动后扫描
$DSH_HOME/sessions下全部会话日志(zstd 多帧拼接,按帧切分后逐帧解压),只处理越过持久化 seq 水位的事件,与实时计数天然去重;此后每 5 分钟轻扫一次,覆盖其他进程写入的会话; - 持久化:聚合写入
$DSH_HOME/stats/store.json,明细写入$DSH_HOME/stats/requests.json,组件设置写入$DSH_HOME/stats/settings.json(均防抖原子写入),重启不丢; - 只读安全:不修改任何会话数据,对模型体验 / KV Cache 零影响。
界面预览
![]() 侧边栏 · 卡片模式(4 列) |
![]() 侧边栏 · 文字模式 |
![]() 用量统计弹窗 |
![]() 设置页 · 卡片模式配置 |
![]() 设置页 · 文字模式配置 |
文字模板占位符
| 占位符 | 含义 | 占位符 | 含义 |
|---|---|---|---|
{todayRequests} |
今日请求 | {totalRequests} |
总请求 |
{todayTokens} |
今日 Token | {totalTokens} |
总 Token |
{todayInput} |
今日输入 | {totalInput} |
总输入 |
{todayOutput} |
今日输出 | {totalOutput} |
总输出 |
{todayCacheRead} |
今日缓存读 | {totalCacheRead} |
总缓存读 |
{todayCacheWrite} |
今日缓存写 | {totalCacheWrite} |
总缓存写 |
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →





wssfk12138/dsh-damage-pulse
Ychris12138/dsh-usage-stats
JingbiaoMei/Tokdash
yxxbc/dsh-balance-plugin
feiyang-dev/dsh-usage-plugin
LaoYueHanNi/dsh-token-usage
lanlandeli/dsh-usage-stats
Shiye-10Pages/dsh-whale-meter