DeepSeek Harness plugin

ui-theme-quota-show

DeepSeek Harness web UI plugin: a sidebar card above Settings that shows the live DeepSeek API balance (total / topped-up / granted, period usage, low-balance warning) from the official GET

Jump to install

Source facts

Repository
wwxiaoqi/ui-theme-quota-show
Latest update
Aug 15, 2026
Category
UI Enhancements
GitHub stars
0
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/wwxiaoqi/ui-theme-quota-show
Plugin: ui-theme-quota-show
Author: wwxiaoqi

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer3 files
README.mdSource · read only

ui-theme-quota-show

A DeepSeek Harness web UI plugin that adds a DeepSeek API balance card directly above the Settings trigger in the sidebar. It reads the official GET /user/balance endpoint, shows the remaining balance plus its top-up/granted breakdown, and refreshes automatically every 60s.

![SHOW](./pic.webp)

Features

  • Live remaining balance (total_balance), big number, with a low-balance red warning (lowBalanceThreshold, default 5).
  • Breakdown of top-up (topped_up_balance) and granted (granted_balance) balance.
  • Update time and period usage (the balance delta since the card loaded — the same key's total across all clients).
  • 60s auto-refresh + a manual refresh button; a failed refresh keeps the last good value (stale-while-error).
  • Collapsed-sidebar (rail) mode collapses to a 32px round button — ¥ normally, ! when balance is low — and clicking it expands the sidebar.
  • No new secret: the API key is reused from the existing DEEPSEEK_API_KEY credential (written by Settings → Models, stored in ~/.dsh/.credentials.yaml), resolved on the host and never sent to the browser.

Quick start

One-click script (recommended)

Clone and run the installer — it checks that dsh is on your PATH, links the plugin into your web profile with link:, and prompts you to restart:

git clone https://github.com/wwxiaoqi/ui-theme-quota-show.git
cd ui-theme-quota-show

# Windows (PowerShell)
.\scripts\install.ps1

# macOS / Linux
bash ./scripts/install.sh

Then restart dsh web (the client module system only picks up a new plugin on restart).

Developer iteration (link mode)

No build step, no npm dependencies — just link your checkout:

cd ui-theme-quota-show

# macOS / Linux
dsh plugin --profile web add "link:$PWD"

# Windows (PowerShell) — forward slashes; link: is required cross-drive
dsh plugin --profile web add "link:D:/path/to/ui-theme-quota-show"

Update / reinstall

dsh plugin --profile web remove ui-theme-quota-show
dsh plugin --profile web add "link:D:/path/to/ui-theme-quota-show"

Configuration

The base config lives in cordis.patch.yml under config.

FieldTypeDefaultMeaning
baseUrlstringhttps://api.deepseek.comBalance endpoint base; /user/balance is appended.
lowBalanceThresholdnumber5Main number turns red when total_balance falls to or below this amount (account currency).

> The DEEPSEEK_API_KEY credential is resolved per request through the credentials seam (the Models page writes it), falling back to the process environment when that seam is absent. A changed key reaches the next request without a restart.

Field semantics

DeepSeek's balance API is a prepaid-credit model — there is no "total quota" or "used" field. The card maps it faithfully:

ShownSource
Remaining balancetotal_balance (total available credit)
Total compositiontopped_up_balance (top-up) + granted_balance (granted)
Period usagebalance delta since the card loaded (approximation)
Update timetime of the last successful fetch

How it works

  • Host registers the route /ui-theme-quota-show/balance. Each request resolves DEEPSEEK_API_KEY through ctx.credentials (or process.env), calls GET https://api.deepseek.com/user/balance with Node fetch, and returns only normalized numbers — the key never reaches the browser.
  • Client registers into sidebar.footer.action (the row the sidebar shell renders directly above the Settings trigger), receives the wide column state, and renders the card (wide) or the 32px rail button (collapsed). It polls the host route every 60s with cache: no-store, keeping the last good snapshot on failure.
  • The rail button expands the collapsed sidebar through layout.toggleSidebar().

File layout

FileRole
index.jsHost half: balance route + credential resolution + upstream proxy
client.jsClient half: card + rail button + 60s refresh + state machine
cordis.patch.ymlBundle patch: inserts the row with base config
package.jsonDeclares dsh.bundle.patch and dsh.client

> client.js is hand-authored in the exact window.__ModuleLoader__.load format that the tsdown client-bundle preset emits (packages/client/tsdown.client.ts in the harness). If you migrate to a TypeScript/tsdown build, move it to src/client/index.ts plus a tsdown.config.ts.

License

[MIT](./LICENSE)