How to get JSON output from the ClearRun CLI (--json)
Add --json to clearrun score or clearrun verify. The CLI prints one JSON object with passed and a results list, so scripts can read it.
Last updated
Steps
Run with --json
clearrun score answer.txt --jsonRead the result
{ "passed": true, "results": [ { "input": "answer.txt", "passed": true, "verdict": { "score": 51, "grade": "High risk", "summary": "Review Evidence support.", "verdictId": "fefa38ee-6965-496b-8dc3-85251c40791a", "risk": "elevated", "timestamp": "2026-11-14T01:04:28.553Z", "signature": "7VIIMQ+xQe6EArK7y9Tvsd0P/w8dOQv0UUQeYxPMfgIXngTiyOb/5aphxs2SIzlz8YCPSHYj2UpuUv+Mje3+Aw==", "schemaVersion": "1.2.0", "componentSignals": [ { "name": "Evidence support", "level": 3, "note": "Limited supporting evidence" }, { "name": "Reasoning integrity", "level": 6, "note": "Internally consistent" } ], "signalsDigest": "5807c48c93d3d19ed7964d08430b328460a320166b76d3a953cf92d329392fe5", "signalsSalt": "cb58cfb9f1f21794a133ab0450e1ae46" } } ] }This is real output from
@clearrun/cli1.2.0, run on November 13, 2026.
Failures in JSON
- A failed gate adds a
failureslist and setspassedtofalse. With--threshold 70, the answer above would add"failures": ["score 51 is below threshold 70"]. - A failed call adds an
errorfield with the error message. - A usage error prints
passed: falseand anerrorfield with the message.
The exit code is the same as without --json: 0 or 1.
With jq
clearrun score responses/ --json | jq '.results[] | {input, score: .verdict.score}'