Jovan1666/commandcode-usage
Command Code plan usage for seven coding agents: one core, seven adapters. Runs locally, so checking your quota costs no quota.
Project Overview项目介绍
Command Code Usage is a cross-agent quota-monitoring tool whose sole implementation lives in core/cc-usage.mjs; the repository ships seven thin adapter directories so the same logic can be loaded into seven different coding CLIs and harnesses. It reads a Command Code API key from environment variables, ~/.commandcode/auth.json, or the host agent's own settings file, then renders a one-line status bar showing the five-hour, weekly, and monthly rolling windows with percent-used bars, reset times, remaining dollar balance, and traffic-light colors that turn from green under sixty percent to amber by eighty-five percent and red above ninety. The MIT-licensed project supports Claude Code, Codex CLI, Grok Build, opencode, pi, DeepSeek Harness, and ZCode, and is installed via per-agent commands such as /plugin marketplace add Jovan1666/commandcode-usage for Claude Code, grok plugin marketplace add … for Grok Build, pi install ./commandcode-usage/plugins/pi, and dsh plugin --profile web add ./commandcode-usage/plugins/dsh (requiring dsh ^0.1.5-rc.1). Most adapters are copies of the core script kept in sync by scripts/sync-core.mjs, but the DeepSeek Harness adapter deliberately keeps its own data layer because its host/client halves and one-hundred-forty-one offline checks are built against a separate contract; that detail is documented in plugins/dsh/README.md.
The typical workflow is to glance at the editor's status line, sidebar, or terminal panel between turns and see at a glance how much of the current billing window is gone, with no model round-trip and therefore no quota cost. The script decides per turn whether the active session is actually routed through Command Code by reading router mappings such as cc-switch-style ANTHROPIC_DEFAULT_OPUS_MODEL pairs, and simply hides itself when the user has switched to a different model so the quota bar does not become permanent noise. When precise numbers are wanted, /quota is invoked as a prompt and therefore costs a model turn; alternative surfaces include the terminal panel, the HTML panel, --compact, --md, and --json outputs, and per-agent toggle commands like pi's /ccq-bar on|off|toggle|refresh|status, while opencode exposes only its sidebar. Plans with no rolling windows, such as Provider or Enterprise, display only the balance, and the Go plan without API access renders nothing; the target audience is developers who juggle multiple coding agents and want to avoid burning turns just to inspect their usage.
Dependencies are intentionally light: Node eighteen or newer is the only runtime requirement beyond a Command Code paid plan that actually grants API access. Claude Code and Grok require a one-time setup script because their plugin manifests cannot declare a status line, so the script writes the setting on the user's behalf, refuses to overwrite an existing status line unless --force is passed, and restores the original on --remove. Windows users should install Git Bash because Claude Code falls back to PowerShell otherwise, and PowerShell repaints run roughly three times slower than Git Bash. The repository ships a node scripts/check.mjs that runs the same suites as CI, including the DeepSeek Harness one-hundred-forty-one checks, and an editor should change only core/cc-usage.mjs and then run the sync script, since the per-adapter files are generated copies. When credentials cannot be located the status line silently omits itself instead of printing an error into the editor, with the documented exception of the DeepSeek Harness adapter that retains its independent data layer.
Command Code Usage 是一个跨代理的命令行用量配额查看工具,核心脚本为 core/cc-usage.mjs,在不消耗模型额度的情况下,从本地环境自动读取 Command Code(Claude Code 背后计费体系)的 API 密钥,展示 5 小时、周、月三个滚动窗口的已用百分比、进度条、剩余额度及重置时间,并按 60% 绿、85% 琥珀、90% 红渲染颜色。项目以 MIT 协议发布,通过每代理一个适配器目录的形式分发:Claude Code 用 /plugin marketplace add 加载后需运行 setup 脚本写入 settings.json 状态行;Codex CLI、Grok Build、opencode、pi、ZCode 各有独立的安装命令;DeepSeek Harness 用 dsh plugin --profile web add ./commandcode-usage/plugins/dsh 加载,需要 dsh ^0.1.5-rc.1。
典型工作流是用户在已打开的编码代理中直接观察侧边栏、状态栏或终端面板里的配额进度条;脚本每轮根据路由器映射判断当前会话是否真正路由到 Command Code,否则隐藏自身避免噪音。需要详细数字时可调用 /quota(会消耗一轮)或终端面板、HTML 面板、--compact、--md、--json 等输出形式(不显示状态栏)。burn-rate 投影只在显式面板中打印,避免状态栏中"总是告警"导致失去意义。适合关心月度配额、需要在多个代理间切换、又不想为查看用量消耗额度的开发者使用。
依赖方面,脚本需 Node 18+,并依赖一个具备 API 访问权限的 Command Code 付费套餐(Go 档无 API,将不渲染)。Windows 上 Claude Code 在未装 Git Bash 时会通过 PowerShell 调用状态行命令,单次重绘成本显著上升,建议安装 Git Bash 以降低约三倍开销。安装时若已配置过其他代理的状态行,setup 脚本默认拒绝覆盖,需传 --force;卸载可用 --remove。pi 用 /ccq-bar 子命令控制显隐,opencode 无命令完全依赖侧边栏。plugins/dsh 子目录因宿主/客户端半部与 141 项离线校验独立构建,保留自有数据层而非共用 core,修改需跑 node scripts/sync-core.mjs 同步,并先装 React。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:commandcode-usage(Jovan1666/commandcode-usage)
仓库:https://github.com/Jovan1666/commandcode-usage
本站详情页:https://www.yhbd.top/plugins/jovan1666-commandcode-usage/
本站登记:类型 plugin · 归类 多平台兼容工具(非 DSH 原生) · 许可证 MIT · ⭐ 2 · 最近提交 2026-10-01 · 主语言 JavaScript · 未检测到 DSH 插件清单
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【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 更稳。
- 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 话题,安装方式要现场确认
- Not DSH-native: a multi-platform tool that may require Node / Electron or another runtime first非 DSH 原生,是多平台兼容工具:可能要先装 Node / Electron 等运行时
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:Jovan1666/commandcode-usage
把 Jovan1666/commandcode-usage 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
Command Code Usage
See how much of your Command Code plan is left — 5-hour, weekly and monthly windows with reset times — inside the coding agent you already have open.
Runs on your machine. No model round-trip, so checking your quota costs no quota.

CC GOAT │ 5h █▎░░░░░░░░ 12% 4h27m后重置 │ 周 █▏░░░░░░░░ 11% 09-27重置 │ 月 ▋░░░░░░░░░ 6% $66.03 10-20重置
Install
Each agent has its own way of loading plugins, so pick yours. Six of the seven end up running
the same core script (core/cc-usage.mjs); the DeepSeek Harness adapter keeps its own data
layer, for the reason given under Layout.
| Agent | How | Persistent? |
|---|---|---|
| Claude Code | /plugin marketplace add Jovan1666/commandcode-usage then /plugin install commandcode-usage@commandcode-usage, then node ~/.claude/plugins/marketplaces/commandcode-usage/plugins/claude-code/scripts/setup.mjs |
✅ status line |
| Codex CLI | plugin marketplace (.agents/plugins/marketplace.json) — the bundled hook runs each turn; Codex will ask you to trust it |
⚠️ per-turn line |
| Grok Build | grok plugin marketplace add Jovan1666/commandcode-usage, then run plugins/grok/scripts/setup.mjs |
✅ status line |
| opencode | run plugins/opencode/scripts/setup.mjs |
✅ sidebar |
| pi | pi install ./commandcode-usage/plugins/pi, or copy index.ts into ~/.pi/agent/extensions/ |
✅ above the input |
| DeepSeek Harness | clone this repo, then dsh plugin --profile web add ./commandcode-usage/plugins/dsh (needs dsh ^0.1.5-rc.1) |
✅ sidebar |
| ZCode | /plugin marketplace add Jovan1666/commandcode-usage then /plugin install command-code-usage (its marketplace and plugin name differ) |
⚠️ command only |
Nothing here asks for your API key up front. The script finds it — see Credentials.
The DeepSeek Harness card has its own three-state screenshot in
plugins/dsh/assets/screenshot.png — collapsed badge, light expanded,
and dark expanded. The other five platforms all render the same one line shown above, so they get text
rather than a picture.
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
MeteorNOX/DeepSeek-Balance-Whale-Widget
edison7009/EchoBird
Han-1413141/dsh-cost-meter
wssfk12138/dsh-damage-pulse
zh667/TokenLedger
edonadei/caliper
Ychris12138/dsh-usage-stats
Aisland-SJL/dsh-usage