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

@guard22/opencode-status-signals

v0.3.4

Published

Visual status signals for OpenCode sessions with in-app theme mapping.

Downloads

91

Readme

OpenCode Status Signals

Visual status signals for OpenCode sessions, powered by OpenCode's own TUI theme system.

OpenCode Status Signals demo

This plugin does not touch iTerm2 or any other terminal emulator. It changes the OpenCode theme itself based on the current session state, so the behavior works at the OpenCode layer instead of the terminal layer.

The repository name is opencode-status-signals, and the published package name is @guard22/opencode-status-signals.

What it does

The plugin maps these states to themes:

  • default
  • started
  • complete
  • question
  • permission
  • error

By default it uses stable built-in OpenCode themes:

| State | Default theme | | --- | --- | | default | opencode | | started | tokyonight | | complete | opencode | | question | matrix | | permission | orng | | error | dracula |

The plugin defaults to forceThemeMode: "dark", so built-in themes stay on their dark variants instead of following a light system mode.

Why this approach

This project started as a terminal-color experiment, but the correct long-term solution is to use OpenCode's own theme system.

That gives you:

  • no terminal-specific hacks
  • no AppleScript
  • no dependency on iTerm2
  • the same behavior in any terminal that can run OpenCode
  • a cleaner mental model: session state -> OpenCode theme

Interactive setup inside OpenCode

The plugin includes an in-app mapping flow, so you can configure themes directly inside OpenCode.

Commands:

  • /theme-states
  • /theme-states-reset

The main flow lets you:

  1. pick a state
  2. choose a built-in theme
  3. preview it immediately
  4. confirm or revert
  5. save the mapping

Mappings are stored in the plugin KV store as local user preferences.

How it works

The plugin listens to native OpenCode session events and derives the current theme from the active session view.

Signals used:

  • session.status
  • session.idle
  • permission.asked
  • permission.replied
  • question.asked
  • question.replied
  • question.rejected
  • session.error

Theme priority is:

  1. error
  2. permission
  3. question
  4. started
  5. complete
  6. default

Install

Recommended install

Use OpenCode's native plugin installer:

opencode plugin @guard22/opencode-status-signals@latest --global

That command will install the plugin and patch your global OpenCode TUI config automatically.

Then restart OpenCode and use /theme-states to customize it.

GitHub fallback

curl -fsSL https://raw.githubusercontent.com/guard22/opencode-status-signals/main/install.sh | bash

That command will:

  • download the plugin into ~/.config/opencode/plugins/opencode-status-signals.js
  • patch ~/.config/opencode/tui.json
  • install the default status-to-theme mapping automatically

Then restart OpenCode and use /theme-states to customize it.

Manual install

If you want to manage the files yourself, copy src/tui.js into your OpenCode plugin directory and reference that file from tui.json.

Global config path:

~/.config/opencode/tui.json

Example:

{
  "$schema": "https://opencode.ai/tui.json",
  "theme": "opencode",
  "plugin": [
    [
      "~/.config/opencode/plugins/opencode-status-signals.js",
      {
        "forceThemeMode": "dark",
        "defaultTheme": "opencode",
        "startedTheme": "tokyonight",
        "completeTheme": "opencode",
        "questionTheme": "matrix",
        "permissionTheme": "orng",
        "errorTheme": "dracula"
      }
    ]
  ]
}

Then restart OpenCode.

Configuration options

Plugin options supported in tui.json:

  • defaultTheme
  • startedTheme
  • completeTheme
  • questionTheme
  • permissionTheme
  • errorTheme
  • forceThemeMode (dark, light, or system)
  • pollMs
  • debug

The interactive /theme-states flow can override these defaults and save user mappings locally.

OpenCode's top-level theme in tui.json should usually match your plugin defaultTheme, otherwise the plugin will intentionally override the global theme whenever session state changes.

Development

Validate the plugin locally:

npm run check

Dry-run the npm package contents:

npm run package:check

Open Source

This is an open source project and contributions are very welcome.

If you want to help, the most useful things are:

  • report bugs
  • suggest UX or workflow improvements
  • propose new session-state features
  • submit fixes or cleanup PRs
  • improve documentation

If you have an idea, found a bug, or want to add functionality, please open an issue or submit a pull request.

Even small improvements are helpful and make the project easier to maintain over time.

See CONTRIBUTING.md for the lightweight contribution guide.

Limitations

  • This is a plugin-only solution, not an OpenCode core patch.
  • Theme state is derived locally from shared session state and events.
  • That means it avoids release-to-release patch maintenance, but it is not a new server-side theme state primitive inside OpenCode.

License

MIT