npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

opencode-ds-peak

v0.3.6

Published

Minimal opencode TUI sidebar dot showing whether DeepSeek is in peak or off-peak pricing, with a countdown to the next switch. Five languages.

Downloads

1,372

Readme

opencode-ds-peak

npm version npm downloads CI license

See whether DeepSeek is charging full or half price right now.

DeepSeek charges full price during peak hours and half price the rest of the time. This OpenCode TUI plugin adds a small live block to your sidebar showing the current price tier and how long until the next switch.

It runs with no configuration. The block follows your OpenCode language, uses DeepSeek's published schedule, and only appears in sessions that use a DeepSeek model.

Requirements

  • OpenCode 1.18.x or 2.0.x. The package ships both plugin shapes at once: the v1 TUI plugin (tui) and the v2 CLI plugin (setup). Each OpenCode release loads the entry it understands.
  • No Node or Bun setup. OpenCode installs npm plugins for you.

Verified against OpenCode 2.0.22 and 1.18.34. v2 support ships in opencode-ds-peak 0.3.0 and newer.

Install

One package serves both OpenCode lines. OpenCode 2.x reads the v2 CLI plugin entry; OpenCode 1.x reads the v1 TUI plugin entry.

OpenCode 2.x

opencode plugin add opencode-ds-peak

OpenCode installs the package, adds it to your global config, and loads it on the next start.

To keep the plugin CLI-only, so it also runs when the CLI is connected to a remote server, add the package to ~/.config/opencode/cli.json instead:

{
  "$schema": "https://opencode.ai/v2/cli.json",
  "plugins": ["opencode-ds-peak"]
}

OpenCode 1.x

opencode plugin opencode-ds-peak -g

Or add the entry yourself. Use ~/.config/opencode/tui.json for every project, or .opencode/tui.json for one:

{
  "$schema": "https://opencode.ai/tui.json",
  "plugin": ["opencode-ds-peak"]
}

Restart OpenCode, then open the sidebar with your leader key plus b (default ctrl+x, then b). The block appears above the built-in context section.

The block only appears in sessions that use a DeepSeek model. Open a session with any other model and the sidebar stays empty by design. If you are not sure it is working, run /peak.

Verify it works

Run /peak from the command palette. It reports the current tier and the next switch for any session, whether or not that session uses DeepSeek. If it opens, the plugin is installed.

For the sidebar block itself, open a session whose model id contains deepseek, then toggle the sidebar (leader + b).

Uninstall

On OpenCode 2.x, run opencode plugin remove opencode-ds-peak, or remove opencode-ds-peak from the plugins array in ~/.config/opencode/opencode.json or ~/.config/opencode/cli.json. On OpenCode 1.x, remove it from the plugin array in tui.json (global or project). Restart OpenCode.

If you set notify or changed the view or language through /peak, those choices are stored under the plugin's keys and can be cleared from OpenCode's key-value store.

Why

  • The switch is silent. DeepSeek changes price without notice. The block states the current tier so you do not have to track the schedule.
  • A countdown. The block shows the time until the next switch, so you can decide whether to wait.
  • Only for DeepSeek sessions. The block appears when the active session uses a DeepSeek model and hides otherwise.

Features

  • The status dot is green off-peak, red at peak, and yellow when peak starts within 30 minutes.
  • The countdown updates every 60 seconds. It shows whole days past 24 hours, whole hours past one, and minutes below that.
  • The wording follows the state. During peak it reads "in 3h"; during off-peak, "8h left".
  • A compact one-line mode. It drops the box and shows the dot with the label.
  • Chinese public holidays are off-peak. A built-in table covers 2026, and you can add your own dates.
  • The schedule is configurable. Override the peak windows, the weekdays, and the holiday list.
  • Optional notifications. A single toast appears when the price tier changes while a DeepSeek session is active, even when the sidebar is closed.
  • A /peak command. It shows the current tier and the next switch, and changes the view, the notifications, and the language.
  • Five languages: English, Polish, Spanish, German, and Chinese. The plugin detects your locale.
  • One package for OpenCode v1 and v2. The two entries share the same logic, so the sidebar, command and schedule behave the same on both.
  • No runtime dependencies. The i18n layer is hand-rolled and the package ships raw .tsx.

Schedule

Peak hours are 01:00 to 04:00 and 06:00 to 10:00 UTC, Monday through Friday. Everything else is off-peak, including weekends and Chinese public holidays.

The built-in holiday table covers China 2026. DeepSeek follows the Chinese holiday calendar, so a weekday holiday is off-peak. Add dates for other years through the schedule.holidays option, or turn the table off with schedule.builtinHolidays: false.

The label reads HOLIDAY only on a working-day holiday. On a holiday that falls on a weekend it stays OFF-PEAK, since the day is off-peak either way.

DeepSeek defines prices in UTC. The plugin computes the window in UTC and renders it in your local time zone, and it handles daylight saving. In Poland that works out to:

| Season | Peak (local) | Off-peak (local) | | ------------- | ------------------------------ | ---------------------------------- | | Summer (CEST) | 03:00 to 06:00, 08:00 to 12:00 | 12:00 to 03:00 + weekends/holidays | | Winter (CET) | 02:00 to 05:00, 07:00 to 11:00 | 11:00 to 02:00 + weekends/holidays |

Configuration

Every option is optional. These are the defaults:

| Option | Type | Default | Description | | ------------------------- | ---------- | -------------------------------- | ----------- | | locale | string | system locale | UI language. One of en, pl, es, de, zh. Detected from LC_ALL, LC_MESSAGES or LANG when omitted, falling back to en. | | view | string | box | box for the bordered block, line for a single compact line. | | notify | boolean | false | Show a toast when the tier changes while a DeepSeek session is active. | | schedule.days | number[] | [1,2,3,4,5] | Peak weekdays as ISO numbers, 1 for Monday through 7 for Sunday. | | schedule.windows | string[][] | [["01:00","04:00"],["06:00","10:00"]] | Peak windows as [from, to] HH:MM UTC pairs. Half-open, so to is the first off-peak minute. | | schedule.holidays | string[] | [] | Extra off-peak dates as YYYY-MM-DD UTC keys. | | schedule.builtinHolidays| boolean | true | Include the built-in China 2026 holiday table. |

A full example:

{
  "$schema": "https://opencode.ai/tui.json",
  "plugin": [
    [
      "opencode-ds-peak",
      {
        "locale": "pl",
        "view": "line",
        "notify": true,
        "schedule": {
          "days": [1, 2, 3, 4, 5],
          "windows": [["01:00", "04:00"], ["06:00", "10:00"]],
          "holidays": ["2026-12-25"]
        }
      }
    ]
  ]
}

Bad values fall back to the default for that field. A window or day list keeps its valid entries and falls back to the default only when none are valid. An empty window or day list means peak never applies, which turns peak off entirely. An invalid holiday date is dropped.

Command

Run /peak from the command palette. It opens a menu with the current tier and the next switch, plus settings:

  • Sidebar switches between box and line.
  • Notifications turns the transition toast on or off.
  • Language opens a list of the five UI languages.

The settings persist and override the matching config option.

Languages

English en, Polish pl, Spanish es, German de, Chinese zh. Pick a language from /peak; the choice persists and overrides the locale option. Otherwise the plugin detects your locale from the environment.

To add a language, see CONTRIBUTING.md.

Troubleshooting

The sidebar shows nothing. The block is hidden unless the active session uses a DeepSeek model. Open a session whose model id contains deepseek (for example deepseek/..., or a provider route that includes it). Also make sure the sidebar is open. Use leader key plus b by default. Running OpenCode with --pure disables all external plugins, so the block will not load.

I want to confirm the plugin is installed. Run /peak. It responds for every session, not only DeepSeek ones.

The countdown looks wrong. The schedule is defined in UTC and rendered in your local time zone; daylight saving is handled automatically. Check that your system clock and time zone are correct.

Holidays are wrong. The built-in table covers China 2026 only. Add other dates with schedule.holidays, or set schedule.builtinHolidays: false to ignore it.

Notifications do not appear. Turn them on in /peak. A toast appears only when the tier changes while a DeepSeek session is active.

My config changes do not apply. OpenCode reloads config on restart. A bad value falls back to its default without an error. On v1 the options live in tui.json. On v2 they live beside the plugins entry in opencode.json or cli.json.

FAQ

Does it work with DeepSeek through OpenRouter, or a self-hosted route? Yes. A model counts as DeepSeek when the provider id or model id contains deepseek, for example openrouter/...deepseek....

Does it make network calls or phone home? No. There is no network access, no telemetry, and no runtime dependency. The schedule is computed locally.

Can I turn peak pricing off, or use a different schedule? Yes. Override schedule.windows and schedule.days, or set both to empty arrays to turn peak off permanently.

Will it work on OpenCode v2? Yes, since 0.3.0. One package serves both the v1 and v2 plugin APIs. See Requirements.

How do I add a language? See CONTRIBUTING.md.

Support

Contributing

See CONTRIBUTING.md for the development workflow, how to add a language, and how releases are cut.

License

MIT