NodeRingsDocs

Exit codes and output

Process exit codes, stdout vs stderr, and JSON output conventions for nr

Exit codes

CodeConstantMeaning
0OKSuccess
1ErrorRuntime / operational failure (API error, verify failed, install failed)
2MisuseInvalid usage: missing required flags, unknown flags, bad --output / --section

Scripts should treat 2 as “fix the invocation,” and 1 as “the command ran but the operation failed.”

stdout vs stderr

StreamContent
stderrLogs, progress, prompts, warnings, human diagnostics
stdoutMachine-readable payloads when --output=json (and similar)

This split lets you redirect JSON safely:

nr cluster verify --name edge-ams-01 --output json > report.json

Logs still appear on the terminal (stderr) while report.json stays clean.

Commands that support --output

Typically: auth status, agent list/get/create, service-account list/get/create/update, cluster verify, cluster status|info|health, and the post-register verify report from cluster register.

Accepted values: text (default) or json.

Non-interactive safety

Destructive or reuse confirmations fail closed when stdin is not a TTY, unless you pass --yes / --force as documented for that command.