CLICommands
spec0 lint
Lint OpenAPI spec with Spectral
Auto-generated from
spec0 commands --output=json. Do not edit by hand — changes are overwritten bynpm run sync:cli-docs.
Usage
spec0 lint [spec-file] [options]Arguments
| name | required | description |
|---|---|---|
spec-file | no | Path to OpenAPI spec (or use --spec-file / global --spec-file) |
Flags
| flag | description | default |
|---|---|---|
--spec-file <path> | Path to OpenAPI spec file | |
--ruleset <file> | Use custom ruleset file | |
--org-ruleset | Fetch org ruleset from server | |
--save-ruleset <file> | Upload <file> as the org's stored Spectral ruleset (skips the lint step) | |
--format <fmt> | Output: text, json, github, sarif | text |
--min-score <n> | Exit 1 if score below n (0-100) | 0 |
--strict | Exit 1 on any warning |
Exit codes
Stable contract — branch on these from CI and agents.
| code | meaning |
|---|---|
| 0 | success |
| 1 | generic / unclassified failure |
| 2 | usage error (bad flags, missing args) |
| 3 | not authenticated (no token / token expired) |
| 4 | permission denied (403) |
| 5 | resource not found (404) |
| 6 | conflict (409 — e.g. name already taken) |
| 7 | validation failed (422 — e.g. spec below min score) |
| 8 | rate limited (429) |
| 9 | upstream server error (5xx) |
| 10 | network error (unreachable, timeout) |