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-host-notify-bridge

v0.1.0

Published

OpenCode plugin that forwards notification events from devcontainers to a host-side notifier.

Downloads

31

Readme

opencode-host-notify-bridge

OpenCode plugin that forwards notification events from a devcontainer or remote session to a small host-side notifier process.

This solves the common case where opencode runs inside a container, but the sound and desktop notification need to happen on the macOS host.

Quickstart

  1. Install the plugin in OpenCode.
  2. Create ~/.config/opencode/host-notify-bridge.json from examples/host-notify-bridge.json.
  3. Create ~/.config/opencode/host-notify-server.json from examples/host-notify-server.json.
  4. Start the host process:
opencode-host-notify-server
  1. Run opencode inside your devcontainer.

What it does

  • listens for OpenCode events inside the plugin runtime
  • forwards those events to a host HTTP endpoint
  • keeps notifications focused on user-attention events
  • falls back to a terminal bell if the host endpoint is unreachable

Default events:

  • permission.asked
  • question.asked
  • session.idle

Package contents

  • index.js: OpenCode plugin entrypoint
  • bin/opencode-host-notify-server.mjs: host-side notifier process
  • examples/host-notify-bridge.json: plugin config example
  • examples/host-notify-server.json: host server config example

Install

1. Install the plugin

After publishing to npm:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["opencode-host-notify-bridge"]
}

For local development:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["file:///absolute/path/to/opencode-host-notify-bridge"]
}

2. Create plugin config

Create ~/.config/opencode/host-notify-bridge.json from examples/host-notify-bridge.json.

Important fields:

  • endpoint / endpoints: where the container should POST notifications
  • token: shared secret between plugin and host process
  • events: which OpenCode events trigger notifications

3. Create host server config

Create ~/.config/opencode/host-notify-server.json from examples/host-notify-server.json.

Important fields:

  • host
  • port
  • token
  • sound
  • speechEnabled

4. Start the host server

opencode-host-notify-server

For a background launch on macOS:

nohup opencode-host-notify-server >/tmp/opencode-host-notify-server.log 2>&1 &

How it works in devcontainers

OpenCode in devcontainer
  -> plugin receives event
  -> POST to host.docker.internal:8765/notify
  -> host server triggers macOS notification and sound

If host.docker.internal is not available in your container runtime, use another reachable host address and set it in host-notify-bridge.json.

Files

  • index.js: plugin entrypoint loaded by OpenCode
  • bin/opencode-host-notify-server.mjs: host-side HTTP listener
  • examples/host-notify-bridge.json: container-side plugin config
  • examples/host-notify-server.json: host-side notifier config

Event model

Recommended event set:

  • permission.asked
  • question.asked
  • session.idle

Avoid message.updated unless you explicitly want noisy per-message notifications.

macOS behavior

The host process uses:

  • osascript for Notification Center alerts
  • afplay for system sounds
  • say only when speechEnabled is true

Local development

For local plugin loading, point OpenCode at the repo path:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["file:///Users/your-user/Documents/projects/personal/opencode-host-notify-bridge"]
}

For local host-server testing:

node bin/opencode-host-notify-server.mjs

Then post a test notification:

curl -X POST http://127.0.0.1:8765/notify \
  -H 'content-type: application/json' \
  -H 'x-opencode-token: replace-me' \
  --data '{"title":"OpenCode","body":"Test","eventType":"session.idle"}'

Publish

  1. Pick the final package name
  2. npm publish
  3. Add the repo to awesome-opencode
  4. Optionally submit it to opencode.im