Skip to content

JSON output

Pass --json to any command except browse to get machine-readable output. Coding agents use it to drive the CLI from a shell tool, and the bundled arc-running-evals and arc-creating-evals skills depend on it. Treat the contract on this page as a public API.

  1. With --json, stdout holds exactly one JSON object and nothing else. Progress and warnings go to stderr. Don’t merge the two streams with 2>&1 when you parse the output.

  2. Every object has "schemaVersion": 1. The version changes only when an existing field is removed, renamed, or changes meaning. New fields can appear at any time, so ignore fields you don’t recognize.

  3. Paths in results are absolute.

  4. When a command can’t finish, it prints an error object instead of the result:

    { "schemaVersion": 1, "error": { "kind": "usage", "message": "Unknown flag: --bogus." } }
error.kindMeaning
usageA bad flag or argument. Fix the command line.
commandThe command started but couldn’t finish, for example because a file is missing, it refused to overwrite a file, the runtime is not ready, or evals.json is invalid.
internalAn unexpected exception. Please report it.
cancelledrun was cancelled with Ctrl-C. The current case was stopped and cleaned up.
Exiterror in stdout?Meaning
0noSuccess. For run, every hard assertion passed.
1noA verdict, not a crash. run had a failing case or hard assertion, or a soft miss under --strict. emit --check found drift.
1yesThe command did not complete. Read error.kind.
130yesrun was cancelled with Ctrl-C, and error.kind is cancelled.

Read the verdict from the JSON, not only from the exit code. Exit code 1 with an error object means the command never ran to the end. Don’t report that as failed evals.

Each payload has schemaVersion plus these fields.

CommandFields
runrunId, iteration (optional), summary, skills[]
createskillDir, evalsJsonPath, dryRun, written, guided, interactive, evals (the generated evals.json), fixtureInputs, rationale, adjacentNegativeAssumption
emitfromPath, outPath, skillName, caseCount, bytes, check, changed, wrote
reviewrunDir, reviewPath, feedbackPath, compare, caseCount
improvefeedbackPath, runDir, evalsJsonPath, dryRun, applied, suggestions[], updatedEvals (optional)
auditinput, skills[] with each skill’s findings, summary, outputPath (optional)
optimize-descriptionmode (generate-only, score, or optimize) plus the report for that mode
packageskillDir, skillName, outputPath, fileCount, totalBytes, manifest
init-runtimetargetDir, modelsPath, settingsPath, provider, model, overwritten
install-skillstarget, installed[] with skill and path, skipped[] with skill, path, and reason
--help, <command> --helpcommand (the command name, or null for the root help), help (the text)
--versionversion

For run, summary has totalCases, passedCases, failedCases, totalAssertions, passedAssertions, failedAssertions, softFailedAssertions, and assertionPassRate. Each entry in skills[] has skillName, skillDir, outputDir, cases[], and errors[]. Compare runs also have benchmark and benchmarkPath.

For audit, summary has skillCount, findingCount, highCount, warnCount, and infoCount. audit exits 0 even when it reports findings, so a CI job should read these counts.

bundled --json is the one exception to the contract. It prints a bare array of { "name", "path" } objects with no schemaVersion, so scripts written before the contract keep working.

A run where one assertion failed. The exit code is 1 and there is no error key:

Terminal window
arc-skill-eval run ./skills/my-skill --json > result.json
echo $? # 1
jq '.summary.failedAssertions' result.json

A usage error. The exit code is also 1, but stdout has an error object:

Terminal window
$ arc-skill-eval run ./skills/hello-world --model foo --json
{
"schemaVersion": 1,
"error": {
"kind": "usage",
"message": "Invalid --model: foo. Expected provider/model or provider/model:thinking."
}
}

A drift check in CI:

Terminal window
arc-skill-eval emit ./skills/my-skill --check --json
{
"schemaVersion": 1,
"fromPath": "/repo/skills/my-skill/evals/evals.eval.ts",
"outPath": "/repo/skills/my-skill/evals/evals.json",
"skillName": "my-skill",
"caseCount": 1,
"bytes": 358,
"check": true,
"changed": true,
"wrote": false
}

browse and create --interactive need a terminal and refuse to start without one. --json can’t be combined with --interactive. An agent should use run --json and create --dry-run --json instead.

The source of this contract is docs/cli-json-contract.md in the repository.