Spec0docs
CLICommands

Commands

Every spec0 command — auto-synced from @spec0/cli.

@spec0/cli exposes the full command surface. Each page is generated from the live binary's manifest, so flags and exit codes never drift.

CommandDescription
spec0 versionPrint CLI version, Node.js version, and optional git ref (SPEC0_CLI_GIT_REF)
spec0 whoamiShow the active org and authentication state
spec0 auth loginLog in via browser and store credentials in ~/.spec0/config.json
spec0 auth logoutDeactivate key on server and clear local config
spec0 auth statusShow the active org and authentication state
spec0 auth tokenPrint token (for scripting: spec0 auth token | pbcopy)
spec0 auth switchSwitch default org
spec0 initDetect your OpenAPI spec and create a .spec0.yaml config file
spec0 pushPush an OpenAPI spec to the platform (team-scoped, private)
spec0 publishPublish an API spec to the public registry (org-scoped, shareable URL, no team required)
spec0 mock createCreate (or fetch existing) mock server for an API; print URL and one-time key.
spec0 mock listList all mock servers in the org.
spec0 mock showShow details for the mock server tied to <api> (name or UUID).
spec0 mock urlPrint mock base URL for <api> (name or UUID). One line, pipe-friendly.
spec0 lintLint OpenAPI spec with Spectral
spec0 pullDownload spec from registry (e.g. acme/order-service or acme/order-service@v1.2.0)
spec0 searchSemantic search for APIs in your org
spec0 diffDiff two specs: each side is a file path or registry ref org/api[@tag] (latest if tag omitted)
spec0 logShow published version history. api-ref: api-name (default org) or org-slug/api-name
spec0 statusShow org overview: API count, mock servers, teams, plan
spec0 mcp urlPrint MCP server URL for Cursor/Claude config
spec0 mcp testVerify MCP server is responding
spec0 api listList APIs in your organisation (catalogue view).
spec0 api showShow metadata for a single API (no spec body).
spec0 api changelogShow changes between published versions of an API.
spec0 doctorDiagnose CLI configuration: where each setting is being read from.
spec0 sync-statusCheck whether a spec needs republishing (compares git SHA to last published).
spec0 ci generateGenerate a workflow file for <provider> that runs 'spec0 publish' on push.
spec0 commandsList every command in a machine-readable manifest. Designed for AI agents and scripts.

Exit codes

Same table appears on every command page; reproduced here so you can branch on it without opening a specific command.

codemeaning
0success
1generic / unclassified failure
2usage error (bad flags, missing args)
3not authenticated (no token / token expired)
4permission denied (403)
5resource not found (404)
6conflict (409 — e.g. name already taken)
7validation failed (422 — e.g. spec below min score)
8rate limited (429)
9upstream server error (5xx)
10network error (unreachable, timeout)

On this page