Skip to content

Scripting ​

The CLI keeps imperative reads usable in pipes: human tables by default, stable JSON with --json, stdout for results and stderr for the CLI's own diagnostics.

bash
# Which devices are showing stale?
hesper devices list --json | jq '.[] | select(.presence == "stale") | .hostname'

# A ticket by id, machine-readable
hesper tickets get INC-1042 --json

Rules ​

  • --json output is the stable contract for pipelines; human tables may change.
  • Distinct exit codes separate success, usage errors and failures — test $?, not output text.
  • NO_COLOR=1 and non-TTY output stay plain.
  • A pipeline can retrieve an existing job or receipt without opening a prompt or consuming model credits: /receipt <requestId> in the REPL, or a one-shot hesper ai -m for turns.

Piping into the Console ​

The REPL is interactive by design. For composed automation, use the imperative commands (devices, tickets, agent) and the one-shot ai — the Console turn itself is a human-governed surface.

Hesper docs · version v0.1.152