The JSON contract
Use--output json for scripts. For a launch or run wait, .runs[] contains execution receipts and .results[] contains individual test results. A launch can return a run ID before any result rows exist. Waiting adds count fields in .summary and, when needed, execution-level diagnostics in .runFailures[].
Launch once and read a result
This Bash example assumesPROJECT_ID names a project with a public default environment. It saves the launch receipt, waits for the run and downloads evidence for each failed, blocked or cancelled result. The script returns the wait’s exit code after collecting diagnostics.
run wait uses lowercase status values in .results[]. The result reader returns uppercase testStatus values and exits 0 when it successfully reads a result, including a failed one. The following commands print result IDs and inspect a selected result.
Timeouts and interrupts
An incomplete timeout or interrupt can returnpartial: true alongside the known run receipts and result rows. Use .runs[].runId to resume an ordinary run with testsprite run wait "$RUN_ID". Check runFailures even when every visible result passed. The execution may still have been cancelled or timed out while waiting for more results. A tunnel the command opened closes on timeout and requests cancellation by default. Cancelling Runs
A launch can also end before the server confirms all projects. Read unconfirmedProjects and reuse retryIdempotencyKey with --idempotency-key on the complete original command. notRunProjects identifies projects the CLI never submitted.
A minimal CI gate
ci run waits for the verdict and emits reports before exiting. In testsprite-summary.json, .results[] identifies individual results and .executionReport.runId identifies the execution when the report is available. With ci run --output json the same summary is under .summary. See CI/CD.
Debugging a script
--verbose logs retry and polling activity to stderr. --debug adds HTTP method, path, request ID and latency. JSON errors also go to stderr. Keep stdout and stderr separate when passing data to jq.
Preview a public launch without submitting it:
testsprite result get example --dry-run --output json.