M1kasssa/dsh-usage-monitor 预览 preview

M1kasssa/dsh-usage-monitor

Plugin插件 ⭐ 2 Usage & Cost用量与计费

Project Overview项目介绍

This is a purpose-built UI plugin for the DeepSeek Harness web interface. It adds a styled widget next to the settings button in the lower left of the DSH sidebar, which displays real-time DeepSeek Open Platform account balance and API usage data. A click on the widget opens a detail popup that breaks down balance and usage into more specific categories. The widget follows the iOS Liquid Glass aesthetic with gradient refractions and glossy highlights, supports both light and dark mode, auto-refreshes data every 60 seconds, and includes a one-click link that opens the official DeepSeek recharge page.

The plugin is built for DSH users who call DeepSeek APIs directly through the Harness interface. After installation, users must fully restart the dsh web process for the plugin to work correctly, since it includes a host-side local proxy route that only loads on process startup. Once restarted, users just click the whale icon capsule and enter their DeepSeek API key to see balance data immediately. To get full monthly usage statistics, an additional platform session token is required, which can be added either via the popup or a local text file.

The plugin does not require building from source or running npm install, and offers both automatic and manual installation methods across different operating systems. Windows users can run a single PowerShell command for automatic installation, while other OS users can follow clear manual steps. All sensitive credentials like API keys and platform tokens stay local on the user's device, and are only sent directly to DeepSeek's official servers with no third-party data sharing. Usage tracking relies on an undocumented private DeepSeek endpoint, so it may break if DeepSeek changes the interface later, and the project is released under the open source MIT license.

这是一个专为 DeepSeek Harness 网页界面打造的原生插件,会在侧边栏左下角设置按钮旁添加一个iOS Liquid Glass毛玻璃风格的小部件,用来实时展示DeepSeek开放平台的账号余额与API调用用量。小部件自带DeepSeek鲸鱼图标,显示余额和本月累计tokens,每60秒自动刷新,点击可打开详情弹窗,还可通过余额旁的一键充值按钮直接跳转至DeepSeek官方充值页面。

面向使用DeepSeek API通过DSH进行开发的用户,典型使用流程是安装插件后完全重启dsh web进程,再点击侧边栏的鲸鱼胶囊按钮,输入自己的DeepSeek API Key就能立即看到余额信息。如果想要获取完整的月度用量统计数据,还需要额外提供平台会话Token,可以粘贴在弹窗输入框,或者写入本地指定文件。

插件无需额外构建、npm安装,可通过自动脚本安装,也支持手动跨平台安装。API Key仅保存在浏览器本地存储,仅发送给DeepSeek官方接口,不会向第三方发送任何数据。用量查询依赖DeepSeek未公开的私有接口,可能随时因接口变更失效,整个项目采用MIT许可证开源。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 3 warnings3 项注意
  • No license declared - all rights reserved by default; ask the author before commercial use or redistribution未声明开源许可证 —— 默认「保留所有权利」,商用或再分发前先问作者
  • Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
  • No DSH plugin manifest detected - it may only carry the dsh-plugin topic, so the install method must be confirmed on the spot未检测到 DSH 插件清单:可能只是打了 dsh-plugin 话题,安装方式要现场确认
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:M1kasssa/dsh-usage-monitor

把 M1kasssa/dsh-usage-monitor 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-usage-monitor

一个为 DeepSeek Harness 网页界面 打造的毛玻璃(iOS Liquid Glass 风格)小部件,显示在侧边栏左下角「设置」按钮旁边,实时展示你的 DeepSeek 开放平台余额与 API 用量。

  • 🐋 DeepSeek 鲸鱼图标胶囊:余额 + 本月累计 tokens,每 60 秒自动刷新
  • 💎 iOS Liquid Glass 风格(折射渐变、高光光泽、渐变描边),支持亮色 / 暗色模式
  • 📊 详情弹窗:余额(总额 / 赠送额度 / 充值额度)、本月 tokens(缓存命中输入 / 未命中输入 / 输出)、请求次数
  • 💰 一键充值:余额旁边的「充值」按钮,直接跳转到 DeepSeek 官方充值页(https://platform.deepseek.com/top_up)
  • ⚡ 无需构建、无需 npm install、无需 git —— 与 Aqua 主题插件相同的安装机制

重要:插件包含 Host 半区(一个本地代理路由),它只在 dsh web 进程启动时加载。仅刷新页面不够 —— 安装后必须重启进程(安装脚本会提醒你)。

截图

插件界面截图

安装(Windows)

一条命令,在任何目录下执行:

powershell -ExecutionPolicy Bypass -Command "Invoke-WebRequest 'https://github.com/M1kasssa/dsh-usage-monitor/raw/main/install.ps1' -OutFile install.ps1; .\install.ps1"

或者手动克隆:

git clone https://github.com/M1kasssa/dsh-usage-monitor.git
powershell -ExecutionPolicy Bypass -File .\install.ps1 -Source .\dsh-usage-monitor

脚本会:

  1. 将仓库下载到 %USERPROFILE%\.dsh\plugins\@deepseek-ai\dsh-client-ui-dsusage
  2. 在 %USERPROFILE%\.dsh\profiles\node_modules\@deepseek-ai\dsh-client-ui-dsusage 创建目录联接(junction)
  3. 在 %USERPROFILE%\.dsh\profiles\web\cordis.patch.yml 中注册 ui-dsusage(幂等,可重复执行)

可覆盖参数:-DshHome <路径>(默认 %USERPROFILE%\.dsh)、-Profile <名称>(默认 web)、-Version <标签|分支>。

手动安装(任意系统)

# 1. 将本仓库复制到 DSH 插件目录
mkdir -p "$DSH_HOME/plugins/@deepseek-ai"
cp -r dsh-usage-monitor "$DSH_HOME/plugins/@deepseek-ai/dsh-client-ui-dsusage"

# 2. 链接到 profile 的 node_modules
ln -s "$DSH_HOME/plugins/@deepseek-ai/dsh-client-ui-dsusage" "$DSH_HOME/profiles/node_modules/@deepseek-ai/dsh-client-ui-dsusage"

# 3. 在 profiles/web/cordis.patch.yml 中注册
- insert:
    - id: ui-dsusage
      name: '@deepseek-ai/dsh-client-ui-dsusage'

⚠️ 需要重启

安装完成后,请完全重启 dsh web 进程:

# 在运行 dsh 的终端里按 Ctrl+C,然后重新运行
npx @deepseek-ai/dsh web --port 3080

如果进程还在运行旧代码,胶囊按钮依然会出现(浏览器半区是热加载的),但用量不可用 —— 弹窗会显示红色警告提示你重启。如果看到该警告,请重启进程。

使用方法

  1. 点击侧边栏左下角的鲸鱼胶囊按钮(首次运行会自动打开)。
  2. 粘贴你的 DeepSeek API Key(在 https://platform.deepseek.com/api_keys 创建)并按回车。
    • 余额立即显示(官方接口 api.deepseek.com/user/balance,允许跨域,由浏览器直接请求)。
    • 点击余额旁边的「充值」按钮,即可跳转到官方充值页进行充值。
  3. (可选,用于用量数据)提供平台 Token:
    • 登录 https://platform.deepseek.com,打开开发者工具(F12)→ Console,执行:
      localStorage.getItem('userToken')
      
      返回的是一个 JSON 字符串,形如 {"value":"PIAD…","__version":"0"} —— 复制其中的 value。
    • 把它粘贴到弹窗的第二个输入框并按回车,或者写入 Host 半区会读取的文件:
      %USERPROFILE%\.dsh\ds-usage-token.txt
      
    • 之后每 60 秒会通过 Host 半区注册的本地代理路由(/ds-usage/v1/usage),从私有看板接口 platform.deepseek.com/api/v0/usage/amount?month=&year= 拉取用量。仅凭 API Key 无法查询用量 —— 看板接口需要平台会话 Token。

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-win-bash-fix 下一个 Next dsh-smarter-edit →