YZz-S/dsh-token-cost-meter1

dsh-token-cost-meter

DeepSeek Harness 会话费用插件,显示当前会话累计 Token 消耗与估算费用,价格从 DeepSeek 官方动态获取。

AI 分析

核心用途是实时监控当前对话的 API 消费。适合需要控制 API 成本、直观了解单次会话花费的用户。

套件
dsh-token-cost-meter
版本
0.2.0
授權
MIT
最近更新
2026年8月15日

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:YZz-S/dsh-token-cost-meter

Usage

Method 1: dynamic Cordis plugin (temporary)

  1. Open DSH Web and enter a session;
  2. Ask the assistant to call cordis_define, submitting host.js full text as code.host and client.js full text as code.client;
  3. cordis_run the returned pluginId / packageId;
  4. Approve on the Run card (double ✓ recommended to skip approval for future updates);
  5. Refresh the page; the cost stats line appears below the input box.

A dynamic plugin lives as long as the current DSH process: after a DSH restart you must define + run it again.

Method 2: install as a regular plugin (persistent)

That's the "Installation (dsh.bundle)" section above — after dsh plugin add it loads automatically at DSH startup.

使用方法

方式一:动态 Cordis 插件(临时运行)

  1. 打开 DSH Web,进入会话;
  2. 让助手调用 cordis_define,将 host.js 全文作为 code.hostclient.js 全文作为 code.client 提交;
  3. cordis_run 运行返回的 pluginId / packageId
  4. 在 Run 卡片上批准(建议勾选双 ✓,后续版本更新免审批);
  5. 刷新页面,输入框下方出现费用读数。

动态插件的生命周期与当前 DSH 进程相同:重启 DSH 后需重新 define + run。

方式二:正式插件(常驻)

即上方「安装(dsh.bundle)」一节,dsh plugin add 后随 DSH 启动自动加载。