References CLI Commands
This page lists every public paneflow command and flag, as paneflow <VERB> --help
prints them in Paneflow 0.20.0. See CLI automation for how
to use them.
Panes and workspaces
paneflow ls [OPTIONS]
paneflow ls [OPTIONS]List the panes of the active workspace, framed as untrusted output when printed to a program (--raw for plain output)
Alias: list_panes.
| Flag | Description |
|---|---|
--human | Human-readable table instead of the default JSON |
--json | Print the listing as JSON, the default |
--raw | Never wrap the listing in the <untrusted_terminal_output> fence it gets when standard output is not a terminal |
--scope <SCOPE> | From inside a Paneflow pane, reads stay in that pane's workspace. all reaches every workspace and needs ipc.orchestration set to true in paneflow.json [default: workspace] [possible values: workspace, all] |
paneflow read [OPTIONS] <TARGET>
paneflow read [OPTIONS] <TARGET>Print a pane's scrollback, framed as untrusted output by default (--raw for plain text)
<TARGET>: Target: surface id, name, cmdline:<substr>, or cwd:<path>
Alias: read_pane.
| Flag | Description |
|---|---|
--lines <LINES> | Number of trailing lines (server clamps to 1..4000) |
--offset <OFFSET> | Offset from the end of the buffer |
--json | Emit the {text, lines, total_lines, eof} envelope as JSON |
--raw | Return raw scrollback, bypassing the anti-injection fence that otherwise wraps the output as <untrusted_terminal_output> (the fence is on by default; see the ai_injection_fence setting) |
--scope <SCOPE> | From inside a Paneflow pane, reads stay in that pane's workspace. all reaches every workspace and needs ipc.orchestration set to true in paneflow.json [default: workspace] [possible values: workspace, all] |
paneflow search [OPTIONS] <TARGET> <PATTERN>
paneflow search [OPTIONS] <TARGET> <PATTERN>Search a pane's scrollback for a substring/pattern, framed as untrusted output by default (--raw for plain lines)
<TARGET>: Target: surface id, name, cmdline:<substr>, or cwd:<path>
<PATTERN>: Pattern to search for
Alias: search_pane.
| Flag | Description |
|---|---|
--max <MAX> | Cap the number of matches (server clamps to 1..1000) |
--human | Print <line>: <text> lines when the server sends no fenced text |
--json | Print the whole {matches, truncated, text} reply as JSON |
--raw | Return raw <line>: <text> lines, bypassing the anti-injection fence that otherwise wraps the matches as <untrusted_terminal_output> (see the ai_injection_fence setting) |
--scope <SCOPE> | From inside a Paneflow pane, reads stay in that pane's workspace. all reaches every workspace and needs ipc.orchestration set to true in paneflow.json [default: workspace] [possible values: workspace, all] |
paneflow new [OPTIONS]
paneflow new [OPTIONS]Create a new workspace
| Flag | Description |
|---|---|
--name <NAME> | Workspace title |
--cwd <CWD> | Working directory for the first pane (must exist) |
--space <SPACE> | Space to create the workspace in, by name (any case) or id; defaults to the active space |
paneflow split [OPTIONS] <DIRECTION>
paneflow split [OPTIONS] <DIRECTION>Split the active pane horizontally or vertically
<DIRECTION>: h/horizontal (panes stacked) or v/vertical (side by side) [possible values: horizontal, vertical]
| Flag | Description |
|---|---|
--target <TARGET> | Split the pane hosting this target instead of the first leaf. Target: surface id, name, cmdline:<substr>, or cwd:<path> |
paneflow focus <TARGET>
paneflow focus <TARGET>Give a targeted surface the keyboard focus
<TARGET>: Target: surface id, name, cmdline:<substr>, or cwd:<path>
paneflow send [OPTIONS] <TARGET> <TEXT>
paneflow send [OPTIONS] <TARGET> <TEXT>Inject text into a pane WITHOUT submitting it (human-in-loop).
Requires ipc.scripting set to true in paneflow.json (or a write grant); the text is written verbatim with no trailing newline so the user/agent reviews and presses Enter themselves - unless --submit is passed explicitly.
<TARGET>: Target: surface id, name, cmdline:<substr>, or cwd:<path>
<TEXT>: Text to inject (no trailing carriage return is added by default)
| Flag | Description |
|---|---|
--broadcast | Send to EVERY pane matching the target (a multi-match selector is an error without this flag). Prints a {sent, failed} report |
--submit | Submit the text (append a carriage return). Explicit opt-in: this is the ONLY way the CLI ever submits on the user's behalf, and it still requires the instance-side scripting gate |
--paste | Force bracketed-paste delivery: the text is wrapped in ESC[200~/ESC[201~ and, with --submit, the carriage return is sent separately after a calibrated delay so a TUI agent does not swallow it. --submit toward an agent pane enables this automatically; pass --paste to force it (e.g. toward a shell) or --paste alone to wrap a non-submitted inject |
--report-file <PATH> | Ask the agent to write its complete result to this file and print REPORT_DONE <path> after the file is fully written. The path is resolved relative to the caller's current directory |
--force | Write even when the target agent waits for a decision (permission, menu, question) or no longer runs in the foreground. The forced write is logged by the instance |
--scope <SCOPE> | From inside a Paneflow pane, writes stay in that pane's workspace. all reaches every workspace and needs ipc.orchestration set to true in paneflow.json [default: workspace] [possible values: workspace, all] |
paneflow key [OPTIONS] <TARGET> <KEYSTROKE>
paneflow key [OPTIONS] <TARGET> <KEYSTROKE>Send a named keystroke (e.g. escape, ctrl-c, tab) to a pane.
Requires ipc.scripting set to true in paneflow.json (or a write grant). Keystrokes that would submit a line (enter, ctrl-m, ctrl-j) are refused - submission is exclusive to send --submit.
<TARGET>: Target: surface id, name, cmdline:<substr>, or cwd:<path>
<KEYSTROKE>: Dash-separated keystroke description ("escape", "ctrl-c", "alt-f")
| Flag | Description |
|---|---|
--scope <SCOPE> | From inside a Paneflow pane, keystrokes stay in that pane's workspace. all reaches every workspace and needs ipc.orchestration set to true in paneflow.json [default: workspace] [possible values: workspace, all] |
paneflow write [OPTIONS] <TARGET> <TEXT>
paneflow write [OPTIONS] <TARGET> <TEXT>Relay a message into another agent's pane once a human allows the pair of panes.
Run it from a Paneflow pane. Paneflow prefixes the message with a line naming the calling pane. The first write between two panes asks the human in the Paneflow window: it prints approval_pending <request> and exits 0 without writing anything; run the same command again once the human allows the pair. It prints written when the message is delivered, and no_window with exit 1 when no window can ask the human.
Examples:
paneflow write reviewer "the tests pass on main"
paneflow write 12 "rebase on main" --submit<TARGET>: Target: surface id, name, cmdline:<substr>, or cwd:<path>
<TEXT>: Message for the agent in the target pane; Paneflow prefixes it with a line naming this pane
| Flag | Description |
|---|---|
--submit | Submit the message once it is written, as if Enter were pressed |
--scope <SCOPE> | Writes stay in the calling pane's workspace. all reaches every workspace and needs ipc.orchestration set to true in paneflow.json [default: workspace] [possible values: workspace, all] |
--json | Print the whole pane.write reply as JSON |
paneflow ask [OPTIONS] [QUESTION]
paneflow ask [OPTIONS] [QUESTION]Ask the user a question in the Paneflow window and print the answer.
Without --option the user types a line; with options the user picks one, or several with --multiple, each printed on its own line. It waits 20s by default; past --timeout it prints pending <id> and exits 4, and paneflow ask --resume <id> keeps waiting.
Examples:
paneflow ask "Deploy now?" --option yes --option no
paneflow ask "Branch name?" --timeout 2m
paneflow ask --resume 7[QUESTION]: The question shown to the user in the Paneflow window
| Flag | Description |
|---|---|
--option <TEXT> | A choice the user picks from; repeat it for each choice. Without it the user types a line |
--multiple | Let the user pick several options; each picked option is printed on its own line |
--timeout <DURATION> | How long to wait for the answer, such as 20s, 10m or 1h; 20s by default. Past it the CLI prints pending <id> and exits 4 |
--resume <ID> | Keep waiting for the question a previous paneflow ask printed as pending <id> |
Agents
paneflow ps [OPTIONS]
paneflow ps [OPTIONS]List running agents across the fleet (pid, tool, state, pane)
| Flag | Description |
|---|---|
--json | Emit the {agents:[…]} envelope as JSON instead of a table |
paneflow status [OPTIONS] <TARGET>
paneflow status [OPTIONS] <TARGET>Read one surface's agent state (thinking / waiting / idle / errored / …)
<TARGET>: Target: surface id, name, cmdline:<substr>, or cwd:<path>
| Flag | Description |
|---|---|
--json | Emit the status envelope as JSON instead of a one-line summary |
paneflow wait [OPTIONS] --match <SELECTOR>
paneflow wait [OPTIONS] --match <SELECTOR>Block until a pane goes idle, or a regex appears in its output (orchestration)
| Flag | Description |
|---|---|
--match <SELECTOR> | Target: surface id, name, cmdline:<substr>, or cwd:<path>. Note: cmdline: matches the full argv on Linux but only the executable basename on macOS/Windows; prefer cwd: or a name for a portable selector |
--pattern <PATTERN> | Regex to wait for in the pane's recent scrollback. Only output that arrives after the wait starts can match, so a line already on screen does not end it. Required unless --idle is set. With --idle it is an optional sentinel: it is checked on each new output and EITHER signal (pattern match OR going idle) returns first |
--idle | Wait until the pane's agent ends its turn: for an agent that declares its state through OSC 7501, return on its next idle or attention state (at once if it already waits). Other panes wait for their output to go quiet (no output_generation change for --for ms) on the push stream. Single-target |
--for <MS> | With --idle: the quiescence window in milliseconds (default 1000). The pane must produce no new output for this long to count as idle |
--timeout <TIMEOUT> | Max seconds to wait before giving up (default 300) |
--any | Succeed as soon as ANY matching pane matches (selector may hit several). --pattern mode only; ignored with --idle |
--all | Require ALL matching panes to match the pattern. --pattern mode only |
paneflow watch [OPTIONS]
paneflow watch [OPTIONS]Stream lifecycle events from the running instance as JSONL
| Flag | Description |
|---|---|
--surface <SURFACE> | Only stream events for this pane (selector). Omit for all panes |
--type <TYPE> | Only stream these event types (repeatable). Omit for all types |
--events-only | Hide subscription protocol frames and print user events only |
paneflow events [OPTIONS]
paneflow events [OPTIONS]Follow the worker's numbered event log: one line per event with its seq, type and ids, reconnecting across a worker restart
| Flag | Description |
|---|---|
--json | Print one JSON object per event instead of a line |
--types <TYPES> | Only these event types, comma-separated: exact names or a family such as terminal.* |
--since <SEQ> | Replay the events after this seq first |
--workspace-id <ID> | Only events about this layout workspace id |
paneflow up [OPTIONS] <FILE>
paneflow up [OPTIONS] <FILE>Spawn a declarative agent workspace from a TOML file ("compose for agents")
<FILE>: Path to a paneflow.workspace.toml spec
| Flag | Description |
|---|---|
--dry-run | Validate + print the resolved plan without touching the instance |
paneflow flow run [OPTIONS] <FILE>
paneflow flow run [OPTIONS] <FILE>Execute (or validate with --dry-run) a flow file against the running instance. Spawns panes, waits on ready barriers, feeds steps - submission only with explicit submit = true + the scripting gate
<FILE>: Path to a flow.toml
| Flag | Description |
|---|---|
--dry-run | Validate + print the resolved plan without touching the instance |
--json | Final machine-readable report on stdout (live transitions move to stderr) |
--scope <SCOPE> | From inside a Paneflow pane, send steps that target a pane the flow did not spawn stay in that pane's workspace. all reaches every workspace and needs ipc.orchestration set to true in paneflow.json [default: workspace] [possible values: workspace, all] |
Scripting
paneflow do [OPTIONS] [SCRIPT]...
paneflow do [OPTIONS] [SCRIPT]...Run a Lua 5.4 script in this process against Paneflow. The script reaches every method as paneflow.<namespace>.<method>{...}, reacts to events with paneflow.on and paneflow.wait, sets timers with paneflow.after and paneflow.every, and runs programs with paneflow.exec.
key=value pairs after the script fill paneflow.args, typed by spelling (n=2 is a number, on=true a boolean). A returned value is printed as one line of JSON. An error prints Error: <message> and exits 1; paneflow.stop(n) exits n; Ctrl-C exits 130.
Examples:
paneflow do ./split.lua
paneflow do -e 'return paneflow.surface.list()'
echo 'return paneflow.args.n * 2' | paneflow do - n=21A name instead of a script runs that action of init.lua on the worker. With --wait it waits at most that long: an action still running prints running <run_id> and exits 4, and paneflow do --resume <run_id> keeps waiting.
paneflow do deploy env=prod --wait 20s
paneflow do --resume 3f2a --wait 20s[SCRIPT]...: A Lua file (ends in .lua or contains a path separator), - for stdin, or an action name, then key=value pairs for paneflow.args
| Flag | Description |
|---|---|
-e <CHUNK> | Run this Lua chunk instead of a file; every argument after it is a key=value pair |
--args <JSON> | Raw JSON for paneflow.args, or @path to read it from a file; replaces the key=value pairs |
--json | Indent the JSON the script returns |
--all | Hear the events of every workspace, not only the one of the pane the script runs in |
--for <DURATION> | Stop after this long and exit 0, such as 30s, 10m or 2h |
--fail-fast | Exit 1 as soon as an event handler or a timer raises an error |
--memory-limit <MIB> | Cap the memory of the Lua state at this many MiB; no cap when absent |
--deadline <SECONDS> | Stop Lua code that runs this long without waiting; no deadline when absent |
--action <NAME> | Load the script as a configuration such as init.lua and run this action from it, in this process; the worker's loaded configuration is untouched |
--wait <DURATION> | For an action name: wait at most this long, such as 30s or 10m. If the action still runs, print running <run_id> and exit 4; without --wait, wait until it ends |
--resume <RUN_ID> | Keep waiting for the action run a previous paneflow do <action> --wait printed as running <run_id>; with --wait, wait at most that long |
paneflow actions [OPTIONS]
paneflow actions [OPTIONS]List the actions init.lua declares, as the worker loaded them: name, title, category and where each is declared. Run one with paneflow do <name> key=value.
Examples:
paneflow actions
paneflow actions --json| Flag | Description |
|---|---|
--json | Print the action.list result as JSON |
paneflow api list [OPTIONS]
paneflow api list [OPTIONS]List every method the running processes serve, with its owner and summary
| Flag | Description |
|---|---|
--json | Print the full method descriptors as JSON |
paneflow api describe [OPTIONS] <METHOD>
paneflow api describe [OPTIONS] <METHOD>Show a method's parameters, result fields and an example invocation
<METHOD>: Method name, such as surface.read
| Flag | Description |
|---|---|
--json | Print the descriptor as JSON |
paneflow api call [OPTIONS] <METHOD> [PAIRS]...
paneflow api call [OPTIONS] <METHOD> [PAIRS]...Call a method on the process that owns it and print the JSON result.
Parameters are key=value pairs typed from the method's schema (lines=50 is an integer, fenced=true a boolean), or raw JSON with --args '{...}' or --args @file.json. Pairs override keys from --args.
<METHOD>: Method name, such as surface.list
[PAIRS]...: Parameters as key=value pairs
| Flag | Description |
|---|---|
--args <JSON> | Raw JSON params object, or @path to read one from a file |
--on <PROCESS> | Send the call to this process instead of the method's owner, for a method every process answers such as system.whoami [possible values: window, worker, host] |
paneflow api stubs
paneflow api stubsPrint a Lua language server definition file (---@meta) with one typed function per method and the runtime functions of paneflow do, generated from the registry linked into this binary; no running instance is needed.
Example:
paneflow api stubs > ~/.paneflow/lua/paneflow.d.luapaneflow api docs
paneflow api docsPrint a Markdown reference of every method, from the registry linked into this binary
paneflow config reload [OPTIONS]
paneflow config reload [OPTIONS]Load init.lua in the worker again now and print its status; a failed load keeps the previous configuration
| Flag | Description |
|---|---|
--json | Print the config.status result as JSON |
paneflow config check [PATH]
paneflow config check [PATH]Load a configuration file in this process and print its problems with file and line; exits 1 when any is an error
[PATH]: The file to check, init.lua of the Paneflow home by default
paneflow grants ls [OPTIONS]
paneflow grants ls [OPTIONS]List the grants panes hold, as the worker stores them. From a pane, only the grants that pane holds or delegated are listed.
Examples:
paneflow grants ls
paneflow grants ls --json| Flag | Description |
|---|---|
--json | Print the grant.list result as JSON |
paneflow grants revoke [OPTIONS] <ID>
paneflow grants revoke [OPTIONS] <ID>Revoke a grant and every grant delegated from it. From a pane, only a grant that pane delegated can be revoked.
Examples:
paneflow grants revoke g-12-1<ID>: The grant id, as paneflow grants ls prints it
| Flag | Description |
|---|---|
--json | Print the grant.revoke result as JSON |
Worker and host
paneflow serve
paneflow serveStart, inspect or stop the per-home worker that owns agent activity and serves Controllers
paneflow serve start
paneflow serve startStart the detached worker for this PANEFLOW_HOME, or adopt the one already serving it
paneflow serve status
paneflow serve statusPrint the worker pid, protocol version, home, session count and advertised capabilities
paneflow serve stop [OPTIONS]
paneflow serve stop [OPTIONS]Stop the worker; terminals are untouched
| Flag | Description |
|---|---|
--drain-ms <DRAIN_MS> | Milliseconds to wait for the worker to exit before giving up [default: 5000] |
paneflow host
paneflow hostStart, inspect or stop the detached local host that owns terminal sessions for this PANEFLOW_HOME (no running GUI needed)
paneflow host start
paneflow host startStart the detached local host for this PANEFLOW_HOME, or adopt the one already serving it
paneflow host stop [OPTIONS]
paneflow host stop [OPTIONS]Stop the local host; refused while live sessions remain (they are listed)
| Flag | Description |
|---|---|
--force | End every live session first instead of refusing; their processes are terminated |
paneflow sessions [OPTIONS]
paneflow sessions [OPTIONS]Read the worker's session projection as a Controller: a bootstrap carrying its advertised capabilities, then one frame per reduced transition
| Flag | Description |
|---|---|
--follow | Stay connected and print one frame per transition, reconnecting to a worker that restarts |
--json | Emit JSON lines instead of a human table |
paneflow sessions resume <SESSION>
paneflow sessions resume <SESSION>Resume a session's runtime through the worker (refused unless the worker advertises session.runtime.resume)
<SESSION>: Session id as the worker publishes it
paneflow sessions ack <SESSIONS>...
paneflow sessions ack <SESSIONS>...Lower the unread flag the worker raised on one or more finished sessions
<SESSIONS>...: Session ids as the worker publishes them
Integrations
paneflow integrations list
paneflow integrations listPrint every agent runtime Paneflow knows, one per line, with its integration state: installed, not installed, not supported on this platform or no integration (detection only).
paneflow integrations install <runtime> [--force]
paneflow integrations install <runtime> [--force]Install an agent's status hooks and the paneflow-conductor skill. <runtime> is a runtime name or the agent's command, such as claude-code or claude.
Claude Code (claude-code) and Codex (codex) can be installed. The other runtimes (opencode, pi, hermes, grok, amp, gemini, github-copilot, factory, openclaw, muse-code, fx) are detected only, and installing one exits with an error.
| Flag | Description |
|---|---|
--force | Takes over entries another Paneflow home owns. It must come after <runtime>. |
paneflow integrations remove <runtime>
paneflow integrations remove <runtime>Remove an agent's Paneflow hooks, its paneflow-conductor skill and its integration marker.
paneflow hooks setup
paneflow hooks setupInstall persistent hooks for every supported agent. An agent that is not detected on this machine is skipped.
paneflow mcp uninstall
paneflow mcp uninstallRemove the MCP entries an older Paneflow wrote. The MCP bridge was removed: agents now drive Paneflow through the paneflow CLI and the paneflow-conductor skill. uninstall is the only mcp subcommand left.
Global options
Run paneflow with no arguments to open the app window.
| Flag | Description |
|---|---|
-h, --help | Print this help message |
-v, --version | Print version |
--update-and-exit | Check for an update and exit (CI harness) |