zellij
Zellij Skill
Zellij is a terminal workspace/multiplexer with a focus on simplicity and power. Use it for managing terminal sessions, running interactive programs, and automating terminal workflows.
Quickstart
# Start a new session (auto-generates name)
zellij
# Start a named session
zellij -s my-session
# List active sessions
zellij list-sessions # or: zellij ls
# Attach to a session
zellij attach my-session # or: zellij a my-session
# Attach or create if doesn't exist
zellij attach -c my-session
# Kill a session
zellij kill-session my-session # or: zellij k my-session
Programmatic Control
Zellij provides CLI commands to control sessions programmatically - simpler than tmux (no socket management needed).
Sending Text to Panes
Use write-chars to send text to the focused pane:
# Send text to current session's focused pane
zellij action write-chars "echo hello"
# Send to a specific session
zellij -s my-session action write-chars "print('hello')"
# Send with newline (executes command)
zellij action write-chars $'echo hello\n'
# Send control characters
zellij action write-chars $'\x03' # Ctrl+C
Capturing Output
Use dump-screen to capture pane contents:
# Dump current pane to file
zellij action dump-screen /tmp/output.txt
# Dump with full scrollback history
zellij action dump-screen --full /tmp/output.txt
# For a specific session
zellij -s my-session action dump-screen /tmp/output.txt
Running Commands in New Panes
# Run command in a new pane
zellij run -- htop
# Run in floating pane
zellij run --floating -- python3
# Run in specific direction
zellij run --direction down -- tail -f /var/log/syslog
# Run and close pane when command exits
zellij run --close-on-exit -- ls -la
# Run command in specific session
zellij -s my-session run -- python3
Input Modes
Zellij uses a modal interface. Switch modes with zellij action switch-mode:
| Mode | Purpose | Default Key |
|---|---|---|
normal |
Default mode, basic navigation | (default) |
locked |
Disable all keybindings except unlock | Ctrl+g |
pane |
Pane manipulation (new, close, move) | Ctrl+p |
tab |
Tab manipulation | Ctrl+t |
resize |
Resize focused pane | Ctrl+n |
scroll |
Scroll within focused pane | Ctrl+s |
session |
Session management, detach | Ctrl+o |
# Switch to locked mode (useful when app conflicts with keybindings)
zellij action switch-mode locked
# Switch back to normal
zellij action switch-mode normal
Common Workflows
Python REPL
# Start session with Python
zellij -s python-dev
zellij -s python-dev run -- python3
# Send commands
zellij -s python-dev action write-chars $'print("hello world")\n'
# Capture output
zellij -s python-dev action dump-screen /tmp/python-output.txt
Interactive Debugging (gdb/lldb)
# Start debugger session
zellij -s debug-session run -- gdb ./my-program
# Send debugger commands
zellij -s debug-session action write-chars $'break main\n'
zellij -s debug-session action write-chars $'run\n'
zellij -s debug-session action write-chars $'bt\n'
# Capture backtrace
zellij -s debug-session action dump-screen /tmp/backtrace.txt
Interactive Git (git add -p)
# Start git session
zellij -s git-work
# Run interactive staging
zellij -s git-work action write-chars $'git add -p\n'
# Respond to prompts
zellij -s git-work action write-chars $'y\n' # Stage hunk
zellij -s git-work action write-chars $'n\n' # Skip hunk
zellij -s git-work action write-chars $'s\n' # Split hunk
zellij -s git-work action write-chars $'q\n' # Quit
Pane Management
# Create new pane
zellij action new-pane
zellij action new-pane --direction right
zellij action new-pane --floating
# Close focused pane
zellij action close-pane
# Move focus
zellij action move-focus left
zellij action move-focus right
zellij action move-focus up
zellij action move-focus down
# Toggle floating panes
zellij action toggle-floating-panes
# Resize pane
zellij action resize increase left
zellij action resize decrease right
Tab Management
# Create new tab
zellij action new-tab
zellij action new-tab --name "servers"
# Navigate tabs
zellij action go-to-next-tab
zellij action go-to-previous-tab
zellij action go-to-tab 1
# Close tab
zellij action close-tab
# Rename tab
zellij action rename-tab "my-tab-name"
Session Management
# List sessions with details
zellij list-sessions
# List sessions (short format)
zellij ls --short
# Attach to session by index
zellij attach --index 0
# Create detached session in background
zellij attach -b my-session
# Kill all sessions
zellij kill-all-sessions --yes
# Delete session (removes from disk)
zellij delete-session my-session
zellij delete-session --force my-session # Force kill if running
Layouts
Zellij supports declarative layouts in KDL format:
# Start with a layout
zellij --layout /path/to/layout.kdl
# Start with built-in compact layout
zellij --layout compact
# Dump current layout
zellij action dump-layout
See references/layouts.md for layout syntax.
Tips
- Session targeting: Always use
-s session-namewhen automating to avoid ambiguity - Newlines: Use
$'\n'in bash to send actual newlines that execute commands - Control characters: Use
$'\x03'for Ctrl+C,$'\x04'for Ctrl+D - Output capture:
dump-screen --fullcaptures scrollback; without--fullonly visible content - Floating panes: Great for temporary tasks - toggle with
toggle-floating-panes
Troubleshooting
Session not found:
# List all sessions first
zellij ls
# Use exact session name
zellij -s exact-session-name action write-chars "test"
Text not appearing:
- Ensure the target pane is focused
- Check if the pane is in a mode that accepts input
- Try switching to normal mode first:
zellij action switch-mode normal
Commands not executing:
- Remember to include newline:
$'command\n' - Check if application is waiting for input
Reference
For comprehensive documentation:
- Actions Reference - All available actions
- Layouts Reference - Layout system documentation
- Official Docs
More from dashed/claude-marketplace
ai-friendly-cli
Build and refactor CLIs for AI agent compatibility. Use when making command-line interfaces machine-readable, adding structured JSON output, hardening inputs against hallucinations, implementing safety rails like dry-run flags, adding schema introspection, or designing multi-surface architectures (CLI + MCP).
3chrome-cdp
Interact with local Chrome browser session via Chrome DevTools Protocol. Use when asked to inspect, debug, or interact with a page open in Chrome, take screenshots of browser tabs, read accessibility trees, evaluate JavaScript, click elements, navigate pages, or automate browser interactions in a live Chrome session.
2mermaid-cli
Generate, validate, and fix diagrams from Mermaid markup using the mermaid-cli (mmdc) tool. Use when creating flowcharts, sequence diagrams, class diagrams, state diagrams, ER diagrams, Gantt charts, pie charts, mindmaps, or any Mermaid-supported diagram type. Also use when validating, verifying, or fixing Mermaid diagram syntax. Triggers on mentions of mermaid, mmdc, diagram generation, diagram validation, or converting .mmd files to images/SVG/PDF.
2design-principles
Guide AI-assisted UI generation toward enterprise-grade, intentional design. Use when building user interfaces, creating dashboards, designing enterprise software or SaaS applications, generating frontend code with styling, or when the user asks for design help. Enforces principles inspired by Linear, Notion, Stripe, and Vercel.
2conventional-commits
Format git commit messages following Conventional Commits 1.0.0 specification. Use when the user asks to commit changes, create a git commit, or mentions committing code. Ensures consistent, semantic commit messages that support automated changelog generation and semantic versioning.
2gogcli
Drive Google Workspace from the terminal with the `gog` CLI (gogcli). Use when sending or searching Gmail, managing labels/drafts/filters, creating or updating Google Calendar events (including recurring, focus-time, or out-of-office), uploading/downloading/sharing Google Drive files, reading or writing Google Sheets, editing or exporting Google Docs and Slides, managing Google Contacts or the Workspace directory, working with Google Tasks (including recurrence), posting to Google Chat spaces, running Apps Script functions, creating Forms, administering Workspace users/groups via a DWD service account, or when building agent workflows that need multi-account Google access with JSON output, OAuth/ADC/service-account auth, Pub/Sub watches, email-open tracking, or an `--enable-commands` sandbox. Invoke any time the user mentions gogcli, the `gog` command, a Google CLI, or a one-stop terminal tool for Gmail/Calendar/Drive/Docs/Sheets/Slides/Chat/Tasks/Contacts/Classroom/Forms/Keep/Admin.
1