npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-commandcode-usage

v1.2.0

Published

CommandCode 用量与余额面板 — 在 DSH 侧边栏底部(设置按钮旁)显示 API 用量、信用额度、5小时/每周/月额度。 · CommandCode usage & balance panel for DeepSeek Harness: usage, credit balance and 5-hour/weekly/monthly windows from the sidebar footer.

Readme

dsh-commandcode-usage

CommandCode 用量与余额面板 — 在 DSH(DeepSeek Harness)侧边栏底部显示 CommandCode API 用量、信用额度、5小时/每周窗口。

A CommandCode usage & balance panel for DeepSeek Harness — shows API usage, credit balance, and 5-hour/weekly windows from the sidebar footer.

usage panel

Features · 功能

  • CommandCode 用量:请求次数、成功率、Token 消耗、总花费
  • 信用额度:月额度、5小时窗口、每周窗口,进度条可视化
  • ⏱ 重置时间显示:每个周期下方标明截止/重置时刻(「重置 今天/明天/N天后 HH:mm」),一眼知道额度何时刷新
  • 余额与订阅:套餐信息、订阅状态、计费周期
  • 精致卡片 UI:渐变 header + 套餐徽章、统计三卡、图标渐变动画进度条、彩色百分比胶囊(≥85% 红 / ≥60% 黄 / 其余绿)
  • 主题自适应:跟随 DSH 的浅色/深色主题自动切换
  • 月额度按计费周期:只统计当前计费周期、到期自动重置、不结转;分母是套餐月额度(GOAT $70),与 CommandCode 官网显示一致
  • 侧边栏入口:通过官方槽位 sidebar.footer.action 挂在 DSH 侧边栏底部(设置按钮旁)的「⚡ 用量」按钮,点击弹出面板;侧栏收起时自动只留图标

Install · 安装

方式一:插件市场(推荐)

打开 DSH 设置 → 插件市场,搜索 dsh-commandcode-usage,一键安装。

方式二:npm

dsh plugin --profile web add dsh-commandcode-usage

方式三:手动(双半包)

# 1. 安装 npm 包
npm install dsh-commandcode-usage

# 2. 在 cordis.patch.yml 注册
# - id: dsh-commandcode-usage
#   name: 'dsh-commandcode-usage'

Configuration · 配置

插件通过 cordis.patch.yml 的 config 字段配置:

- id: dsh-commandcode-usage
  name: 'dsh-commandcode-usage'
  config:
    # API key(可选,默认自动从环境变量/配置文件读取)
    apiKey: 'your-commandcode-api-key'
    # API 基础地址(可选,默认官方)
    apiBase: 'https://api.commandcode.ai'
    # 环境变量名(可选,默认 COMMANDCODE_API_KEY)
    apiKeyEnv: 'COMMANDCODE_API_KEY'

API key 解析顺序

  1. 插件 config.apiKey
  2. 环境变量 COMMANDCODE_API_KEY
  3. ~/.dsh/.credentials.yaml 中的 COMMANDCODE_API_KEY
  4. launchctl getenv COMMANDCODE_API_KEY
  5. 其他常见配置文件(~/.config/commandcode/ 等)

Usage · 使用

安装并重启后,在侧边栏底部、设置按钮左边点击 "⚡ 用量" 按钮即可查看:

  • 请求次数 / 成功率 / 本计费周期花费(概览卡片)
  • 5小时窗口 / 每周窗口用量(进度条 + 重置时刻)
  • 月额度(计费周期):本期已用 / 套餐额度(进度条 + 重置日期)与剩余额度
  • 账号、套餐、更新时间(页脚)

同时注册了 commandcode_usage 工具,agent 可在对话中查询:

查询我的 CommandCode 用量

Development · 开发

git clone https://github.com/zouxiaoyang/dsh-commandcode-usage.git
cd dsh-commandcode-usage
npm install
# 本地开发:软链到 profile
ln -sfn $PWD ~/.dsh/profiles/web/node_modules/dsh-commandcode-usage

License

MIT