RapiDoc CLI
One command for your OpenAPI spec, from the first edit to CI: preview it, check it, bundle it, print it, mock it and hand it to AI agents. The same command builds and serves developer portals.
npm install -D @rapidoc/cli
npx rapidoc --help # every command
npx rapidoc validate --help # one command's options and examplesWorks on a Plain OpenAPI File
No portal needed: these commands take a file or a URL, and relative $refs to other files work.
rapidoc preview
Shows a spec in <rapi-doc> and reloads it whenever a file in its folder changes.
rapidoc validate
Checks a spec strictly against OpenAPI 2.0 to 3.2, with file, line and column for each error. JSON and SARIF output.
rapidoc lint
Rules for what a good reference needs: operationIds, summaries, examples, declared tags, security on writes.
rapidoc bundle
Joins a spec split over several files into one document, or dereferences it completely.
rapidoc pdf
Writes the reference as a PDF, with RapiPdf: your title, colors, fonts and labels.
rapidoc mock
Answers every operation over HTTP from examples or generated data, validates requests and checks OAuth tokens.
rapidoc mcp
Turns the spec into an MCP server for AI agents: export the project, or serve it over stdio.
Guard Every Pull Request
validate and lint exit with code 1 on problems, and write SARIF for GitHub code scanning, so findings show up on the pull request. bundle and pdf produce files to publish next to your docs.
Piped, in CI or with --yes, the command never asks a question. In a terminal it asks for what the options don't say.
# .github/workflows/api.yml, in a job's steps
- run: npx rapidoc lint openapi.yaml --format sarif > lint.sarif
- run: npx rapidoc bundle openapi.yaml -o dist/openapi.json
- run: npx rapidoc pdf openapi.yaml -o dist/reference.pdfThe Same Command Runs Your Portal
A RapiDoc Portal puts your API references next to Markdown and Markdoc guides, with search and optional single sign-on. These commands create, build and serve it.
rapidoc init
Creates a portal from your OpenAPI files.
rapidoc dev
Runs it locally, reloading on every change.
rapidoc build
Builds the static site.
rapidoc serve
Serves the build with single sign-on and access rules.
rapidoc migrate
Updates a portal's config to the current version.
rapidoc doctor
Checks your setup and prints a report for bug reports.