一键导入
zellij
Session, layout, and pane management for Zellij terminal multiplexer. Use when managing Zellij sessions, layouts, or automating terminal workflows.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Session, layout, and pane management for Zellij terminal multiplexer. Use when managing Zellij sessions, layouts, or automating terminal workflows.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Almanac reference for dates, holidays, time zones, business days, and astronomical events. Use when checking if a date is a business day, calculating date differences, converting time zones, looking up holidays, or checking for astronomical events like solstices, equinoxes, and moon phases. Also for seasonal calculations, workday schedules, and calendar arithmetic.
Toyota Production System (TPS) and Toyota Way for software engineering — lean thinking, waste elimination, root cause analysis, and continuous improvement. Use when identifying waste (muda/muri/mura), running blameless postmortems, doing 5 Whys, writing A3 problem statements, or connecting lean philosophy to TRIZ contradiction resolution.
Local multilingual translation via Ollama — 119 languages, no API key, no network, no data leaves the machine. Use when translating to/from Japanese, Chinese, Korean, French, Spanish, German, Portuguese, Russian, Arabic, or any other language. Also for localization, i18n text, and roundtrip validation. Qwen3:32b on Apple Silicon — faster and cheaper than cloud APIs.
TRIZ contradiction matrix oracle for software and systems design. Use when improving one quality worsens another — speed vs correctness, isolation vs sharing, autonomy vs control, simplicity vs completeness. Trigger phrases: "tradeoff", "tension between", "can't have both", "worsens when", "at the cost of", "faster but less reliable", "more isolated but harder to share". Not for bugs, merge conflicts, or tool choices. Prerequisite: triz binary must be installed (run `triz doctor` to verify).
Deploy and manage software on Linux/BSD fleet hosts (Pis, NAS, workstations) via Ansible. Use when user mentions deploy, ansible, fleet, hosts, inventory, or deployment.
Use when operating, debugging, or deploying the elixir-gastown Elixir/BEAM fleet — cluster federation, release builds, worker deploys, seccomp fixes, sname/name distribution issues, rate limiter, or any gastown service on Pi workers or coordinator nodes.
| name | zellij |
| description | Session, layout, and pane management for Zellij terminal multiplexer. Use when managing Zellij sessions, layouts, or automating terminal workflows. |
Zellij injects $ZELLIJ_SESSION_NAME into every process inside a session.
Always read it — never write "pmr", "bop", or any literal name.
# Nushell — canonical zellij_session function used in all dispatch.nu files
def zellij_session [] {
if "ZELLIJ_SESSION_NAME" in $env {
$env.ZELLIJ_SESSION_NAME
} else {
# Running outside Zellij — auto-detect
let sessions = (^zellij list-sessions --no-formatting 2>/dev/null
| lines | where { |l| ($l | str trim) != "" })
if ($sessions | length) == 1 {
$sessions | first | str trim
} else if ($sessions | length) > 1 {
error make { msg: $"Multiple sessions active: ($sessions | str join ', '). Set ZELLIJ_SESSION_NAME." }
} else {
error make { msg: "No Zellij session found. Start one with: zellij --session <name>" }
}
}
}
# Bash equivalent
SESSION=${ZELLIJ_SESSION_NAME:-$(zellij list-sessions --no-formatting | head -1 | awk '{print $1}')}
# Start or resume (canonical pattern — no hardcoded name)
zellij attach --create bop # bop project
zellij attach --create efi # efi/dub project
zellij attach --create zam # zam project
# List active sessions
zellij list-sessions
zellij list-sessions --no-formatting # machine-readable, no ANSI
# Detach without killing
Ctrl+p d
# Kill a session
zellij kill-session <name>
Each project has a .kdl layout file:
| Project | Layout | Launch |
|---|---|---|
| bop | layouts/bop.kdl | zellij --session bop --layout layouts/bop.kdl |
| efi | layouts/efi.kdl | zellij --session efi --layout layouts/efi.kdl |
| zam | layouts/zam.kdl | zellij --session zam --layout layouts/zam.kdl |
Two tabs: bop (primary) and dispatch (engine runners).
bop tab (7-pane card lifecycle layout):
┌──────────┬──────────────────┬──────────────────┐
│ BOARD │ SPEC │ QA │
│ watch │ what to build │ did it work? │
│ status ├──────────────────┼──────────────────┤
│ │ STDOUT │ STDERR │
│ │ agent output │ agent errors │
├──────────┴──────────────────┴──────────────────┤
│ INSPECTOR — bop inspect <id> │
├─────────────────────────────────────────────────┤
│ SHELL — bop commands (focus/retry/approve) │
└─────────────────────────────────────────────────┘
dispatch tab: dispatcher (75%) | merge-gate (75%) | dispatch-shell (25%)
layout {
default_tab_template {
children
pane size=2 borderless=true {
plugin location="zellij:status-bar"
}
}
tab name="main" focus=true {
pane split_direction="horizontal" {
pane name="top" size="70%" { command "nu" }
pane name="bottom" size="30%" { command "nu" }
}
}
tab name="logs" {
pane name="log-tail" {
command "nu"
args "-c" "tail -f /tmp/bop.log"
}
}
}
split_direction="horizontal" = children stacked top/bottom.
split_direction="vertical" = children side by side.
# Fire-and-forget — pane closes when command exits
zellij --session $ZELLIJ_SESSION_NAME run \
--name my-card \
--close-on-exit \
-- sh -c "nu /path/to/adapter.nu ..."
# Inspectable — pane stays open after command exits (for debugging)
zellij --session $ZELLIJ_SESSION_NAME run \
--name my-card \
-- sh -c "nu /path/to/adapter.nu ..."
# Open a new tab
zellij --session $ZELLIJ_SESSION_NAME action new-tab --name "logs"
# Navigate to an existing tab by name
zellij --session $ZELLIJ_SESSION_NAME action go-to-tab-name "bop"
Use --close-on-exit for: dispatch worker panes (adapter runs).
Omit --close-on-exit for: interactive panes, debugging, long-lived agents.
nu (Nushell) is not in PATH inside Zellij panes spawned via zellij run.
Always use the full path:
# WRONG — fails silently in detached pane context
nu dispatch.nu mark-done 022
# CORRECT
/opt/homebrew/bin/nu dispatch.nu mark-done 022
Same applies to bop binary: use $ROOT/target/debug/bop or add to PATH explicitly:
export PATH=$HOME/bop/target/debug:$PATH
! key in bop ui)Do NOT use Ctrl+O — that is Zellij's built-in Session mode key and will
be intercepted before reaching any app running inside a pane.
bop ui uses ! (normal mode, no modifier) for the subshell drop, inspired
by vim's :! convention. Zellij does not intercept bare printable keys in
normal mode.
// Triggered by KeyCode::Char('!') in the AppEvent::Key handler
// Suspend TUI
crossterm::terminal::disable_raw_mode()?;
crossterm::execute!(stdout(), crossterm::terminal::LeaveAlternateScreen)?;
// Run shell in card's worktree
std::process::Command::new(std::env::var("SHELL").unwrap_or("sh".into()))
.current_dir(&card_worktree)
.status()?;
// Restore TUI
crossterm::execute!(stdout(), crossterm::terminal::EnterAlternateScreen)?;
crossterm::terminal::enable_raw_mode()?;
// trigger full redraw
This does NOT open a new Zellij pane — it suspends and restores within the existing pane. Works correctly inside Zellij because alternate screen is stacked (Zellij has its own alternate screen above it).
These are intercepted by Zellij before reaching pane content:
| Key | Zellij action |
|---|---|
Ctrl+O | Session mode (session manager) |
Ctrl+P | Pane mode |
Ctrl+T | Tab mode |
Ctrl+N | New pane |
Ctrl+H | Move pane focus left |
Ctrl+B | Scroll up |
Ctrl+F | Scroll down |
Ctrl+G | Unlock (in locked mode) |
Safe to use in TUI apps: bare printable keys (!, e, n, r, etc.),
Alt+<key> (Zellij uses Alt+arrow but not most Alt+letter combos),
function keys F1–F12.
| Key | Action |
|---|---|
Alt + arrow | Move focus between panes |
Alt + n | New pane |
Alt + [ / ] | Previous / next tab |
Ctrl+p d | Detach from session (session stays alive) |
Ctrl+p z | Toggle pane fullscreen |
Ctrl+p x | Close focused pane |
Ctrl+p r | Rename focused pane |
All three projects (bop, efi, zam) use the same zellij_session pattern:
dispatch.nu run --wave N --yes
→ zellij_session [] # reads $ZELLIJ_SESSION_NAME
→ zellij --session <name> run --name <spec-id> --close-on-exit -- sh -c <AC cmd>
→ pane runs Auto-Claude agent
→ on exit: mark-done / mark-failed called via /opt/homebrew/bin/nu
Lock file (dispatch-lock.json) records session: (zellij_session) so rescue
operations can target the correct session.
Each running card will optionally get a tab with nested panes:
logs/stderr)Tab naming convention: card-<id> (e.g. card-feat-auth).
Created via zellij action new-tab --name card-<id>, then pane splits via
zellij action new-pane --direction down.
| Project | Canonical session | Layout |
|---|---|---|
| bop | bop | layouts/bop.kdl |
| efi (dub) | efi | layouts/efi.kdl |
| zam | zam | layouts/zam.kdl |
These are current names — they WILL change. Always use $ZELLIJ_SESSION_NAME.
# Get current session name (canonical method)
SESSION=${ZELLIJ_SESSION_NAME:-$(zellij list-sessions --no-formatting | head -1 | awk '{print $1}')}
# Start/attach to session
zellij attach --create <session-name>
# List sessions
zellij list-sessions --no-formatting
# Run command in new pane
zellij --session $SESSION run --name pane-name --close-on-exit -- command
# Detach without killing
Ctrl+p d
# Navigate between panes
Alt + arrow keys
$ZELLIJ_SESSION_NAME! insteadnu and other tools are not in PATH inside spawned panes — use full paths like /opt/homebrew/bin/nu! key instead, as Ctrl+O is intercepted by Zellij