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

@stalfh/opencode-hud

v0.2.2

Published

OpenCode TUI HUD plugin with visual context, usage, cache, spend, and model-flow dashboards.

Readme

OpenCode HUD

OpenCode TUI HUD plugin with visual context, token usage, cache, spend, model-flow dashboards, and AI-configurable settings.

Install

Local development install:

npm install -g "C:\\path\\to\\opencode-hud"

From npm:

npm install -g @stalfh/opencode-hud
opencode-hud install

npm install only installs the package and prints the next step. opencode-hud install explicitly enables both the TUI HUD and the server-side configuration tools, preserving existing settings and creating backups before changes.

Enable In OpenCode

The CLI configures these files automatically:

~/.config/opencode/tui.json       # TUI HUD display
~/.config/opencode/opencode.json  # server tools for AI configuration

To configure manually, add the plugin to both files.

~/.config/opencode/tui.json:

{
  "$schema": "https://opencode.ai/tui.json",
  "plugin": [
    "@stalfh/[email protected]"
  ]
}

~/.config/opencode/opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": [
    "@stalfh/[email protected]"
  ]
}

For local file testing, use:

{
  "$schema": "https://opencode.ai/tui.json",
  "plugin": [
    "file:///C:/path/to/opencode-hud/src/tui.tsx"
  ]
}

Restart OpenCode after changing plugins or configuration.

Useful CLI commands:

opencode-hud status
opencode-hud install
opencode-hud uninstall
opencode-hud config describe
opencode-hud config set sidebar.width 38
opencode-hud config template compact
opencode-hud config note "Today focus"
opencode-hud config validate

AI Configuration

After running opencode-hud install and restarting OpenCode, the package exposes server tools that OpenCode can use to configure HUD settings safely.

Example prompts inside OpenCode:

HUD 改成 compact,note 写“今天专注”,隐藏 git。
HUD 侧边栏宽度改成 38,只保留 note、identity、contextGauge。

The tools validate manifest-backed config paths and write user overrides to:

~/.config/opencode/opencode-hud.config.json

The assistant should use HUD tools instead of editing JSON manually. Changes may require restarting OpenCode because plugin configuration is loaded at startup.

User Configuration

The plugin reads user configuration from:

~/.config/opencode/opencode-hud.config.json

On Windows, copy the example config with:

Copy-Item "$env:APPDATA\npm\node_modules\@stalfh\opencode-hud\config\opencode-hud.config.example.json" "$env:USERPROFILE\.config\opencode\opencode-hud.config.json"

Sidebar Templates

Set sidebar.style to one of:

"cards"
"compact"
"plain"
"minimal"
  • cards: full continuous dashboard panel.
  • compact: dense multi-line summary.
  • plain: readable text list.
  • minimal: four-line critical status.

Sections

Reorder or remove sidebar sections using sidebar.sections:

"sections": [
  "note",
  "identity",
  "session",
  "contextGauge",
  "contextTrend",
  "tokenBreakdown",
  "cacheGauge",
  "spend",
  "modelFlow",
  "globalUsage",
  "modelUsage",
  "git"
]

Removing a section hides it.

Visual Options

Customize visual modules with visuals:

"visuals": {
  "barWidth": 10,
  "contextTrendPoints": 12,
  "modelFlowMax": 6,
  "modelFlowNameWidth": 9,
  "modelFlowSeparator": " → ",
  "showContextHeadroom": true,
  "showReasoningInTokenMix": true,
  "cacheRatings": {
    "excellent": 90,
    "good": 70,
    "mixed": 40
  },
  "labels": {
    "contextGauge": "Context Gauge",
    "contextTrend": "Context Trend",
    "tokenBreakdown": "Token Mix",
    "cacheGauge": "Cache",
    "spend": "Spend",
    "modelFlow": "Model Flow"
  }
}

Paths

The plugin resolves paths from the current user home directory:

~/.config/opencode/opencode-hud.config.json
~/.config/opencode/opencode.json
~/.local/share/opencode/opencode.db

For testing, override the home directory with:

$env:OPENCODE_HUD_HOME = "C:\\Users\\YourName"

Test

bun test