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
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
- Connect to the target; examples assume
gateway. - Use
localto find the upload root. Save script and input files there. - Choose stream, inline or stage explicitly; specify an installed absolute interpreter.
- Review source/stdin snapshot sizes and hashes, arguments, output budget and staging options.
- Confirm. Inspect execution, capture, cleanup and collection separately.
Script source and program stdin
| Mode | Source delivery | Independent stdin |
|---|---|---|
| stream | Interpreter receives source through -s --; no remote script file. | Unavailable; --stdin is refused. |
| inline | Shell receives source through -c; source is visible in process arguments and must fit the 64 KiB invocation bound. | --stdin PATH supplies binary bytes. |
| stage | Confirmed launch uploads a private remote script, then runs the interpreter with its path. | --stdin PATH supplies binary bytes. |
| Existing remote script | Invoke 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.
| Result | Meaning |
|---|---|
stageCleanup: removed | The acknowledged source file and empty private directory were removed. |
stageCleanup: kept | --keep deliberately retained the staged source, including after failure or cancellation. |
stageCleanup: failed | Safe cleanup failed. Replaced files and unrelated contents are preserved. |
stageCleanup: unconfirmed | Ownership 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.
| Field | Question it answers |
|---|---|
remoteExit / localExit | Did the actual command/tool exit, and with what code? |
outputComplete, outputError | Was its output captured completely? |
receivedBytes, storedBytes | How much arrived and was stored? Inspect arrays are stdout, then stderr. |
cancellation, timedOut | Was cancellation requested and cleanup observed? |
collection | Were 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
| Input | Action |
|---|---|
| Tab / Shift+Tab | Switch streams with independent positions. |
| Arrows / Page keys / wheel | Scroll and pause following while capture continues. |
| End | Catch up and follow latest output. |
| Alt+B | Background the viewer; inactive tabs stop polling. |
| Esc / Ctrl+C | Close 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
| Condition | Next step |
|---|---|
| Stream mode owns stdin | Select inline or stage when independent stdin is needed. |
| Missing or changed master | Inspect ownership; reconnect and prepare a new run explicitly. |
| Incomplete output | Inspect the budget and output error. Collect available bytes before owner loss. |
| Unknown launch outcome | Inspect the existing ID. Do not create another run to retry observation. |
| Audit persistence failed | New 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.