Bundle
dsh-commandcode-usage-inline
Inline Command Code plan usage badge in the DSH composer toolbar (5h/weekly window usage + remaining credits) with an upward detail popover; reuses the commandcode/report remote from @mars-sea/dsh-commandcode-provider.
- Source
- 345420242
- stars
- 1 stars
- License
- MIT
- Updated
- Updated 19 hours ago
Readme
# dsh-commandcode-usage-inline **Inline** Command Code plan usage badge for the DSH composer toolbar — a one-line readout right beside the model selector, zero screen space beyond a compact pill. ![示意] composer 工具栏: `CC 5h 12% | 周 34% | 剩 1826` ## 功能 - **跟随当前模型**: 当前会话 provider 是 `commandcode` 时显示徽章;切到其它 provider 自动隐藏。 - **一行概览**(composer 内联,紧邻 model select): `CC 5h X% | 周 Y% | 剩 N` - `5h X%` — 5 小时窗口已用百分比(超限时变红) - `周 Y%` — 周窗口已用百分比(超限时变红) - `剩 N` — 剩余 credits(购买 + 免费) - **点击展开详情浮层**(向上弹出,样式与模型选择浮窗一致): - 当前账户(多账户轮换时绿点标注)、套餐名 - 5h / 周窗口的重置倒计时 - 剩余 credits 构成(订阅月包 + 购买 + 免费) - 其它已配置账户的分窗口占用 - 刷新 / 关闭按钮 - **60s 自动轮询**; 失败时徽章变黄 `CC ⚠`, 点击查看错误并可重试。 - 悬停徽章有胶囊背景反馈。 ## 与 sidebar 版 (zouxiaoyang/dsh-commandcode-usage) 的区别 已收录的 [zouxiaoyang/dsh-commandcode-usage](https://github.com/zouxiaoyang/dsh-commandcode-usage) 是一个**侧边栏 footer 面板**。本插件是不同的形态:**composer 输入栏内的内联薄徽章**(`conversation.input.right` slot,紧贴 model select),不占侧边栏空间、不打断对话流,打开浮层才展示明细。两者定位互补。 ## 数据来源 纯客户端插件。复用 [@mars-sea/dsh-commandcode-provider](https://github.com/Mars-Sea/dsh-commandcode-provider) 已 mount 在浏览器 `remote` 服务上的 `commandcode/report` Remote(`accounts[].report.credits.fiveHour / .weekly` + `.plan` + `.account`),**不自己直连 Command Code API,不接触你的 API key**。 前置依赖: 已安装并启用 `@mars-sea/dsh-commandcode-provider`。 ## 安装 ```sh dsh plugin add github:345420242/dsh-commandcode-usage-inline ``` 然后重启 DSH 即可。 ## 卸载 ```sh dsh plugin remove dsh-commandcode-usage-inline ``` ## 与 dsh-musage 的关系 [dsh-musage](https://github.com/Thedeergod666/dsh-musage) 支持 MiniMax / DeepSeek / Kimi / OpenRouter / Zhipu 五家,遇到 `commandcode` 时无法显示数据。本插件补上这块:`commandcode` 激活时显示真实用量,其它 provider 时自己隐藏,两者共存不冲突。 ## License MIT
Install
dsh plugin --profile web add github:345420242/dsh-commandcode-usage-inline
Profile: web
With the hub plugin installed, ask your agent to install it by name — it resolves the same plan shown here.
dsh plugin --profile web add github:stvlynn/dsh.fish#path:packages/dsh-plugin-hub
install dsh-commandcode-usage-inline from the hub
- This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.