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

dsh-opencode-usage-panel

v0.1.0

Published

DeepSeek Harness panel that shows local OpenCode token usage: today, last 7 days, model mix, projects and recent sessions. Tuned for the OpenCode Go subscription.

Readme

OpenCode usage panel for DeepSeek Harness

A DeepSeek Harness Web plugin that shows how much of your OpenCode Go subscription the Harness has consumed — today, the last 7 days, a configurable window, the model mix, the project split, a 14-day chart and your most recent sessions — in a compact strip docked at the right end below the chat composer.

The Harness reaches OpenCode Go through its own LLM provider, so the numbers come from the token usage the Harness records on every assistant message (ctx.sessionQuery), not from the OpenCode CLI database. Every figure is a plain sum of assistant/message usage records for the configured provider; nothing is estimated and nothing leaves the machine.

Install

npm install dsh-opencode-usage-panel

The package ships a cordis.patch.yml that inserts one entry:

- insert:
    - id: opencode-usage
      name: dsh-opencode-usage-panel
      config: {}

Configuration

Optional fields on the row's config:

config:
  provider: opencode   # LLM provider id counted as OpenCode usage (default: opencode)
  days: 30             # history folded into the totals (1-3650)
  chartDays: 14        # days in the bar chart (3-90)
  recentSessions: 8    # recent sessions listed (1-50)
  cacheMs: 15000       # host-side snapshot cache

When the configured provider id matches nothing, the panel falls back to every provider and says so in the footer tooltip.


OpenCode 用量面板

在 Harness 输入框右下方显示 OpenCode Go 订阅的消耗情况:今日 / 7 天 / 近 N 天的 token、输入输出与缓存明细、最近 14 天柱状图、模型占比、项目分布和最近会话。

Harness 是通过自己的 LLM provider 走 OpenCode Go 的,所以数据取自 Harness 自己记录的会话用量(每条 assistant 消息的 usage,经 ctx.sessionQuery 汇总),不是 OpenCode CLI 的 opencode.db。所有数字都是逐条消息相加,不做估算,也不发送到本机以外。

显示内容

  • 收起状态:今日、7 天、近 N 天 三个 token 数字,点一下展开;整块贴在输入框下方最右侧。
  • 展开状态:近 5 小时 / 今日 / 7 天 / 近 N 天;输入、输出、推理、缓存明细;每日柱状图;模型占比;项目分布;最近会话;刷新按钮。
  • 每 60 秒自动刷新;宿主机侧快照缓存 15 秒,并按每条会话的最后事件号做增量折叠,没变化的会话不重复解析。

配置(可选)

config:
  provider: opencode   # 算作 OpenCode 用量的 provider id,默认 opencode
  days: 30             # 折叠多少天,默认 30
  chartDays: 14        # 柱状图天数,默认 14
  recentSessions: 8    # 最近会话条数,默认 8
  cacheMs: 15000       # 宿主机缓存毫秒

provider 匹配不到任何记录时,会退回统计全部 provider,并在底部提示里标注。

License

MIT