ds-peak-warningx
v1.5.2
Published
DeepSeek peak/off-peak pricing warning in the opencode TUI sidebar
Maintainers
Readme
ds-peak-warningx
An opencode TUI plugin that shows DeepSeek's peak / off-peak pricing windows in your terminal, so you know when requests are more expensive.
DeepSeek charges more during peak hours. The default schedule follows their current billing rules: peak windows 01:00–04:00 and 06:00–10:00 UTC on weekdays, and fully off-peak weekends — evaluated by the Beijing calendar day. Every window can carry its own day-of-week pattern, so any weekday-based pricing rule can be configured.
Features
- Status dot — colored
● PEAK/● OFF-PEAK: red at peak, green off-peak, yellow when peak starts within 30 minutes. On v1 it sits next to the home prompt; on v2 it lives in the footer status row. The permanent(can freeze)note means the display can paint stale data after sleep or a timer stall — treat it as guidance. - Sidebar panel — current status, UTC + local time, next transition
across days, and per-window countdowns. Collapsible to a compact status
line from
/dspeak. /dspeak— in-app window management (add, remove, reset) with a live status header. Edits persist across restarts. Format:HH:MM-HH:MMin UTC, optionally restricted to weekdays (22:00-02:00,06:00-10:00 Mon-Fri,14:00-16:00 Sat,Sun). Days are Beijing calendar days; wrapping midnight is fine.- Peak guard (on by default) — asks for confirmation before DeepSeek
prompts go out during peak.
blockmode holds the prompt until confirmed;warnmode just toasts. One confirmation silences it for the cooldown (default 5 minutes,0= ask every time)./dspeak-confirmpre-confirms up front. Slash commands, shell mode, and typing are never blocked.
opencode v1 (requires >=1.18.29)
Install
From this repo (global):
git clone https://github.com/Bashar-AlGhada/opencode-ds-peak-warning ~/.config/opencode/ds-peak-warningx
cd ~/.config/opencode/ds-peak-warningx
npm installThen add it to ~/.config/opencode/tui.json (path relative to the config file):
{
"$schema": "https://opencode.ai/tui.json",
"plugin": ["./ds-peak-warningx/src/index.tsx"]
}Or via CLI: opencode plugin ~/.config/opencode/ds-peak-warningx -g.
Restart opencode.
From npm:
opencode plugin [email protected] -g # drop -g for per-project(Or in-TUI: ctrl+p → plugins → shift+i, type [email protected].)
Updating
opencode plugin [email protected] -g -f # keep -g if installed globallyThen restart opencode. Check npm view ds-peak-warningx version for the latest.
Options (tui.json)
{
"plugin": [["[email protected]", { "ranges": [
{ "start": "01:00", "end": "04:00", "days": [1, 2, 3, 4, 5] },
{ "start": "22:00", "end": "02:00" }
] }]]
}ranges— peak windows overriding the defaults.daysis 0 = Sunday … 6 = Saturday (Beijing day); omit for every-day windows. In-app/dspeakedits win and persist.order— sidebar slot order (default150).panel—false(or the/dspeaktoggle) collapses the panel to a compact status line.guard—{ "enabled": true, "mode": "block", "cooldownMs": 300000, "providers": ["deepseek"] }.
opencode v2
Same package, same features — one ./tui entry serves both generations.
Differences: the status dot lives in the footer status row, and settings
persist in v2 durable storage (v1 state does not carry over — v2 starts
once from options/defaults, then /dspeak edits persist).
Install
In cli.json (from npm):
{
"plugins": [{ "package": "[email protected]", "options": { "panel": true } }]
}Local checkout (point at the repo root):
{
"plugins": ["file:///path/to/opencode-ds-peak-warning"]
}Restart opencode.
Updating
Bump the pinned version in cli.json (or git pull a local checkout),
then restart opencode.
Options (cli.json)
Same options as v1 (ranges, panel, guard); order is v1-only.
Development
npm install
npm run typecheck # tsc --noEmit
npm run sanity # logic boundary checks
npm run pack # npm pack --dry-run, shows the published tarball contentsThe package targets the TUI via exports["./tui"] and ships raw .tsx source
(opencode's runtime transpiles it).
License
MIT
