返回插件市场

dsh-bottom-info-bar

监控与用量

songoao25/dsh-bottom-info-bar

DeepSeek Harness 的底部信息栏,单行显示提供商/模型、实时余额、峰谷定价及倒计时、真实会话花费。

  • awesome-dsh-plugin
  • balance
  • deepseek-harness
  • deepseekharness
  • dsh
  • dsh-plugin
  • dsh-plugins
  • plugin
  • usage-tracking
  • web
GitHub Stars
28GitHub
浏览量
0DSH Plugin Hub
Forks
2GitHub
开放问题
3GitHub Issues
Manifest 版本
1.9.2dsh-bottom-info-bar
最近推送
2026年9月2日GitHub
许可证
MITJavaScript
插件类型
Host + Client同时运行于 Host 与 Web Client

验证与兼容性

这里展示目录实际采集到的证据;未声明的信息会明确标为未知。

运行时已验证
01精确来源: npm · dsh-bottom-info-bar@1.9.202验证时间: 2026年9月3日03验证版本: 0.1.0-rc.7
当前版本兼容性
已在当前目录版本验证
声明的 Harness 范围
未声明
声明的平台
未声明
适用 Profile
web
构建授权
未检测到需要
权限声明
未声明
外部服务
未声明
遥测声明
未知
未发现已知风险标记

这不是安全背书;安装前仍应查看源码、权限和配置。

查看证据与判定范围

验证仅覆盖标出的来源、版本和 Harness 环境,不代表未来版本仍然兼容。

  • dsh-bottom-info-bar@1.9.2
  • 插件已在隔离环境完成加载检查。

README

查看源文件

Bottom Info Bar

English | 中文

License: MIT Release Last commit CI

The best-adapted bottom info bar for DeepSeek Harness, and a drop-in replacement for the native stats row under the composer. It shows live balance and subscription quota (ChatGPT & OpenCode Go) at a glance, alongside provider & model, peak/off-peak pricing, and real spend — smart and concise, conflict-free, and native in look and feel: it auto-detects the billing mode, replaces the native row instead of duplicating it, and matches the model switcher exactly. Install once; it activates automatically on every launch.

Preview

Bottom Info Bar preview: ChatGPT subscription, DeepSeek API, and OpenCode Go subscription

From top to bottom, the combined screenshot shows ChatGPT subscription, DeepSeek API, and OpenCode Go subscription. Each account is shown in full view followed by compact view.

Features

  • Dual-mode billing bar — Auto-detects whether the active provider is subscription-based (Codex / OpenCode Go) or balance-based. The two modes replace each other, never overlap; balance mode stays exactly as before.
  • Three-state billing bar — Auto-detects whether the active provider is subscription-based (quota windows: Codex / OpenCode Go / Zhipu / Xiaomi MiMo Token Plan), cloud-billing-based (this month's real bill: Together / Fireworks / AWS Bedrock / Cloudflare), or balance-based. The three modes replace each other, never overlap; balance mode stays exactly as before.
  • ChatGPT subscription card (pure local) — When the active provider is ChatGPT / Codex, the bar decodes ~/.codex/auth.json locally and shows the real plan tier + expiry date, e.g. ChatGPT · Plus | 到期 2026-09-16 — zero network, real fields straight from OpenAI's own login token (chatgpt_plan_type / subscription_active_until), no local estimation. Not signed in → "not bound" hint. Binding, token refresh and the openai-codex model route are not part of this plugin — install the companion plugin dsh-chatgpt-subscription (separate repo) to bind your ChatGPT account; this bar only reads the token.
  • Subscription quota display (OpenCode Go / Zhipu / Xiaomi MiMo Token Plan) — When the active provider is a subscription service, the bar shows the subscription service · model (e.g. OpenCode Go · V4 Flash, 小米 MiMo · Mimo-V2.5), the 5-hour / weekly / monthly quota remaining per window (remaining = 100 − used), and a countdown to the next reset (e.g. 距重置 1d 21h). Quota and countdown always match — both come from the same window. Quota sources:
    • OpenCode Go — reads quota from opencode.ai/zen/go/v1/usage via OPENCODE_GO_API_KEY (Settings → Models) or the opencode CLI login (~/.local/share/opencode/auth.json); missing key → "not configured" hint instead of an error.
    • Zhipu (zai / zai-coding-cn) — reads GLM Coding Plan quota via ZAI_CODING_CN_API_KEY (fallback: ZAI_API_KEY); shows plan tier + 5-hour window remaining.
    • Xiaomi MiMo Token Plan — reads monthly Credits quota via XIAOMI_TOKEN_PLAN_CN/SGP/AMS_API_KEY per region (fallback: XIAOMI_API_KEY); shows plan name + monthly window.
  • Cloud-billing display (real monthly bill) — When the active provider is Together / Fireworks / AWS Bedrock / Cloudflare, the bar reads the official billing API and shows this month's real spend, e.g. Together | 本月 $12.34, AWS Bedrock | 本月 $45.60 · 预算 46%. Cloudflare additionally shows daily free-quota remaining and a UTC-midnight reset countdown only when the API actually reports a free allowance (otherwise it shows real usage only — never fabricated). All bill figures come from official provider APIs; no local estimation is ever displayed. Missing keys → "not configured" hint.
  • Drop-in replacement — Replaces the native stats row while keeping its core original information (turns/steps, LLM latency, tool calls, cache hit rate, in/out tokens) with a native-consistent layout. Speed metrics (TTFT, tok/s) move to the hover tooltip so the row stays on a single line.
  • Provider & model detection — Always shows provider and model separately, exactly as in the DSH LLM catalog (for example, DeepSeek · V4-Flash). The provider is bold; when a catalog model name repeats its provider prefix, only that duplicate prefix is removed from the model part.
  • Live balance — Fetches real balance from DeepSeek's /user/balance API, auto-refreshes every 60 s, and keeps the last known snapshot on failure so usage is never interrupted.
  • Peak / off-peak pricing — Shows peak (alert red, bold) and off-peak (green, bold) prices with a countdown to the next switch; hidden automatically for providers without tiered pricing. The text labels remain visible in both appearances.
  • Real spend tracking — Records every llm/stream request (usage × unit price) and aggregates precisely by this session (includes subagents) / today / this month / all time. Subagents share the same provider account, so their records are folded into the current session's spend (session starts at the earliest record of the current session, then every same-account record from that moment on counts). Records are persisted to disk — nothing is lost on restart.
  • Bold numbers — Balance, countdown, spend, and all stats are rendered with bold numerals for instant readability.
  • Full / compact toggle — Click the bar to switch between two strict modes (debounced).
  • Low-balance alert — When the balance drops below ¥20, its amount and adjacent status turn alert red.
  • Real data only — The bar only ever shows balances / quotas / plans / bills returned by each provider's official API; local spend estimation is never displayed.
  • 「Info Bar」settings page (v1.9) — A new page in the settings panel: every field can be toggled independently (provider · model included; hiding all removes the bar entirely), grouped into Native (DSH's original stats) and Plugin sections; per-field custom colors (preset palette / system color input / hex), auto-adapted for both light and dark themes; dedicated Reset labels and Reset colors buttons; all settings persist across restarts (compact mode now persists too).
  • Stays fast over months (v1.9) — Ledger details auto-archive into summaries and stats are computed incrementally, so bar refreshes never slow down with usage; ledger file permissions are hardened automatically on startup.

Supported Providers (v1.7)

The bar auto-detects your provider from the DSH model catalog — zero configuration needed. Just set up your API key in DeepSeek Harness (Settings → Models), and the bar recognizes it immediately.

Balance-based providers

ProviderDisplay NameCredential KeyBalance API
deepseek / deepseek-officialDeepSeekDEEPSEEK_API_KEYOfficial API
openaiOpenAIOPENAI_API_KEYEstimated (no public API)
moonshotai / moonshotai-cn / kimi-codingKimiMOONSHOT_API_KEY (fallback: KIMI_API_KEY)Official API
openrouterOpenRouterOPENROUTER_API_KEYOfficial API
stepfunStepFunSTEPFUN_API_KEYOfficial API
xiaomiXiaomi MiMoXIAOMI_API_KEYOfficial API

Subscription-based providers (quota windows)

ProviderDisplay NameToken Source
codex / chatgpt / openai-codexChatGPT / Codex~/.codex/auth.json (read-only; local JWT decode → plan + expiry)
opencode-go / opencodeOpenCode GoOPENCODE_GO_API_KEY or opencode auth.json
zai / zai-coding-cnZhipu (智谱)ZAI_CODING_CN_API_KEY (fallback: ZAI_API_KEY)
xiaomi-token-plan-cn / -sgp / -amsXiaomi MiMoXIAOMI_TOKEN_PLAN_CN/SGP/AMS_API_KEY (fallback: XIAOMI_API_KEY)

Cloud-billing providers (real monthly bill)

ProviderDisplay NameCredential KeyBilling API
togetherTogetherTOGETHER_API_KEYOfficial Usage API (month spend)
fireworksFireworksFIREWORKS_API_KEYOfficial Billing API (period spend)
amazon-bedrockAWS BedrockAWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEYAWS Cost Explorer + Budgets (month spend + budget %)
cloudflare-ai-gateway / cloudflare-workers-aiCloudflareCLOUDFLARE_API_KEY + CLOUDFLARE_ACCOUNT_ID (Token needs Billing read)Billable Usage API (Alpha, real usage)

Unadapted providers: If your provider is not in the list above, the bar shows an "未适配" (Not adapted) hint instead of displaying another provider's data.

Requirements

  • DeepSeek Harness (dsh CLI) installed and used via the web interface (dsh web)
  • pnpm (used by dsh plugin)

Installation

Option 1 — One-command script (recommended)

git clone https://github.com/songoao25/dsh-bottom-info-bar.git
cd dsh-bottom-info-bar
./install.sh                # installs to the "web" profile; use --profile <name> to override

Option 2 — NPM package (recommended for future updates)

dsh plugin --profile web add dsh-bottom-info-bar

To update later:

dsh plugin --profile web update dsh-bottom-info-bar --latest

Option 3 — dsh plugin command from a local checkout

git clone https://github.com/songoao25/dsh-bottom-info-bar.git
dsh plugin --profile web add /path/to/dsh-bottom-info-bar/plugin

Restart dsh web after installing or updating. Plugins are composed when the host process starts; a page refresh alone is not enough.

For detailed installation, troubleshooting, and upgrade instructions, see docs/INSTALL.md.

Usage

  • Hover the bar for details: balance, per-token pricing, next price-switch time, and this-conversation spend (today / this month / all time).
  • Click the bar to toggle between full and compact modes.
  • Version reminder: once per full DSH startup, the plugin checks NPM; if a newer version exists, it shows a red ↑ vX.Y.Z label. The label only reminds you and never updates code automatically; tell an Agent with local terminal access to help update it.

Configuration

  • API key: configure the DeepSeek API key under Settings → Models (environment variable DEEPSEEK_API_KEY). Without it, the plugin shows a hint and every other feature keeps working.
  • Data scope: in Beijing time, peak hours are 09:00–12:00 and 14:00–18:00 on weekdays; Saturday and Sunday use off-peak prices all day. Built-in pricing covers DeepSeek V4 models plus OpenAI reference prices; models not in the table are excluded from spend statistics.
  • Mode: the bar switches automatically between balance mode and subscription mode based on the active provider (codex / chatgpt / opencode-go / opencode / openai-codex → subscription; everything else → balance). An internal billingMode: 'auto' | 'balance' | 'subscription' setting (default auto) allows forcing a mode.
  • Subscription sources:
    • ChatGPT (Codex): install the companion plugin dsh-chatgpt-subscription (separate repo) and bind your ChatGPT account once — it maintains the token in ~/.codex/auth.json (mode 0600) and registers the ChatGPT models. This bar only reads that token to fetch quota (chatgpt.com/backend-api/wham/usage); it never refreshes, writes back, or injects credentials. Without a token the bar shows a "not bound — install dsh-chatgpt-subscription to authorize" hint; an expired token shows a "re-bind" hint.
    • OpenCode Go: set OPENCODE_GO_API_KEY under Settings → Models, or log in with the opencode CLI (writes the opencode-go entry in ~/.local/share/opencode/auth.json). Without a key the bar shows a "not configured" hint instead of an error.

ChatGPT subscription: known limitations

  • The chatgpt.com backend is an undocumented interface — it may change or stop working at any time; failures degrade gracefully (last snapshot kept, auto-retry), never a crash.
  • Available models depend on your subscription plan; model access is provided by the companion plugin dsh-chatgpt-subscription.

Data storage (plugin-owned directory)

All spend data lives in the plugin's own data directory, isolated from other plugins and DSH configuration:

~/.dsh/dsh-bottom-info-bar/
├── usage-records.json           # the complete, human-readable bill to open
├── usage-records.journal.jsonl  # recovery journal; do not edit manually
└── usage-records.json.bak       # previous complete snapshot for recovery
  • Location: ~/.dsh/dsh-bottom-info-bar/ (directory mode 0700, file mode 0600 — readable only by the current user).
  • Override: set the environment variable DSH_BOTTOM_INFO_BAR_DATA_DIR to relocate the whole data directory (e.g. an external drive or a synced folder).
  • View and migrate: open usage-records.json in any text editor to inspect every recorded model response. To back up or move to another computer, copy the entire ~/.dsh/dsh-bottom-info-bar/ directory while DSH is closed.
  • Contents: one entry per model response (id / ts / model / provider / sessionId / input / cacheRead / cacheWrite / output / currency / cost / status). status is completed or interrupted; an interrupted response can still have confirmed billable usage. The billed price is fixed when the response completes, so later price-table updates never rewrite historical totals. Unknown-price models keep their token usage with pricingStatus: "unpriced" and are not given an invented cost. No conversation content, prompts, or API keys are ever stored.
  • Durability: the journal is synchronously confirmed before the UI includes a new bill. If that write fails, the bar says “账单未保存” and the amount is not added. The readable JSON snapshot is rebuilt in the background; if it is damaged after an interruption, the last good snapshot and every intact journal line are recovered automatically. Do not manually edit the journal or backup file.
  • Retention: no silent entry cap. Keep the directory in normal user backups if you need long-term retention beyond this machine.
  • Spend scope: money is aggregated only in the active provider's currency (CNY for DeepSeek, USD for the OpenAI reference prices); records in other currencies are not mixed in. Models absent from the pricing table remain visible in the ledger but are excluded from money totals.
  • Reset: delete the whole ~/.dsh/dsh-bottom-info-bar/ directory to clear all statistics. Uninstalling the plugin does not delete your data.

Uninstall

cd dsh-bottom-info-bar
./uninstall.sh                       # remove the plugin only
# or: dsh plugin --profile web remove dsh-bottom-info-bar

ChatGPT subscription (binding & token maintenance) is owned by the separate plugin dsh-chatgpt-subscription; uninstalling this info bar does not touch it.

After restarting, the native stats row returns automatically with no residue (the ledger file under ~/.dsh/dsh-bottom-info-bar/ is your data and is kept; remove it manually if you want to reset the statistics).

FAQ

SymptomFix
Bar does not appear after a page refreshRestart dsh web (the host process loads plugins)
Balance shows "DEEPSEEK_API_KEY not configured"Add the key under Settings → Models
Balance shows "刷新失败" while a balance remains visibleTransient network/key issue; retries automatically after 60 s. The last successful data is kept so the bar never goes blank. Hover over the warning for a detailed explanation and retry timing.
Shows "OpenCode Go not configured"Add OPENCODE_GO_API_KEY under Settings → Models, or configure OpenCode Go in the opencode CLI
How do I bind my ChatGPT subscription?Install the companion plugin dsh-chatgpt-subscription and authorize on the official page — it maintains the token this bar reads for quota display
ChatGPT quotas look wrong or emptyThe wham endpoint is undocumented and may change; failures keep the last snapshot and retry every 60 s. Hover over 刷新失败 to see the retry explanation.
Why does compact mode show a different window?Compact mode prioritizes the shortest-duration window (5-hour > weekly > monthly) because it refreshes fastest. If the 5-hour window is unavailable, it falls back to weekly or monthly. Quota and countdown always match — both come from the same window.
Why is the model's reasoning process not shown?DSH does not render the model's internal reasoning in the UI — a DSH interface-layer limitation, not the plugin's
Want the original stats row backUninstall the plugin and restart

Development

  • Source: plugin/src/host.js (host) + plugin/src/client-bundle.js (client)
  • Build: cd plugin && npm run build (generates lib/)
  • Test: node tests/run-all.mjs

License

MIT © 2026 songoao25

评论

0
最新优先