Introduction

The plugin ecosystem of DeepSeek Harness (DSH) aims to enhance the terminal interaction experience through modular extensions. In dsh-TUI, users often need to monitor account balances in real time, distinguish peak/off-peak billing windows, and track Token consumption. The dsh-peak-balance plugin addresses these issues by integrating a peak/off-peak clock, live balance, per-turn cost, and a GitHub-style Token history grid into the status bar and full-screen views. It is maintained by VviLliAm-qwq.

Core Features

This plugin provides the following capabilities in dsh-TUI:

  • Peak/off-peak billing clock: Displays the currently active billing window (e.g., weekdays 09:00-12:00) and a countdown to the next billing period. Weekends are entirely off-peak.
  • Provider-neutral readings: Reads the balance of the provider actually used by the current conversation (e.g., official balance, subscription quota, relay credit pool). If the provider does not expose a read interface, no value is displayed. For automatically routed sessions, it attempts to read the saved /model routing information.
  • Per-turn cost measurement: Displays the consumption from the previous turn. If the provider provides counters (e.g., command code credits, OpenRouter usage), it measures directly; otherwise it estimates from the rate card; if no rate is available, it shows unrated.
  • Quota diagnostics: Run the /quota command to view read status, adapter responses, failure reasons, and all discoverable provider routes. You can use /quota check <provider> to inspect a single provider.
  • Peak-time warning: During peak windows, the status bar can switch to a three-line warning box with a pulsing border and waveform animation, supporting seven colors.
  • History grid (/hist): Displays a full-screen GitHub-style contribution chart, where each square represents a day and color intensity represents usage. Keyboard navigation is supported.
  • Totals and model statistics: Displays totals for all historical data (Tokens, estimated cost, cache hit rate, etc.) and per-model breakdowns.
  • Custom rates (/th price): Sets rates for unlisted models; otherwise, an unrated marker is displayed.
  • Language synchronization: The status bar, history view, and command responses switch language instantly according to the TUI /lang setting.
  • Settings subpage: A “Token history” subpage with ten options is provided under the “Peak & Balance” card in /settings.

Installation and Enabling

Install using npm:

dsh plugin --profile dsh-tui add dsh-peak-balance

Or install directly from a local repository:

dsh plugin --profile dsh-tui add file:/absolute/path/to/dsh-peak-balance

The install command appends the plugin entry to dsh.profile.bundles. After installation, run /restart in dsh-TUI to load the new plugin; the settings card then appears under /settings.

Typical Usage

Example status bar display:

⚡ 峰时 09:00-12:00 · 距谷时 1h23m · 本轮 ¥0.0234 · 余额 ¥42.10

Enter the history grid:
* Shortcut: /hist (or /tokenhistory, alt+h, /th followed by a space).
* Navigation: ←/→ changes date, ↑/↓ changes week, m changes metric, w changes span, s changes subagent, r rescans, q or Esc closes.
* Custom rates: Follow /th price with the model name and price.

Check quota:

/quota check <provider>

Notes

  1. Installation method: Installing via symbolic links (link: protocol or directory junctions) is not recommended. Node.js resolves the actual path of the plugin, and @deepseek-ai/* dependencies must remain accessible. file: and npm installation keep a real directory copy in the configuration directory, which is the layout expected by the host.
  2. Updating files: If installed via file:, simply running add or update will not pick up changes to the local source code. You must remove the plugin first and then re-add it.
  3. Restart requirement: After installing or removing it, restart the TUI for changes to take effect.

Conclusion

dsh-peak-balance is a practical utility focused on billing monitoring and usage statistics. By simplifying complex data presentation into a status bar and grid within the TUI, it helps developers manage resources and costs more intuitively.

GitHub repository