v14.2
rapidoc • @rapidoc/cli

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.

terminal
npm install -D @rapidoc/cli

npx rapidoc --help            # every command
npx rapidoc validate --help   # one command's options and examples
For Any Spec

Works on a Plain OpenAPI File

No portal needed: these commands take a file or a URL, and relative $refs to other files work.

In CI

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.

api.yml
# .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.pdf
Developer Portals

The 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.

Every Option, Every Command

The spec commands are documented here; the portal commands in the RapiDoc Portal docs.