CLICommands
spec0 publish
Publish an API spec to the public registry (org-scoped, shareable URL, no team required)
Auto-generated from
spec0 commands --output=json. Do not edit by hand — changes are overwritten bynpm run sync:cli-docs.
Usage
spec0 publish [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 | |
--public-api-id <id> | Existing public API ID to update | |
--name <slug> | URL-safe API slug (e.g. payments-api). Inferred from spec info.title if omitted. | |
--title <title> | Human-readable display title. Defaults to --name if omitted. | |
--description <text> | Short description of the API | |
--version <version> | Version tag (e.g. v1.0.0) | |
--visibility <state> | Visibility: draft | published | unlisted (default: published) | published |
--release-notes <text> | Release notes for this version | |
--git-sha <sha> | Git commit SHA for provenance | |
--strict | Fail on any Spectral lint warning | |
--skip-lint | Skip lint gate | |
--dry-run | Validate only, do not call the API | |
--format <fmt> | Output format: text | json | github | text |
--org <org> | Override default org (UUID) |
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) |