overact/dsh-statusline-plus ↗★ 0
dsh-statusline-plus
在状态栏显示余额、额度、Git状态及TPS等 适合需要实时监控API用量、额度、Git状态和流传输速度的用户。
安裝
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:overact/dsh-statusline-plus說明文件
閱讀完整 README ↗⚙️ Configuration
Settings can be managed directly in DSH Web → Settings → Statusline (状态栏) or persisted in settings.yaml under statusline-plus:
| Option | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Enable or disable the statusline plugin |
quotaAuto | boolean | true | Automatically select quota source based on active provider |
quotaOnStep | boolean | true | Shared step refresh preference for every quota source |
showDeepseekPeak | boolean | true | Show peak/off-peak for direct DeepSeek billing routes |
deepseekPeakCountdown | boolean | true | Show the local peak/off-peak countdown |
showCodexQuota | boolean | true | Show Codex quota when active |
showOpenCodeQuota | boolean | true | Enable OpenCode quota in automatic and manual selection |
showAntigravityQuota | boolean | true | Show Anti Gravity quota when active |
antigravityAccount | string | "" | Specific credential filename (empty = auto by priority) |
showGit | boolean | true | Show Git repository status badge |
showTps | boolean | false | Show streaming estimate and settled TPS |
showContext | boolean | true | CTX used tokens / capacity; native percentage ring comes last in native stats on the left |
showActivity | boolean | true | Show direct child agent activity |
showTools | boolean | true | Show real pending tool activity in a known running session |
showCost | boolean | true | Show the session cost reference amount |
componentOrder | array | git, context, tps, cost, activity, tools | Plugin bottom component order; missing IDs append and stale/duplicate IDs are removed |
cacheTtlMs | number | 60000 | Successful quota result reuse time; UI uses seconds, effective minimum 15s |
providers | array | Built-in sources | Provider overrides and custom balance / window endpoints |
DeepSeek works automatically for direct deepseek / deepseek-official sessions using the existing DSH DEEPSEEK_API_KEY credential. Kimi and Z.ai require their Coding Plan credentials. Provider rows let you change the credential reference and enable a source. One shared switch controls step refreshes for all accounts. Legacy mixed per-account preferences start with automatic step refresh off until you choose a shared value. Keys stay in DSH credentials on the Host.
Every source card includes an Enabled/Disabled preference badge, including Codex, Antigravity and OpenCode. Enabled text uses a soft theme-aware green; Disabled retains the neutral color. This is permission to display the source, not proof of login, valid credentials or current selection. Every card has an independent slider switch; enabling it opens its configuration automatically. Disabled sources keep their account settings.
The advanced cache and request-timeout settings are displayed in seconds (cache default 60, minimum 15; timeout default 10, 1–60), while configuration still stores milliseconds. Number fields commit on blur or Enter: out-of-range values clamp, blank or invalid input restores the saved value. TTL controls result reuse, not periodic polling: with step refresh enabled, a step requests the current quota and the Host reuses a fresh result; becoming visible also queries through cache. Expiry alone makes no request. All source types honor the cache on automatic steps; manual clicks bypass successful cache, while rate-limit/error backoff remains enforced. Concurrent requests for the same quota share one Host request. Shorter reuse times improve freshness at the cost of more upstream calls; supplier accounting may still update later.
| Source ID | Credential reference | Billing provider IDs |
|---|---|---|
deepseek | DEEPSEEK_API_KEY | deepseek, deepseek-official |
kimi-code | KIMI_API_KEY | kimi-coding, kimi-code, kimi-for-coding |
zai | ZAI_API_KEY | zai, z.ai, zai-coding-plan |
zhipu | ZAI_CODING_CN_API_KEY | zai-coding-cn, zhipu, zhipu-coding, glm-coding, bigmodel |
Built-ins match the billing provider, so a DeepSeek/Kimi/GLM model routed through OpenRouter keeps showing OpenRouter quota. Existing OpenRouter-only configurations gain the new presets automatically; partial overrides such as { id: deepseek, enabled: false } are supported. Step refreshes respect the Host cache; opening a badge forces one refresh. Missing or invalid quota stays unknown.
Peak calculation uses Beijing time (UTC+8): weekdays excluding Chinese public holidays, 09:00–12:00 and 14:00–18:00 are peak windows. Other hours, weekends and holidays are off-peak at half the peak price. The built-in calendar covers 2025–2026; an uncovered year's possible weekday peak remains unknown, and the next peak is never guessed across an uncovered year. Peak display has its own toggle and works when balance display is disabled. It uses no API calls or credentials. Disable the standalone dsh-peak-indicator row after migration to avoid duplicate indicators; its source and browser preferences can be retained. This integrated mode follows the official schedule and native statusline settings.
Kimi international accounts can override kimi-code.endpoints with url: https://api.kimi.ai/coding/v1/usages and parse: { mode: kimi-usage }. Each Z.ai region uses its own endpoint and raw Authorization, following the official quota-query script. These Coding Plan interfaces may change independently of model APIs; ordinary Moonshot API wallet balances and monthly MCP tool-call budgets are outside this display.
Cost estimates first read the running Host's @earendil-works/pi-ai/providers/all public catalog, retaining only vendor input/output/cache prices and context tiers. Model matches are cached; there is no online pricing query or polling. OpenCode Go, Codex and other subscriptions use the underlying model vendor's public API reference price, independent of their own subscription/gateway rate cards or quota rules. Verified model aliases identify the model without guessing another version. All-zero catalog placeholders remain unknown. Sparse fallbacks cover GPT-6.1 Sol and Claude Sonnet 5.5 (official prices verified 2026-10-04), plus the existing DeepSeek CNY snapshot (2026-10-02 04:24:12 UTC) when native coverage is absent. Fallback use is identified in details. USD and CNY accumulate separately without exchange-rate conversion. Current catalog prices value historical usage as a reference, not a historical invoice; the DeepSeek CNY fallback still excludes records before its verification cut. Missing usage, unknown cache rates or models remain unpriced with a reason; a subtotal retains the unpriced count. The catalog date/version and record counts are shown in details. Catalogs may lag vendor updates; catalog changes invalidate native checkpoints on the next Host load. Custom endpoint bills, subscription charges, tools, cache TTL/storage fees, child sessions and inherited fork history are outside this estimate.
The compact cost panel uses the statusline context panel's segmented bar and matching color legend to show uncached Input, Cache (reads + writes), and Output token counts, amounts and shares of the priced subtotal. Counts use K/M notation, with exact values on hover; unpriced requests are excluded, and older Hosts show — until reloaded. Amounts display two decimals while accounting retains integer precision. Range shares and bar widths use interval midpoints and show ≈; currencies stay separate. Source metadata and pricing explanations appear in the ⓘ hint. Breakdown values and token counts are accumulated during native usage settlement, without scanning session history when the panel opens. The 224px panel keeps table headers accessible while hiding them visually to save height.
Automatic Git refreshes share in-flight work and coalesce bursts into a one-second trailing refresh; manual clicks bypass the delay and the Host's one-second snapshot cache. Hiding/unmounting or changing the session/workspace cancels pending work. SSH bridge changes invalidate cached snapshots. Collapsed Subagents use only compact running-state keys and cached baseline membership sets; hidden pages skip selectors, and an open panel reads model/effort/timing only for up to twelve visible children. The cost wire carries session totals and breakdowns without duplicating unused per-turn amounts.
DeepSeek reference pricing reuses the peak indicator's windows and locally cached holiday calendar, applying the tariff at each request's time on every channel. The pricing projection takes a compact, stable calendar snapshot at Host load; it retains only windows, holiday dates and rule status, and adds no fetch. A changed calendar invalidates checkpoints on the next load. Crossing a possible tariff boundary gives a range; unknown years or an official-rule mismatch stay unpriced. The indicator can refresh its existing cache independently. Kimi aliases k3 / k3-256k and kimi-for-coding-highspeed map to their vendor model IDs; the rolling kimi-for-coding alias is not assigned an older model's price (official model identities).
The Subagents chip shows finished/total from the full native catalog; expired detail rows still count toward progress, and unknown children are excluded from the numerator. The entire chip hides when all finished detail rows expire. Subagents uses native subagentCatalog, independent session status, subagentTiming and modelSelection.lastUsed; missing state never becomes “stopped,” and a model or reasoning effort selected for a future request is not presented as already used. Its compact panel gives each title the full row (up to two lines), with smaller model/effort and status/timing rows, and caps list height. Missing effort metadata stays hidden. Each stop observed by the Client starts a 5-second fade / 15-second expiry, without modifying the native catalog or session history. One deadline timer serves all stopped children and pauses while hidden; active or unknown children remain visible. Tool activity uses the statuslineToolActivity native replayable projection; it excludes inherited fork history and stops its local elapsed clock when hidden or no calls remain pending. Quota age means successful retrieval time, not the provider's internal accounting update time. Its expiry matches the Host's effective cache TTL (at least 15 seconds) and adds no account polling.
The component approach takes inspiration from ccstatusline's widgets and Claude HUD's bounded activities, adapted to the DSH Web slots. No external layout plugin is installed.