Rolit CLI
Automation and exit codes
Use rolit in scripts and CI with JSON output, environment variables, and exit codes.
JSON output
Add --json (or set ROLIT_JSON=1) to get machine-readable output. Job commands write exactly one rolit.job.v1 envelope to stdout. Estimates and progress go to stderr, so you can pipe stdout safely.
rolit research trend "AI video" --json > result.jsonJSON and non-terminal sessions never approve actions automatically. See Approval modes.
Environment variables
| Variable | Equivalent |
|---|---|
ROLIT_JSON | --json |
ROLIT_PROJECT | --project |
ROLIT_WORKSPACE | --workspace |
ROLIT_APPROVAL_MODE | --approval-mode |
ROLIT_TODO | rolit chat --todo |
ROLIT_NO_UPDATE_CHECK | Set to 1 to turn off update checks |
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General or protocol failure |
| 10 | Login required |
| 13 | Server denied the request |
| 20 | A local approval or policy prevented execution |
| 21 | A publish, send, or spend action is pending review (rolit approvals) |
| 22 | A job stopped before a credit-consuming step because it would exceed its credit cap |
| 29 | Rate limited |
| 30 | An SEO job's --fail-on threshold matched. The report is still printed. |
| 31 | .rolit/seo.json is invalid or required SEO configuration is missing |
| 33 | A site crawl was rate-limited and the result is partial |
Example: a CI check
rolit seo audit dist/ --fail-on fail
echo $?30Exit code 30 means the audit found issues at or above the threshold, so the CI step fails.
Limit credit spend
Pass --max-credits to a job to stop it before it exceeds a cap. It exits with 22 when the cap would be exceeded.
Scheduling in CI
rolit schedule create --runner ci writes a GitHub Actions workflow for you to review. It uses --json and an explicit --budget and holds no secrets.