Managed OpenCode sessions for Zellij.
This project creates a single managed OpenCode session per Zellij pane and keeps a floating switcher plus tab-name status in sync.
- managed launch flow with explicit OpenCode server ports
- tab names like
myproject (3/5)* - floating session switcher for all tracked sessions
- approval and attention states surfaced as
! - automatic tab-name restore when a managed session stops
- one managed OpenCode pane = one managed OpenCode session
- the broker polls the local OpenCode server for session, todo, and permission state
- the Zellij plugin handles UI and tab renaming
Build from source:
npm install
npm run build:allOr install with curl:
curl -fsSL https://raw.githubusercontent.com/navio/zellij-opencode/main/scripts/install.sh | bashThe installer builds the CLI and plugin under ~/.local/share/zellij-opencode/current and creates a ~/.local/bin/zellij-opencode wrapper.
npm install
npm run build:allThis produces:
- CLI:
dist/index.js - plugin:
assets/zellij-opencode.wasm
From inside a Zellij session:
zellij action start-or-reload-plugin "file:$(pwd)/assets/zellij-opencode.wasm"You only need to do this once per Zellij session.
Add this to ~/.config/zellij/config.kdl and adjust the absolute path:
keybinds {
shared_except "locked" {
bind "Ctrl Shift o" {
LaunchOrFocusPlugin "file:/ABSOLUTE/PATH/TO/zellij-opencode/assets/zellij-opencode.wasm" {
floating true
move_to_focused_tab true
}
}
}
}From inside Zellij:
node dist/index.js launch --cwd /path/to/project --name myprojectOptional flags:
--continue--session-id <id>--model <provider/model>--agent <name>
This will:
- start the local broker if needed
- create a new Zellij tab in the target directory
- start OpenCode with an explicit local server port
- register the pane with the broker
- begin tab/status updates
j/knavigateEnterjump to session1-9quick jumpcclear selected stopped/attention entry from the switcherDclear all stopped/attention entries from the switcherEscclose
- The plugin must be loaded for tab renames and the switcher UI to work.
- The broker only tracks sessions launched through
zellij-opencode launch. - Per-tab color is not implemented; state is shown in tab labels and the switcher.
npm test