sirioctl
Panels
Create, split, write to, read from and wait on terminal panels.
panel create and panel split print the new panel’s UUID. Keep it.
WORKER=$(sirioctl panel create --cmd 'codex')
PEER=$(sirioctl panel split right --from "$SIRIO_PANE_ID" --cmd 'pi')
Drive it
sirioctl panel write --id "$WORKER" --input 'Implement the parser change' --enter
sirioctl panel key --id "$WORKER" enter
sirioctl panel read --id "$WORKER"
sirioctl panel state --id "$WORKER"
sirioctl panel wait --id "$WORKER"
sirioctl panel focus --id "$WORKER"
sirioctl panel close --id "$WORKER"
panel wait returns the child process’s exit code. Keep it when you clean up:
status=0
sirioctl panel wait --id "$WORKER" || status=$?
sirioctl panel read --id "$WORKER"
sirioctl panel close --id "$WORKER"
exit "$status"
Always clean up
A shell trap closes the worker on success, failure and interruption alike:
WORKER=$(sirioctl panel create --cmd 'codex')
trap 'sirioctl panel close --id "$WORKER"' EXIT