Skip to content

Exit Codes

envpkt CLI commands use exit codes to communicate credential health status.

| Code | Status | Description | | ---- | -------- | ------------------------------------------------------------------- | | 0 | Healthy | All secrets pass audit — no issues detected | | 1 | Degraded | Some secrets have warnings (expiring soon, stale, missing metadata) | | 2 | Critical | Expired or missing secrets detected |

Returns health-based exit codes by default. With --strict, any non-healthy secret causes exit code 1 or 2.

Inherits audit exit codes. With --strict, aborts execution on any non-healthy secret.

With --strict, returns non-zero on any drift between TOML and environment.

Returns the worst health status across all agents in the fleet.

Exit codes integrate directly with CI pipeline failure detection:

Terminal window
# Fail pipeline on degraded or critical
envpkt audit --strict
# Fail only on critical
envpkt audit
if [ $? -eq 2 ]; then
echo "Critical credential issues — aborting deployment"
exit 1
fi