pi-orchestra

Commands

The /orchestra command is for humans; the model uses the tools.

/orchestra                     browse (TUI) / status text elsewhere — see Browsing
/orchestra browse [query]      interactive list pre-filtered with `query`
/orchestra open <id>           detail of one task/worker/run, with transcript tail
/orchestra find <query>        text search across tasks
/orchestra status              summary of the active run (tasks + workers)
/orchestra tasks               task list with readiness and dispatch ids
/orchestra workers             worker table: status, turns, tools, cost
/orchestra read <id>           compact transcript of a worker
/orchestra resume <id> [msg]   reopen the worker's own session (sessionMode: session)
/orchestra retry <id> [note]   repair a failure: same spec, previous error prepended
/orchestra broadcast <msg>     one message to every live worker
/orchestra grep <text>         search every worker transcript (redacted, with line numbers)
/orchestra metrics             cost/turn table + spend sparkline for the active run
/orchestra export [json]       write .pi/orchestra/exports/<run>.jsonl
/orchestra archive [keep]      move finished runs to .pi/orchestra/archive/
/orchestra join <id>           joined chat with a worker (type into it)
                               (tab completes the subcommand, then live ids)
/orchestra chat <id>           the same conversation as plain text
/orchestra diff <id>           git diff since that worker started
/orchestra budget [usd]        show spend, or raise the run's cost ceiling
/orchestra report              markdown run report → exports/<run>.md
/orchestra prune [days]        delete archived runs and orphaned logs older than N days
/orchestra runs                list runs, newest first (→ marks the active one)
/orchestra use <run>           make a run the active one
/orchestra templates           list run templates
/orchestra template <name>     create a run from a template
/orchestra watch <id>          live transcript in the widget (tail, updates ~2x/s)
/orchestra unwatch             stop watching
/orchestra stop <id>           abort and stop a worker
/orchestra questions           pending questions/gates
/orchestra config              state dir, config sources, effective config
/orchestra hide                hide the widget and status line in this project
/orchestra show [mode]         bring them back: auto (default), always, off
/orchestra reset               archive this project's state and start clean
/orchestra back                leave a joined chat (same as esc/ctrl+g)

<id> may be a full dispatch id (dispatch_ab12cd34ef) or a unique suffix.

Completion

Pressing tab after /orchestra completes the subcommand (each with its one-line description); after a space it completes the live argument — dispatch ids for join, chat, read, watch, stop, retry, resume, diff; dispatch or task ids for open; run ids for use; template names for template. The match is on the id, the status/model column and the row's title, so /orchestra join port<TAB> finds the worker that is porting something.

/orchestra browse is the only surface that takes keyboard input: the widget above the editor is not focusable. Keys and behaviour are in Browsing. Print and RPC modes fall back to text so scripts and pi -p keep working.

Tools

Tool Purpose
orchestra Control plane with an action parameter (see below).
orchestra_wait Block until dispatch(es) settle, a question arrives, or timeout.
orchestra_send Steer a running worker, follow-up a settled one, or dispatch="*" to message every live worker.
orchestra_answer Answer a blocking question.
orchestra_ask Worker side: ask the coordinator and block.

orchestra actions

Action Key parameters Result
status — Run summary, tasks table, workers table.
run_create name, goal New run, becomes active.
run_list / run_use runId List runs / switch the active one.
task_create title, description?, agent?, deps? New task (ready when deps are done).
task_list filter?, limit?, offset? Tasks, paged (default 20) with a showing 1–20 of 24 — offset=20 footer.
task_update taskId, status?, deps? Force a task status and/or replace its dependencies (cycles are refused with the path).
worker_start taskId or spec, agent?, model?, thinking?, tools?, budgetUsd?, budgetMs?, retryOf?, retries? Spawns a worker, returns its dispatch id. retryOf repairs a failed dispatch with its evidence in the brief; retries allows automatic repairs.
worker_resume dispatch, message? Reopens that worker's own session (requires sessionMode: "session"), linked with resumedFrom.
worker_list filter?, limit?, offset? Worker table, paged like task_list.
worker_show dispatch, tailLines? One worker: spec, usage, transcript.
worker_read dispatch, tailLines? Compact transcript from the log.
worker_send dispatch, spec Same as orchestra_send.
worker_stop dispatch Abort + stop; its task returns to pending.
worker_keep_open dispatch Keep it alive after settling.
wait dispatch?, timeoutMs? Same as orchestra_wait.
answer questionId, answer Same as orchestra_answer.
gate_list — Pending questions.
search filter, runId?, limit? Greps every worker log; returns dispatch, line number and redacted text.
chat dispatch, includeThinking? The worker's conversation as text: brief, replies, thinking, tool calls and results.
metrics runId? Per-worker cost/turn table, totals and spend sparkline.
export runId?, format? (jsonl/json) Writes .pi/orchestra/exports/<runId>.<format>.
diff dispatch, tailLines? Base commit, stat, untracked files and the patch of what a worker changed.
budget budgetUsd?, runId? Report spend, or raise the ceiling and clear a budgetAction: "ask" pause.
report runId?, format? Markdown run report (goal, tasks, outcome, failures, changes, cost); writes exports/<runId>.md.
prune days? (30), dryRun? Deletes archived runs and orphaned logs/prompts/mail/exports older than the window.
archive keep? Moves all but the newest keep runs (default 5) to .pi/orchestra/archive/.
templates — Lists run templates.
reset — Stop everything, archive state.json, start clean. Keeps ui.widget (the /orchestra hide preference), drops the use pin.

Example session

> Split this refactor across three workers and report back.

orchestra action=run_create name="session-refactor" goal="split session store"
orchestra action=task_create title="Extract storage interface"
orchestra action=task_create title="Port the JSONL backend" deps=["<task 1>"]
orchestra action=task_create title="Add migration tests" deps=["<task 2>"]
orchestra action=worker_start taskId="<task 1>"
# end the turn here — the worker runs in the background
... wake-up: worker settled, report + usage ...
orchestra action=worker_start taskId="<task 2>"
orchestra_wait timeoutMs=600000        # only when the next step needs the result

A worker_start returns as soon as the process is up, so independent workers can be started in a single turn. orchestra_wait is the explicit block; it returns on settle, on a question, or on its own timeout.

Reading output

worker_read renders the JSONL event stream as a compact transcript:

▶ started
→ bash npm test
  42 passing
All green.
■ settled

The raw log is always at .pi/orchestra/logs/<dispatch>.jsonl.