RapiDoc CLI
@rapidoc/cli gives you the rapidoc command. It builds and runs developer portals, and the commands in this section also work on plain OpenAPI files, wherever you use <rapi-doc>.
npm install -D @rapidoc/clinpx rapidoc --help # every commandnpx rapidoc validate --help # one command's options and examplesThe commands
Section titled “The commands”| Command | What it does |
|---|---|
preview |
Shows a spec in <rapi-doc> and reloads it as you edit. |
validate |
Checks a spec strictly against the OpenAPI Specification. |
lint |
Checks what a good reference needs, beyond validity. |
bundle |
Joins a spec split over files into one document. |
pdf |
Writes the reference as a PDF. |
mock |
Serves the API with example or generated responses. |
mcp |
Turns the spec into an MCP server for AI agents. |
Everything else
Section titled “Everything else”rapidoc doctor checks your setup (Node, package versions) and prints a report for bug reports. The other commands (init, dev, build, serve, migrate) create and run a developer portal: OpenAPI references next to Markdown and Markdoc guides, with search and optional single sign-on. All Commands & Options lists every command and option; the portal commands are explained in the RapiDoc Portal docs.
In a terminal, rapidoc asks for what the options don’t say and shows a menu when run alone; piped, in CI or with --yes it never asks. Exit codes: 0 success, 1 problems in the input, 2 a wrong command line. rapidoc completion zsh|bash|fish prints a completion script for commands, options and their values.