JSON output and exit codes¶
--json¶
Writes the SDK result object to stdout (no human wrapping). Failures with --json write {"error": "...", "code": "..."} to stdout.
eve-iac plan ./lab --json | jq .
Useful fields depend on the command (PlanData, BulkResult, LoginData, …). See the Python models.
Human login omits the token. --json includes token.
Exit codes¶
Verified from cli/eveiac_cli/exitcodes.py and agent_exit_code():
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Local error (missing URL, invalid lab, packing) |
| 2 | Usage (bad flags / invalid prune+from_eve) |
| 3 | Authentication (AgentError auth codes or HTTP 401) |
| 4 | TLS (code starting with tls_ or known TLS codes) |
| 5 | Confirmation required (--yes missing) |
| 10 | Other agent error |
Use set -e plus explicit checks on 5 if a job might hit destroy/wipe without --yes.