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-zellij

v0.0.16

Published

OpenCode plugin for Zellij-backed panes and workflow integrations.

Readme

opencode-zellij

npm version CI

English

讓 OpenCode 可以使用可見的 Zellij panes,處理不適合消失在一次性 tool call 裡的工作。

一般 commands 請使用 OpenCode 內建的 bash。當 process 應該持續存在、保持可見,或需要後續輸入時,才使用這個 plugin。

安裝

把 npm package name 加到 OpenCode config:

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

OpenCode 會在啟動時自動安裝 npm plugins。Zellij 也必須已安裝,且可在 PATH 中使用。

適合情境

  • dev servers 與 watchers
  • REPLs 與互動式 CLIs
  • SSH 或 remote sessions
  • 會詢問後續問題的 commands
  • 需要人類審核的 privileged commands

可以這樣要求 OpenCode

在可見的 Zellij pane 中啟動 dev server,並等待它 ready。
檢查 server pane 有沒有錯誤。
對互動式 pane 送出 Enter,然後顯示最新 output。
為 sudo install step 開一個 human-reviewed pane。
關閉 dev server pane。

Tools

| Tool | 用途 | | --- | --- | | zellij_pty_spawn | 啟動可見的 Zellij pane。 | | zellij_pty_read | 讀取最近的 pane output。 | | zellij_pty_write | 對互動式 pane 送出 input。 | | zellij_pty_list | 顯示 plugin 已知的 panes。 | | zellij_pty_kill | 關閉 plugin 建立的 pane。 | | zellij_pty_request_sudo | 請使用者在 Zellij 中審核並執行 privileged commands。 |

Human-only work

zellij_pty_request_sudo 會開啟 review pane、顯示即將執行的內容,並等待使用者輸入 YES。Agent 不能在該 pane 中輸入,因此 passwords 與 credentials 會留在 Zellij,而不是進入 prompts 或 tool arguments。

設定

可選的 sidecar config 會從 ~/.config/opencode/opencode-zellij.config.jsonc 以及目前 project 的 .opencode/opencode-zellij.config.jsonc 載入。Project config 會覆蓋 user config。

{
  "$schema": "https://raw.githubusercontent.com/maou-shonen/opencode-zellij/main/opencode-zellij.schema.json",
  "autoUpdate": true,
  "pty": {
    "enabled": true,
    "sudoPane": "allow" // allow, deny, or hide
  },
  "tabTitle": { "enabled": true }
}

autoUpdatepty.enabledtabTitle.enabled 設為 false 可關閉對應功能。

動態 tab title

當 OpenCode 在 Zellij 中執行時,plugin 會更新目前 tab title,顯示 project、branch 與目前 OpenCode 狀態:

🟢 opencode-zellij 🌱 main        # ready
⚡ opencode-zellij 🌱 main        # agent running
💬 opencode-zellij 🌱 main        # waiting for user input

Title 會 best-effort 根據 OpenCode session、question、permission 與 branch events 更新。

Pane cleanup watchdog

當 plugin 建立 pane 時,也會為該 OpenCode plugin instance 啟動一個小型 detached Node.js watchdog process。watchdog 會把 per-instance registry 放在 $XDG_RUNTIME_DIR/opencode-zellij-*(或系統 temp directory),監控擁有該 registry 的 OpenCode process,並在 OpenCode 還沒來得及執行正常 plugin cleanup 就退出時關閉 plugin 建立的 panes,例如使用 Ctrl-D 離開。

owner process 結束且 cleanup 完成後,watchdog 會自動退出。Registry 會依 OpenCode process 與 plugin instance 隔離。

注意事項

  • 這不是 sandbox。
  • Session records 只存在於 memory;重啟 OpenCode 後會遺失。
  • Output 是 rendered Zellij output,不是 raw PTY bytes。
  • 由 plugin 啟動的 commands 會 best-effort 捕捉 exit code。
  • 動態 tab title 啟用時,下一次 OpenCode 狀態變更可能會覆蓋手動修改的 Zellij tab title。