Redocly CLI
$ redocly Official Low RiskRedocly CLI (@redocly/cli) is the flagship OpenAPI 2.0/3.0/3.1 toolchain for linting (redocly lint), multi-file bundling (redocly bundle), stats (redocly stats), and rendering static Redoc HTML docs (redocly build-docs). Rich --format=json / github-actions output and zero-JVM Node execution make it ideal for API-first coding agents.
npm install -g @redocly/cli redocly validates, bundles, and builds static docs locally over OpenAPI specs with --format=json in under a second.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Fast Node.js CLI with --format=json, github-actions, summary, and checkstyle formatters plus non-interactive flags.
--format=jsononlintandstats- Zero interactive prompts during validation, bundling, or
build-docs
Lint, stats, and bundling run purely offline on local specs; remote cloud push is isolated behind explicit push command and REDOCLY_AUTHORIZATION.
- Read-only
lintandstats - Explicit
-ooutput path forbundleandbuild-docs
Lightweight pure-JS/TS npm package (@redocly/cli) runnable globally or via npx @redocly/cli with no JVM.
npm install -g @redocly/cliandnpx @redocly/cli
Solves OpenAPI 3.1 validation, $ref bundling, splitting, and HTML doc generation cleanly in one tool.
- Supports
lint,bundle,split,stats, andbuild-docs
Official Redocly repository (Redocly/redocly-cli) actively maintained under MIT.
- Official Redocly GitHub organization
Thorough official CLI reference docs and rule explanations at redocly.com/docs/cli/.
- Official docs at redocly.com/docs/cli/
Security, Auth & Guardrails
No credentials needed for lint/bundle/build-docs; optional Redocly Cloud push reads REDOCLY_AUTHORIZATION.
CLI is free open-source software (MIT); optional Redocly Cloud portal hosting has free and paid tiers.
# Redocly CLI Agent Rules - Run `redocly lint <spec> --format=json` after any OpenAPI schema edit. - Use `redocly bundle -o dist/...` into a separate artifact path rather than overwriting source `$ref` files. - Do not invoke `redocly push` to Redocly Cloud without explicit human approval.
Agent-Ready Command Recipes
Safe Read-Only Queries
redocly lint openapi.yaml --format=json
Validates OpenAPI 3.0/3.1 rules and outputs machine-parseable JSON problem records.
redocly stats openapi.yaml --format=json
Reports counts of paths, operations, schemas, and parameters in JSON.
Controlled Writes & Previews
redocly bundle openapi.yaml -o dist/openapi.bundled.yaml
Resolves external $ref files and writes a clean single-file spec to dist/openapi.bundled.yaml.
Strengths for Agents
- +
--format=jsononredocly lintandredocly statsmakes OpenAPI diagnostics trivial for agents. - + Pure Node.js execution without Java/JVM overhead.
- + Handles multi-file
$refbundling (redocly bundle) and static Redoc HTML docs (build-docs).
Caveats & Pitfalls
- !
redocly preview-docsstarts a blocking local web server. - ! Telemetry is enabled unless opted out via
REDOCLY_TELEMETRY=offin strict air-gapped/privacy setups.