Run sume doctor --agent --json as a CI preflight and keep the output

sume doctor --agent --json checks local CLI readiness without calling the API. Run it before job steps, fail on bad JSON or a nonzero exit, and keep the file.

4 min readSume
All posts

sume doctor --agent --json inspects local readiness without calling the API, according to the CLI configuration docs. Run it as the first step of a pipeline, write its output to a file, fail the step on a nonzero exit or on output that is not valid JSON, and upload the file with the job logs.

What the docs promise

The pages I read do not document the JSON fields or which exit codes the command uses, so this recipe checks only the two things you can rely on: the process status and that the output parses. Add field checks after you read your own run's output.

Preflight commands (read 2026-10-04)
CommandCalls the APIUse
sume versionNoRecord the installed version
sume doctor --agent --jsonNo, local onlyCheck local readiness
sume auth statusNot statedConfirm credentials are present
sume balanceYesCheck credit before paid steps

Preflight script

Order matters: doctor first because it is local and cheap, then the paid work.

set -euo pipefail
mkdir -p ci-artifacts

sume version | tee ci-artifacts/sume-version.txt
sume doctor --agent --json > ci-artifacts/sume-doctor.json
python3 -c 'import json,sys; json.load(open(sys.argv[1]))' ci-artifacts/sume-doctor.json \
  || { echo "sume doctor did not return JSON" >&2; exit 1; }
sume auth status

Keep the evidence

Keep sume-doctor.json for failed runs. When you contact support, the file plus the job id and x-sume-request-id is the useful pair. Avoid committing it to the repository.

If it fails

If auth is missing, the troubleshooting page points to sume login for people and sume auth setup --api-key for automation; see the CI authentication recipe.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume