Skip to content

JSON Output

nolapse does not yet expose a dedicated --output json flag, but it does emit a machine-readable summary line on stdout that scripts can parse. A full structured JSON output mode is on the roadmap as a P1 feature.


nolapse run prints several lines to stdout. The summary line is consistently structured and can be extracted with standard text tools:

file baseline coverage PR coverage delta outcome
. 80.00% 82.30% +2.30% pass
outcome: pass delta: +2.30 coverage: 82.30% baseline: 80.00% outcome: pass
warn_threshold: 0.5 fail_threshold: 1.0
Coverage delta: +2.30% (threshold: 0.5%) pass

The key-value summary line (third line above) always contains these space-separated fields:

FieldFormatDescription
outcomepass / warn / failEnforcement outcome.
deltasigned float (e.g. +2.30)Coverage change in percentage points.
coveragefloat with % (e.g. 82.30%)Coverage measured in the current working tree.
baselinefloat with % (e.g. 80.00%)Coverage read from baseline.md.
warn_thresholdfloat (e.g. 0.5)Active warn threshold.
fail_thresholdfloat (e.g. 1.0)Active fail threshold.
Terminal window
# Get the outcome
nolapse run --repo . | grep '^outcome:' | awk '{print $2}'
# Get the delta
nolapse run --repo . | grep '^outcome:' | grep -oP 'delta: \K[^ ]+'
# Get the coverage percentage
nolapse run --repo . | grep '^outcome:' | grep -oP 'coverage: \K[^ ]+'

After each nolapse run invocation, the CLI writes a JSON state file to the repository root at .nolapse_run_state. This file is intended for downstream tools (such as the GitHub Action) to consume without re-parsing stdout.

{
"outcome": "pass",
"delta": 2.30,
"coverage": 82.30,
"baseline": 80.00,
"warn_threshold": 0.5,
"fail_threshold": 1.0,
"strict_mode": false,
"timestamp": "2026-01-15T09:00:00Z",
"commit": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2"
}
FieldTypeDescription
outcomestring"pass", "warn", or "fail".
deltanumberCoverage change in percentage points. Negative means regression.
coveragenumberCoverage percentage measured in the current working tree.
baselinenumberCoverage percentage read from baseline.md.
warn_thresholdnumberActive warn threshold for this run.
fail_thresholdnumberActive fail threshold for this run.
strict_modebooleanWhether strict mode was active for this run.
timestampstringISO-8601 UTC timestamp of when nolapse run executed.
commitstring40-character git SHA of HEAD at the time of the run.
Terminal window
outcome=$(jq -r '.outcome' .nolapse_run_state)
delta=$(jq -r '.delta' .nolapse_run_state)
echo "Outcome: $outcome Delta: $delta%"

A --output json flag is planned as a P1 priority. When implemented, it will suppress the human-readable table and emit a single JSON object to stdout with the same schema as .nolapse_run_state. This will make nolapse composable with jq pipelines and other JSON-aware tooling without relying on the state file.

Until that flag ships, use .nolapse_run_state for structured consumption.