entering the automation era: non-interactive CLI actions, pipes that stream data between panes, and workflow automation directly from a terminal or task runner.

Welcome to episode 13 of the Learn Zellij series! If episode 12 closed the configuration era, this episode opens the automation era. For the first time, you'll make Zellij do things without touching the keyboard or the mouse — via the CLI: non-interactive actions, data streams between panes, and workflows you can run from a terminal, a task runner, or a CI pipeline. This is where Zellij turns from a workspace you operate into a workspace you can script.
There are three things you'll master: (1) CLI Actions — Zellij's mechanism for issuing non-interactive commands to a session, (2) Pipes — a streaming mechanism that can create pipes, write data into a pane, and receive a pipe's output, and (3) Automation Workflows — combining both into automated scenarios, from a simple script to a production pipeline. This episode is heavily demo-based, so start a session and follow along.
One thing to note from the start: CLI Actions, Pipes, and automation all run outside a session — from your regular shell, without an attached Zellij. That means you can orchestrate Zellij from anywhere: from a script, from a crontab, from a CI step, or from another machine through SSH. The focus is on the mechanics of zellij action and zellij pipe, and on how they can automate workflows you previously did manually. Let's get started.
Both CLI Actions and Pipes were introduced in Zellij 0.40, and in 0.44 their capabilities expanded. The core idea: Zellij's client-server architecture means the multiplexer continues to run even when your terminal isn't attached. Because the server always exists, commands can be sent to it from outside — either as an action (something the session executes) or as a pipe (data streaming in or out). Both mechanisms work on sessions that are already running; you can't start a session this way, but you can automate nearly everything that runs inside one.
zellij action new-pane
zellij action write-chars "echo hello"
zellij action go-to-tab 2
zellij action resize -- --right 10The distinction is subtle but useful: zellij action executes discrete commands in a session — create a pane, write text, move between tabs, resize — while zellij pipe sends or receives a continuous data stream. Actions are for events, pipes are for data. This episode examines both, starting with actions.
Note
Since Zellij 0.40, zellij action and zellij pipe operate non-interactively — from the outside — without an attached session. Before this, automation was possible via interactive scripts inside a session; now you have a clean, scriptable interface directly from the CLI.
CLI Actions are commands sent to a session from outside it. They use the general form zellij action <action> and by default target the session in your current terminal context. To target another session, use the -s or --session flag with a session name. The following examples demonstrate common actions in a tab layout:
zellij action new-pane
zellij action write-chars "htop"
zellij action new-pane --session my-session
zellij action go-to-tab 1zellij action new-pane opens a new pane in the current session.zellij action write-chars "htop" writes the characters htop into the focused pane — like a scripted keystroke, without pressing Enter.zellij action new-pane --session my-session targets another session by name.zellij action go-to-tab 1 jumps to tab number 1.There's also zellij action new-pane --help and every other action's help. Actions follow the Zellij model from earlier episodes: write-chars writes to the focused pane, new-pane creates a pane in the current tab, and resize targets the focused pane — the same semantic you've already learned from keybindings.
Important
CLI actions operate on the focused pane or current tab, exactly like their keybinding counterparts. If you automate and it's not targeting what you expect, that's a focus problem — ensure your session has the right pane or tab focused, or use zellij action go-to-tab <number> first to establish the correct context.
One of the most useful action groups is the resize group — resizing the focused pane in a given direction. In a vertical split, zellij action resize -- --right 10 grows the focused pane by 10 columns to the right. Notice the -- separator before the arguments: it's there to avoid the CLI parser swallowing the flags. If an action has --help, use it — the syntax for positional and flag arguments varies per action.
Zellij Pipes introduce a streaming mechanism that can do three things: create a pipe (zellij pipe), write data into a pane through a pipe, and receive a pane's output through a pipe. This is the data-streaming counterpart to the discrete command model of actions, and it powers features like zellij pipe in version 0.40 and beyond.
zellij pipeThe first step is creating a pipe. zellij pipe without arguments creates a pipe in the current session, prints its pipe name (ID), and then — until it's closed — it receives the terminal input typed in that pane into its stdin, and sends whatever it writes to its stdout into that pane. This is Zellij's model for bidirectional streaming, and it's the foundation of more complex setups.
The second pattern is writing data into a pane through a pipe: zellij pipe --name <pipe-name> writes its stdin to the pipe, letting you stream a file or command output into a pane:
echo "hello world" | zellij pipe --name pipe-123
zellij pipe --name pipe-123 < output.logThird is receiving a pane's output through a pipe: a process can subscribe to the pane's output stream, so whatever the pane prints is piped into that process's stdin. This unlocks monitoring, logging, or capturing — read from the pane's output without even looking at it.
Tip
A pipe that has received a terminal command but nobody is consuming — and that command reads from the pipe's input — will block, not lose data. Think of pipes as buffers with backpressure: they won't silently drop what you stream into them.
Let's build a working pipe example step by step:
zellij pipe
# prints a name like: pipe-1zellij pipe in a terminal and note the printed pipe name (e.g. pipe-1).echo "hello" | zellij pipe --name pipe-1.Now let's combine CLI Actions and Pipes into real workflows. The examples below cover three levels: a simple automated workflow, a more complex scenario, and a production-style pipeline.
Simple workflow — open two panes and start a command in each:
zellij action new-pane
zellij action write-chars "htop"
zellij action write-chars --newline
zellij action new-pane
zellij action write-chars "top"
zellij action write-chars --newlinewrite-chars --newline is the action equivalent of pressing Enter — it writes the characters and sends a newline. Without it, write-chars "htop" would only type htop into the pane, waiting for you to press Enter.
Complex workflow — monitor logs and control the session from outside:
zellij action go-to-tab 1
zellij action write-chars "tail -f /var/log/app.log"
zellij action write-chars --newline
zellij pipe --name monitor > /tmp/app.logProduction-style pipeline — a script that starts a server pane and streams its output to a log file:
#!/usr/bin/env bash
set -eu
zellij action new-pane
zellij action write-chars "npm run start:prod"
zellij action write-chars --newline
zellij pipe > /tmp/app-prod.log &
echo "Server output logging to /tmp/app-prod.log"The & at the end backgrounds the pipe so the script can continue. Because both actions and pipes run from outside the session, this script is eligible for CI runners, cron, or a task runner.
Note
The first release supporting CLI Actions and Pipes is Zellij 0.40, and several flags shown here were expanded in 0.44. If a command or flag behaves unexpectedly, check your Zellij version with zellij --version and consult the release notes for the relevant features.
zellij action on a session that isn't running. Actions target an existing session; you can't start a session from the CLI this way. Fix: ensure the session exists, or start it first (zellij -s <name>), then automate.--newline. write-chars "htop" only types the text — it doesn't execute it. Fix: add --newline to send the Enter keystroke when the command must run.zellij action go-to-tab <n> or focus the right pane before the action.-- separator. Some actions like resize require -- before their flags so the parser doesn't swallow them. Fix: read zellij action resize --help and follow its syntax.&, redirect it to a file, or close it when done).Warning
Pipes stream data continuously until closed. In a production script, remember to close or terminate the pipe when the workflow finishes — otherwise the process stays alive and keeps consuming resources. Background pipes (&) especially need explicit cleanup at the end of the script.
This episode opened the automation era of the Learn Zellij series. You now know that zellij action executes discrete non-interactive commands — new-pane, write-chars, go-to-tab, resize — while zellij pipe streams data in and out of panes. Combining both, you can automate almost everything: from a simple script that builds two panes, to a CI pipeline that starts a server and captures its logs. Zellij is no longer a workspace you operate — it's a workspace you can script.
Key takeaways:
zellij action <action> sends non-interactive commands to a running session.zellij pipe creates a bidirectional stream; --name targets a specific pipe.write-chars --newline is the scripted Enter keystroke.Episode 14 next brings the Filepicker into the spotlight: a file and directory picker with previews, a "strider" file explorer that lives permanently in a pane, and how all of it integrates with layouts and CLI actions. See you in episode 14!