dshbase

Plugin directory / Developer / dsh-usage-dashboard

dsh-usage-dashboard

Unverified 1690834643

2 contributors Builds on 4 official DSH packages

View on GitHub ↗ ← Back to plugin directory

1Stars
0Forks
0Open issues
—Language
—Last push
Cross-platformPlatform

What it does

No description provided.

Our take

No short evidence report

There is no checkable per-level test record on this page. Stars, the catalog test field, a web-only flag, and whether the plugin needs an external account or service are not shown here as a pass or a failure. The catalog badge stays as published.

“Unverified” means our automated CI has not yet installed this plugin. Feature descriptions and version compatibility are the author’s claims. This is not a security audit and not an endorsement of third-party code.

Plugin author? Get the “Verified” label — submit your own evidence (screenshots, logs, or a short demo) and we'll review and flip the badge.

Submit verification evidence ↗

README

dsh-usage-dashboard

DeepSeek Harness (dsh) 的 Web 插件:在侧边栏底部显示 API 余额 和 今日花费。

  • 余额:通过 DeepSeek API GET /user/balance 实时获取(带缓存,默认 60s)
  • 今日花费:扫描 $DSH_HOME/sessions 的会话日志(zstd 多帧解码),汇总今日 token 用量 × 官方定价估算
  • 支持 DeepSeek 2026-08-17 起的峰谷定价(高峰 9-12 / 14-18 点,空闲半价),按每条请求的发生时间自动选用费率

界面

侧边栏底部小部件:

  • 展开时显示 余额 ¥xx.xx 与 今日花费 ¥xx.xx,点击展开详情卡(余额构成、调用次数、Token 用量、按模型明细、计价方式)
  • 收起时显示 ¥ 图标按钮,悬停提示
  • 每 60 秒自动刷新,可手动点击刷新

安装

前提:已安装 dsh(dsh web 可正常运行)。

方式一:npm 安装

dsh plugin add dsh-usage-dashboard --profile web

方式二:本地目录

# 把本仓库克隆/复制到 profile 的 node_modules 下
mkdir -p ~/.dsh/profiles/web/node_modules/dsh-usage-dashboard
cp -r lib package.json ~/.dsh/profiles/web/node_modules/dsh-usage-dashboard/

然后在 ~/.dsh/profiles/web/cordis.patch.yml 追加:

- insert:
    - id: usage-dashboard
      name: 'dsh-usage-dashboard'
      config:
        apiKeyRef: DEEPSEEK_API_KEY

重启 dsh web 生效。

配置

字段 说明 默认
apiKeyRef DeepSeek API Key 的凭证引用 DEEPSEEK_API_KEY
baseURL 余额接口地址;留空则用 $DEEPSEEK_BASE_URL,再回退 https://api.deepseek.com ""
prices 按模型单价覆盖(元 / 百万 tokens:{ input, cacheRead, output }) 官方现行价
priceSchedule 日期生效的峰谷定价表 { from, peak, idle } 2026-08-17 起峰谷定价
balanceCacheMs 余额缓存毫秒数 60000
sessionsRoot 会话日志目录覆盖 <dsh home>/sessions
scanWindowMs 只扫描此时间窗口内修改的日志 48h

默认价格(官方现行价,2026-08-17 前)

模型 缓存命中 缓存未命中 输出
deepseek-v4-flash ¥0.02/M ¥1/M ¥2/M
deepseek-v4-pro ¥0.025/M ¥3/M ¥6/M

2026-08-17 起峰谷定价(已内置,无需配置)

模型 时段 缓存命中 未命中 输出
flash 高峰 ¥0.10 ¥3.0 ¥9.0
flash 空闲 ¥0.05 ¥1.5 ¥4.5
pro 高峰 ¥0.30 ¥9.0 ¥27.0
pro 空闲 ¥0.15 ¥4.5 ¥13.5

价格有变动时在 cordis.patch.yml 的 prices / priceSchedule 里覆盖即可。

说明

  • 花费为估算:按 token 用量 × 官方单价计算;不含联网搜索、标题生成等日志中未记录 token 用量的调用
  • 余额数字来自官方接口,为准确值
  • 接口 GET /api/dsh-usage 只在本机 127.0.0.1 上服务,API Key 不离开服务端

开发与测试

npm test          # 运行 host 逻辑 + 客户端 bundle 物化 + SSR 渲染测试

License

MIT

Install

🧩 Let your agent install it (recommended)

Install the catalog once, then DeepSeek Harness can find and install any plugin from this site automatically:

dsh plugin add dshbase-catalog

Then say "install dsh-usage-dashboard for me" — your agent finds it in the directory and installs it. Docs: dshbase-catalog · verified packs.

This plugin is GitHub source (not published to npm) — install it straight from the repo:

Web profile:

dsh plugin --profile web add github:1690834643/dsh-usage-dashboard

Headless (CLI) profile:

dsh plugin --profile headless add github:1690834643/dsh-usage-dashboard

Test report

No short evidence report

There is no checkable per-level test record on this page. Stars, the catalog test field, a web-only flag, and whether the plugin needs an external account or service are not shown here as a pass or a failure. The catalog badge stays as published.

When to use it

Extend the agent's coding surface — give it a new tool, workflow, or integration so it handles a dev task it couldn't before.

Who it's for

Developers who want dsh to behave like a teammate on real codebases — editing, running, and verifying changes rather than just answering.

For developers — extending it

The tool/command surface is the seam: expose more of the SDK, add smarter context wiring, or tighten the loop between code changes and verification.

Security: not yet scanned — our daily static scan will cover it shortly.

Share this badge

More in Developer

Browse all 26834 plugins →