dLazy AIdLazy AI
CLI

Output Modes

Pick the right `--output` mode for shell pipelines.

stdout always carries the machine-readable channel; stderr always carries human-readable progress. Mixing them in a pipe never garbles the JSON envelope.

Modestdout
json (default)Full envelope { ok: true, result } (or { ok: false, code, message, details? })
urlOne URL per line — only media outputs
textOne text block per output — only text outputs

Picking a Mode

# Default — full envelope, easy to inspect with jq
dlazy gpt-image-2 --prompt "logo" | jq -r ".result.data.urls[0]"

# Just the URL — handy in shell scripts
URL=$(dlazy gpt-image-2 --prompt "logo" --output url)
curl -O "$URL"

Errors Always Land on stdout

Even with --output url or text, a failure still writes the structured envelope to stdout (so consumers can branch on .ok):

dlazy gpt-image-2 --prompt "..." --output url \
  | tee output.txt \
  | jq -e "if .ok == false then .code else empty end"

Exit codes: 0 success, 1 runtime / network failure, 2 input / config error.

On this page