DSH developers invoking Command Code models often need to monitor quota usage continuously. Existing sidebar solutions can take up space, and some plugins do not support this Provider. This plugin provides a compact one-line status overview on the right side of the Composer input bar; clicking it expands details without interfering with the main interface layout.
Features¶
- Follows the current model: The badge is displayed only when the current session’s provider is
commandcode; it automatically hides when switching to another model. - One-line overview: The badge format is
CC 5h X% | Week Y% | Remaining N. Here,5hindicates the 5-hour window usage percentage,Weekindicates the weekly window usage percentage, andRemainingindicates the remaining credits (purchased + free). If any window exceeds its limit, the corresponding value turns red. - Click to expand a detail popover: A detail window pops up upward, showing the same content as the model selection popover, including the current account (marked with a green dot when multiple accounts exist), plan name, window reset countdown, remaining credit breakdown (monthly subscription + purchased + free), and per-window usage for other configured accounts. It provides refresh and close buttons.
- Automatic polling every 60 seconds: The plugin automatically refreshes data every 60 seconds. If a request fails, the badge text turns yellow
CC ⚠; click to view the error message and retry manually. - Hover feedback: When the mouse hovers over the badge, the pill-shaped background shows a feedback effect.
Prerequisites and Data Source¶
This plugin is a pure client-side plugin and does not connect directly to the Command Code API, so it never touches the user’s API key. It reuses the commandcode/report data source mounted on the browser’s remote service by @mars-sea/dsh-commandcode-provider (including the accounts[].report.credits.fiveHour, .weekly, .plan, and .account fields).
Before use, make sure @mars-sea/dsh-commandcode-provider is installed and enabled.
Installation and Enablement¶
The installation command is:
dsh plugin add github:345420242/dsh-commandcode-usage-inline
After installation, restart the DSH application for the changes to take effect.
Ecosystem Relationship¶
- Complements the sidebar plugin version: The listed plugin
zouxiaoyang/dsh-commandcode-usageis a sidebar footer panel, while this plugin is an inline badge inside the Composer input bar. They have different purposes and do not occupy sidebar space. - Coexists with dsh-musage:
dsh-musagedoes not support Command Code data. This plugin fills that gap: it displays real usage when Command Code is active and automatically hides for other providers, allowing both to coexist.