Skip to content

Sonjoo CLI exit codes

View as Markdown

Check the exit code and the report together. An audit can finish, write a valid report, and exit 1 because a gate failed.

Exit code Meaning
0 Command succeeded. For an audit, the configured gates passed. Findings can still appear in the report.
1 An audit or analysis failed a gate, compare --fail-on-regression found a comparable regression, config <key> could not find the requested key, or serve returned a server error.
2 Command usage, configuration, or execution error. Audit examples in JSON mode can return an error object. Parser errors print diagnostics to standard error.
130 An audit, analysis, or crawl was interrupted. Use the saved crawl ID to resume a journaled crawl.

For sonjoo audit, exit 1 means a configured score, coverage, required-rule, or custom-search gate failed. Read the report before deciding what to fix. Check gate.reason, gate.failedCiRules, gate.unevaluated, and the optional gate.coverage and gate.failedCustomSearches fields.

When running in a shell pipeline, capture the status of Sonjoo itself. To keep an export on failure, pass --format json --output audit.json and persist that file in your CI job. Reproduce both gate outcomes

Look for the message and hint in the diagnostic. With an explicit --format json or --json, runtime failures can produce a JSON error object on stdout even if you requested a report file. A JSON output setting in TOML alone does not select JSON diagnostics. Start with a fresh output path so a file left by an earlier run cannot be mistaken for a new report.

This example rejects an unsupported URL scheme before making a request.

Terminal window
sonjoo audit 'file:///example' --no-save --format json --output unexpected.json

Expect exit 2 and a JSON object with error: true. The command creates no report at unexpected.json. If a valid HTTP(S) target fails instead, check reachability, then use sonjoo self doctor to check the local setup.