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-remote-cmux

v0.1.2

Published

Temporary SSH remote cmux notification workaround for OpenCode

Readme

opencode-remote-cmux

Temporary OpenCode plugin that emits an OSC 9 notification for completed primary sessions when OpenCode is running in an SSH remote environment.

The package is authored in TypeScript from src/ and published as compiled ESM JavaScript in dist/.

The plugin implementation is type-checked against the official @opencode-ai/plugin and @opencode-ai/sdk packages.

This exists as a workaround for opencode-cmux, which currently depends on the local cmux CLI and becomes a no-op in SSH remote sessions.

Current Scope

  • Notify only
  • Primary sessions only
  • SSH remote sessions only by default
  • No sidebar status, logs, permission prompts, or question prompts

Why this exists

opencode-cmux shells out to commands such as cmux notify. That works when OpenCode can reach the local macOS cmux binary and workspace state, but it does not work when OpenCode itself runs on a remote Linux host over SSH.

This plugin takes the smallest possible approach: when a primary session becomes idle, it writes an OSC 9 escape sequence to the controlling terminal (/dev/tty) so the local terminal stack can forward it to cmux.

If the process has no controlling terminal, it falls back to stdout.

When OpenCode runs inside tmux, the plugin wraps that OSC 9 sequence in tmux passthrough so it can reach the outer terminal. tmux still needs passthrough enabled; the config alone does not rewrite raw OSC output.

Installation

Add opencode-remote-cmux to the plugin array in ~/.config/opencode/opencode.json.

If you already use opencode-cmux, your config will usually look like this:

{
  "plugin": [
    "opencode-cmux",
    "opencode-remote-cmux"
  ]
}

Restart OpenCode after saving the config. OpenCode will install npm plugins automatically at startup.

From a local checkout (Development)

Use this if you are testing this repository directly before publishing it to npm.

  1. Link the entrypoint into OpenCode's local plugin directory:
npm run build
ln -sf ~/path/to/opencode-remote-cmux/dist/index.js ~/.config/opencode/plugins/remote-cmux-notify.js
  1. Point ~/.config/opencode/opencode.json at that local file:
{
  "plugin": [
    "opencode-cmux",
    "~/.config/opencode/plugins/remote-cmux-notify.js"
  ]
}
  1. Restart OpenCode.

Which one should I use?

  • Use "opencode-remote-cmux" for normal installation.
  • Use "~/.config/opencode/plugins/remote-cmux-notify.js" only when developing or testing from a local checkout.

After publishing, you can submit a PR to the OpenCode ecosystem list to make the plugin easier to discover.

Behavior

  • On session.status with status.type === "busy", the plugin clears its duplicate-notify guard for that session.
  • On session.status with status.type === "idle", the plugin:
    • checks that it is in a remote SSH session
    • skips subagent sessions
    • emits one OSC 9 notification for the primary session

The emitted message format is:

Done: <session title>

Environment controls

  • OPENCODE_REMOTE_CMUX_NOTIFY=1: force-enable notifications even without SSH_CONNECTION or SSH_TTY
  • OPENCODE_REMOTE_CMUX_NOTIFY=0: disable notifications even in SSH sessions

tmux

If you run OpenCode inside tmux, enable passthrough in your tmux.conf:

set -g allow-passthrough on

This is necessary but not sufficient on its own. The plugin now emits tmux passthrough-wrapped OSC 9 when TMUX is present, and your outer terminal stack still needs to support the notification sequence.

Development

Run tests with:

npm test

Build compiled output with:

npm run build
  • Source: src/
  • Package output: dist/
  • Test output: .test-build/

Notes

  • This is a temporary workaround, not a replacement for upstream remote support in opencode-cmux.
  • Delivery still depends on your SSH and terminal path allowing OSC sequences through.

License

MIT