Using the CLI

Automation and JSON

For AI agents and automation

This page documents JSON responses, streaming events, and exit codes for AI agents and scripts. You can skip it when using Super CLI interactively.

To set up a coding agent, see Using AI agents.

Run without prompts

Every public command accepts --json. It disables prompts and the interactive view and includes full result details. Use your saved login or SUPER_ACCESS_TOKEN for authentication.

If your repository has uncommitted changes, JSON mode can’t prompt you about including them. Use --dirty to include them or --commit HEAD to check committed code.

Bash
$ super check --commit HEAD --json

See Check commands for command options and usage.

Response format

Each response has schema_version (currently 1), type, and data. The type identifies the kind of response; data contains its fields. For a results response, the checks are in data.rows. JSON goes to stdout; diagnostics go to stderr.

This excerpt shows a completed check that found a problem; other fields are omitted:

Check response (excerpt)
{
  "schema_version": 1,
  "type": "results",
  "data": {
    "finished": true,
    "rows": [
      {
        "current": {
          "number": 42,
          "result": {
            "outcome": "fail",
            "assurance": "standard"
          },
          "terminal": true,
          "problematic": true,
          "operational_error": null
        }
      }
    ]
  }
}

Command errors use type: "error", with an error code in data.code and a readable explanation in data.message. See Exit codes for command success and failure.

When check --problems has nothing to recheck, it returns one success response and exits 0, including with --stream.

Check results

A results response has data.rows, with one row per selected supertest. Each row contains supertest, current, and previous; either check can be null. Each check includes its number, the source checked in revision, and these result fields:

FieldMeaning
resultnull if no conclusion has been reported.
result.outcomepass indicates a passing result; fail indicates a reported problem.
result.assuranceThe assurance level, as a string.
terminalA result or operational failure has been reported.
operational_errornull if no operational error; otherwise an error code. Can coexist with a result.
problematicThe check reported problems with the checked behavior.
updates_pendingFurther updates may arrive.
fix_pendingA fix proposal may still arrive.
fixThe full proposal when available; otherwise omitted.

The data.finished field means all loaded current checks are terminal, not that they all passed. Check for missing (current: null) or inconclusive results and pending updates separately.

Use the result fields above for decisions. Status labels in presentation.status.label, text in presentation.details, and error messages are for display. Their wording can change, so don’t rely on exact text in scripts.

To retrieve the same run, use data.run.id with super status --run <run-id> --json in the same linked repository. Use --check <number> for one check. Plain super status and check --problems select the latest run, which can change.

History

Running super status --history --json adds a page of checks in data.history. Pass a non-null data.next_before as --before <number> with the same selection for the next page. If previous is null, no previous check was loaded; earlier checks may still exist.

Stream updates

Streaming output is newline-delimited JSON: parse one object per line.

CommandBehavior
super check --jsonWait for checks to finish, then emit one results response.
super check --json --detachEmit one results response on acceptance.
super check --json --streamEmit initial results, live events, then final results.
super status --watch --jsonEmit initial results, follow results and pending updates, then emit closed and exit.

The --stream flag requires --json and cannot be combined with --detach. Read through process exit, including both results responses when results are already available. A streaming check stops when checks are terminal; status --watch --json also waits until updates_pending is false.

Event typeData
check_updatedcheck_number and the full updated check. Replace the stored check with it.
connectionconnected: whether the followed connections are up.
closedtarget to resume and detached: whether checks were still unfinished.

Ctrl+C closes observation without canceling checks. A streaming check returns its final, possibly unfinished, results instead of closed. A failure may end the stream with error.

Fix output

Running super fix --check <number> --dry-run --json returns fix_proposal. Its data contains the full proposal (diff, instructions, and validation), plus:

FieldMeaning
applies_cleanlyWhether the patch can be applied to your working files.
apply_errorWhy the patch cannot be applied, or null if it can.
source_changedWhether working source differs from the checked source.

Running super fix --check <number> --yes --json applies the patch and returns one success response with message, check_number, and source_changed.

Cancellation output

Cancellation returns results with a data.interrupted flag and a data.cancellation array. Each entry has check_number, outcome, and an optional error message:

OutcomeMeaning
canceledCancellation stopped the check.
background_stoppedBackground work stopped; the result is retained.
already_finished / already_canceledAlready stopped; no request was sent.
finishedFinished before cancellation took effect.
requestedAccepted, but stopping is not yet confirmed.
unconfirmedUnconfirmed, including interruption before acknowledgment.

Check data retains the last observed state. Inspect each entry for partial success; follow requested outcomes with status to confirm cancellation.

Usage output

Running super usage --json emits one type: "usage" response. Its data contains exact totalTokens and totalChecks for the selected activity period and repository, with up to ten recent checks. The repositories list contains the account’s repository names and IDs. The start, end, and asOf fields describe the report’s time window and snapshot time.

The quota field is account-wide, independent of the activity filters. Its limit, used, and remaining combine quota and purchased tokens. The balance field separates weeklyLimit, weeklyRemaining, and purchasedTokens (1 credit = 1,000 tokens); older servers may omit it. The exhausted flag means both balances are used up, and nextAvailableAt gives the next quota recovery time when known. A null quota means quota information is unavailable. Token measurements can also be null. Check usageAvailable, pending, and each check’s usagePending before treating totals as final.

A successfully loaded report exits 0, including when quota is exhausted or recent checks failed. Invalid arguments, authentication failures, and request errors exit 2.

Exit codes

CodeMeaning
0The command succeeded. For a completed check, no current check has an operational error or problematic: true.
1A completed check reported problems, with no operational errors.
2An operational failure, including blocked or canceled checks, invalid arguments, authentication, or connection errors.

Operational failures take precedence over reported problems. The status command can exit 0 regardless of the results it displays. The check --detach command and Ctrl+C after acceptance can also exit 0 with unfinished checks; interruption before acceptance exits 2.

The cancel command exits 0 for accepted requests or when nothing remains to cancel. It exits 2 on interruption or a request or confirmation failure. Individual outcomes remain in its report.