BURROW // chapter 12
Chapter 12 Part 03 / Operator Experience

Commands and scripts

Run commands on an existing SSH connection, inspect stdout and stderr, and explicitly save output as Hovel evidence. Runs continue independently of their viewers.

Run one command

run now gateway -- ps -elf

Review the target, command and output budget. Confirmation launches the prepared run, waits and collects its output. Ctrl+L opens Collected output; Tab switches to Activity log.

On the CLI, the same command returns a prepared ID and exact confirm continuation. Use that continuation after approval. Repeating run now creates another run.

burrow --workspace /absolute/workspace run now gateway -- ps -elf

Put Burrow flags before --; everything after it is a literal remote argument. Use an explicit /bin/sh -c for expansion or redirection. Commands and arguments appear in reviews and retained requests; do not include secrets.

Manage a retained run

Run lifecycle
flowchart LR
accTitle: Retained run lifecycle
accDescr: Prepare creates an inert run. Review and launch execute it once. Output can be observed while running. After completion or cancellation, collect persists evidence, and close removes working files.
Prepare[Prepare] --> Review[Review]
Review --> Launch[Launch once]
Launch --> Observe[Inspect or follow]
Observe --> End[Complete or cancel]
End --> Collect[Collect evidence]
Collect --> Close[Close working files]

Viewing output never collects it. A repeated launch of the same ID does not execute again.

run prepare gateway -- /usr/bin/id
run list
run inspect ID
run launch ID
run output ID stdout 0
run collect ID
run close ID

Replace ID with the retained run's returned id, not Hovel's launch runID. These are separate actions; approve launch, collection or close only when intended. CLI reviews use --review DIGEST --yes. Explicit --yes also approves the current advertised action.

Run a script

  1. Connect to the target; examples assume gateway.
  2. Use local to find the upload root. Save script and input files there.
  3. Choose stream, inline or stage explicitly; specify an installed absolute interpreter.
  4. Review source/stdin snapshot sizes and hashes, arguments, output budget and staging options.
  5. Confirm. Inspect execution, capture, cleanup and collection separately.

Script source and program stdin

ModeSource deliveryIndependent stdin
streamInterpreter receives source through -s --; no remote script file.Unavailable; --stdin is refused.
inlineShell receives source through -c; source is visible in process arguments and must fit the 64 KiB invocation bound.--stdin PATH supplies binary bytes.
stageConfirmed launch uploads a private remote script, then runs the interpreter with its path.--stdin PATH supplies binary bytes.
Existing remote scriptInvoke its path as an ordinary command. Burrow does not upload or remove it.--stdin PATH supplies binary bytes.

Preparation takes private immutable snapshots of local script/stdin files within the upload root. Each input is limited to 256 MiB; outside paths and special files are refused. Editing the originals does not change a prepared run.

Stream and inline need a shell supporting the shown switches. Stage can use another installed interpreter. Noninteractive runs do not inherit another shell's directory, environment or identity.

Example: stream literal arguments

Save this as check.sh in the upload root:

printf '<%s>\n' "$@"
run now gateway --script check.sh --mode stream --interpreter /bin/sh -- 'My Documents' 'café' '$(hostname)' ''
<My Documents>
<café>
<$(hostname)>
<>

Command-substitution text is literal. Source owns stdin; choose another mode when the program needs input.

Example: independent stdin

Save both files in the upload root. Keep the final newline in the input file.

printf 'report: %s\n' "$1"
while IFS= read -r item; do
  printf 'item: %s\n' "$item"
done
oak
pine
run now gateway --script summarize.sh --mode inline --interpreter /bin/sh --stdin inventory.txt -- weekly
report: weekly
item: oak
item: pine

Inline source must contain no secrets. To give the interpreter a filename instead, choose stage:

run now gateway --script summarize.sh --mode stage --interpreter /bin/sh --stdin inventory.txt -- weekly

For an already installed remote script:

run now gateway --stdin inventory.txt -- /bin/sh /opt/admin/summarize.sh weekly

Staging and cleanup

Stage review shows a private path under /tmp/burrow-script.*/script. Confirmation creates the directory, uploads the snapshot and executes it. Upload failure does not launch the script.

ResultMeaning
stageCleanup: removedThe acknowledged source file and empty private directory were removed.
stageCleanup: kept--keep deliberately retained the staged source, including after failure or cancellation.
stageCleanup: failedSafe cleanup failed. Replaced files and unrelated contents are preserved.
stageCleanup: unconfirmedOwnership or transport could not establish cleanup; inspect manually.

Cleanup never reconnects and does not undo the script's own file changes. Closing a run removes its local working files, not a remote file retained with --keep. After staging failure, investigate before preparing a new run; repeated launch cannot repeat staging.

Read output and outcomes

Each stream has a default 256 MiB private-file storage budget, configurable with --budget BYTES at preparation. Capture drains independently of viewers. Budget, write or sync failure preserves available bytes and marks capture incomplete.

FieldQuestion it answers
remoteExit / localExitDid the actual command/tool exit, and with what code?
outputComplete, outputErrorWas its output captured completely?
receivedBytes, storedBytesHow much arrived and was stored? Inspect arrays are stdout, then stderr.
cancellation, timedOutWas cancellation requested and cleanup observed?
collectionWere the artifacts persisted by Hovel?

run output reads up to 32 KiB at a byte offset and returns base64 data plus nextOffset. Track a separate cursor per stream. Reads neither consume another reader's bytes nor collect evidence.

A nonzero remote exit is a known command failure. SSH exit 255, transport loss or missing completion observation can be transport-or-completion-unknown; Burrow does not invent an exit code.

Follow live output

run follow ID
run follow ID stderr
run follow ID stdout 32768
InputAction
Tab / Shift+TabSwitch streams with independent positions.
Arrows / Page keys / wheelScroll and pause following while capture continues.
EndCatch up and follow latest output.
Alt+BBackground the viewer; inactive tabs stop polling.
Esc / Ctrl+CClose only the viewer.

Each preview holds at most 32 KiB per stream, with its byte range visible. Reopening restores positions in the same frontend. Agents and pipes should use bounded output reads. Control/binary characters are escaped for display; saved bytes remain exact.

Cancel and close

run cancel ID
run inspect ID
run collect ID
run close ID

Cancel an active run only when intended. Remote Linux cancellation verifies the ordinary process group's leader and start time, sends TERM and observes remaining members. Escaped descendants, identity races, missing transport and ignored TERM can leave cancellation unconfirmed; there is no silent KILL escalation.

--timeout 30s or another positive Go-style duration requests the same cancellation after execution starts, excluding staging time. There is no default execution deadline. Stopping a wait or closing a viewer never cancels execution.

Close refuses active runs and removes only their verified working files. It preserves registered artifacts, unrelated replacements and siblings.

Collect evidence

Collect persists stdout, stderr and a JSON result as Hovel artifacts. Partial capture is collectible. collection: succeeded means persistence completed; execution success and capture completeness are separate.

Retry failed collection against the same ID. Repeated collection creates another result referencing the retained bytes. Its runID identifies the collection throw; launchRunID identifies execution.

Uncollected bytes can be lost with the daemon or module. Unknown working directories are not evidence of complete capture. No automatic adoption or relaunch occurs. Collected artifacts survive run close and owner failure.

Ubuntu surveys

run survey CONNECTION --os ubuntu uses the same reviewed execution/collection flow. See surveys and Markdown reports.

Local tools

--local runs on the daemon host. See local tools for environment, local exit and cancellation.

Recovery

ConditionNext step
Stream mode owns stdinSelect inline or stage when independent stdin is needed.
Missing or changed masterInspect ownership; reconnect and prepare a new run explicitly.
Incomplete outputInspect the budget and output error. Collect available bytes before owner loss.
Unknown launch outcomeInspect the existing ID. Do not create another run to retry observation.
Audit persistence failedNew launch is refused when its attempt cannot be saved. Cleanup still proceeds and reports the failure.

See the run API for command syntax, parameter bounds and wire shapes.