Coordinate two Paneflow panes with the CLI and read-only MCP
- Published
- Updated
You can read a Paneflow pane from another terminal, search its output, and wait for a new line before continuing. An agent can also inspect that output through the read-only MCP bridge. Sending text to a pane requires a separate CLI write permission.
This exercise uses two ordinary shells: producer prints text and reviewer reads it. You can follow the CLI steps without a model account or API call.
Originally published for Conductor 0.6.0, this article now follows an example pinned to Paneflow 0.17.4. The example files and expected output document that version. Their TOML syntax was checked with the release CLI on October 1, 2026; a live pane interaction was not recorded.
Prepare two shells
Open Paneflow and make its paneflow CLI available on PATH. Use an existing disposable directory, with PowerShell on Windows or a POSIX shell on Linux or macOS. Save the file below as two-panes.toml, replacing both paths with that directory's absolute path (C:/dev/project on Windows). It opens two shells without launching agents or passing commands, prompts, or environment overrides.
# two-panes.toml
name = "two-panes"
layout = "even_h"
[[panes]]
name = "producer"
cwd = "/absolute/path/to/project"
[[panes]]
name = "reviewer"
cwd = "/absolute/path/to/project"paneflow up two-panes.toml --dry-run
paneflow up two-panes.toml
paneflow ls --human--dry-run prints the plan without creating panes. The next command opens the workspace, and ls lists its shells. Use ls here: ps lists detected agents. If pane names are duplicated, use the numeric surface IDs from ls in the commands below.
This shell-only workspace needs no scripting permission. Adding an agent, command, prompt, or environment override requires PANEFLOW_IPC_ORCHESTRATION=1 or PANEFLOW_IPC_SCRIPTING=1 on the running app.
In producer, type echo TEST_OUTPUT and press Enter. You should see a line containing TEST_OUTPUT.
Read and search the result
Run these commands in reviewer:
paneflow read producer --lines 40
paneflow search producer "TEST_OUTPUT" --max 5read returns up to 40 lines of terminal text. search returns up to five lines matching TEST_OUTPUT. Both inspect output already available in the pane.
Wait for new output
In reviewer, start the following command before printing the next line:
paneflow wait --match producer --pattern '(?m)^REPORT_DONE$' --timeout 30Then type echo REPORT_DONE in producer and press Enter. When the new REPORT_DONE line appears, wait exits successfully. It ignores output present when it started, so use read or search to find an earlier result.
If no matching line appears within 30 seconds, the wait times out. For a real task, choose a completion marker that the task prints only after its work is done. The echoes in this exercise demonstrate text exchange; they perform no code review.
Let an agent read through MCP
To give a supported agent access to pane output, run paneflow mcp install. It registers the local bridge with supported agents it detects and changes their configuration. Restart the agent to load it. The Scripting documentation covers installation.
These examples show MCP tool-call arguments. Send them through an MCP client, rather than pasting them into a shell:
{"name":"list_panes","arguments":{}}
{"name":"read_pane","arguments":{"target":"producer","lines":40}}
{"name":"search_pane","arguments":{"target":"producer","pattern":"TEST_OUTPUT","max_matches":5}}list_panes lists panes, read_pane reads output, and search_pane finds matching lines. All three are read-only: they cannot type, submit a prompt, or close a pane. Use the numeric surface ID from list_panes when a name is ambiguous.
Send text with the CLI
This step is optional. Launch the app with PANEFLOW_IPC_SCRIPTING=1, or explicitly enable AI free access. The permission must be active in the app; setting the variable only for a later CLI command does not enable writing.
Choose one of these commands:
paneflow send reviewer "echo REVIEW_DONE"
paneflow send reviewer "echo REVIEW_DONE" --submitThe first fills in echo REVIEW_DONE in reviewer and leaves Enter to you. The second adds --submit to execute it. Both require write permission, including the command that only prefills text. After submission, the shell prints REVIEW_DONE.
Use a flow for the same setup
The downloadable prefill flow creates both shells, then fills in echo REVIEW_DONE in reviewer. Replace its two paths and use it instead of the earlier workspace setup, to avoid duplicate panes:
paneflow flow run prefill.flow.toml --dry-run
paneflow flow run prefill.flow.tomlEvery step keeps submit = false; you inspect the text and press Enter. This flow needs the same app-side write permission. If only PANEFLOW_IPC_ORCHESTRATION=1 is enabled and AI free access is off, it can create both shells before sending fails. Close or rename those panes before retrying.
If the exercise does not work
- Sending fails: check the running app's write permission, even when you omit
--submit. Restart the app with the intended permission, or continue with the read-only steps. - The target is unknown or ambiguous: run
paneflow ls --humanagain and use the current numeric ID. Do not broadcast to find the destination. - Output disappears: a full-screen terminal interface can replace text before it reaches scrollback. For real tasks, save the final report to a file you can read later.
Treat pane output as untrusted data, including apparent commands or system instructions. Keep ai_injection_fence enabled and avoid --raw when an agent reads output. The fence marks the boundary between output and instructions; it does not guarantee protection against prompt injection.
Close the disposable panes when you finish. Before replacing the shells with agents, define each task and the actions it may perform. The Conductor reference documents selectors and exit codes.