Redocly CLI is a strong terminal-first tool for OpenAPI workflows. If your team uses it to lint specs, bundle multi-file definitions, or generate Redoc HTML docs, it probably already fits part of your API delivery pipeline.
The question is not whether Redocly CLI is good. It is whether it covers enough of your workflow. Redocly CLI is focused on code-first API governance: lint, bundle, split, join, and build docs. If you also need visual design, mock servers, API testing, and CI test runs, you will need additional tools.
This article is about the open-source @redocly/cli package, not the hosted Redocly documentation product. If you are comparing hosted docs platforms or Redoc itself, see our roundup of Redocly alternatives for API documentation.
What Redocly CLI does well
Redocly CLI is open source and terminal-native. Install it once, then use it for spec validation, bundling, splitting, joining, and Redoc HTML generation. The full command reference is in the Redocly CLI docs.
1. Lint OpenAPI and related API descriptions
redocly lint validates API description files and applies style-guide rules. It supports OpenAPI, AsyncAPI, Arazzo, and Open-RPC.
Install and run it:
npm install -g @redocly/cli@latest
redocly lint openapi.yaml
A typical redocly.yaml config looks like this:
extends:
- recommended
apis:
main:
root: ./openapi.yaml
Redocly’s main strength is configurable API governance. You can use built-in rulesets such as:
minimalrecommendedrecommended-strictspec
You can also define custom rules for your team’s API standards.
2. Bundle, split, and join OpenAPI files
Use bundle when your API spec is split across multiple files and you need one file for publishing, CI, SDK generation, or downstream tooling.
redocly bundle openapi.yaml --output dist/openapi.json
Other useful commands:
# Split one API description into multiple files
redocly split openapi.yaml --outDir openapi
# Join multiple OpenAPI files into one file
redocly join api-1.yaml api-2.yaml --output combined.yaml
join is experimental, but it can help when multiple service specs need to be merged.
3. Generate Redoc documentation
If you want a standalone Redoc HTML file, use build-docs:
redocly build-docs openapi.yaml -o docs.html
For local preview:
redocly preview-docs openapi.yaml
If your workflow is “lint the spec, bundle it, and publish Redoc docs,” Redocly CLI is still a strong default.
Why teams look for a Redocly CLI alternative
Teams usually start looking elsewhere when they need more than spec governance.
Common reasons:
- You need API testing, not only spec linting. Linting validates the description. It does not verify that the live API behaves correctly.
- You need mock servers. Redocly CLI does not provide a built-in mock server.
- You want a GUI. Redocly CLI is code-first. That works well for engineers, but not every stakeholder wants to edit YAML in a repo.
- You want fewer tools. A common stack is Redocly for docs and bundling, Spectral for linting, Postman or Newman for testing, and another tool for mocks. That is flexible, but it adds maintenance overhead.
The best alternative depends on the job you are trying to replace.
Option 1: Apidog for the full API lifecycle
Apidog is an all-in-one API platform for design, mocking, testing, and documentation. It also provides a CLI for import, export, and CI test execution.
Use Apidog when you want one platform instead of separate tools for design, mocks, tests, and docs.
Important limitation: Apidog does not replace redocly lint as a configurable, code-first style-guide linter. There is no apidog lint command, and Apidog does not let you author Redocly-style or Spectral-style custom rules through the CLI.
If strict custom-rule linting is your main requirement, keep Redocly CLI or use Spectral. If you need lifecycle coverage, Apidog is a better fit.
Install and authenticate Apidog CLI
npm install -g apidog-cli@latest
# Token from the app:
# avatar > Account Settings > API Access Token
apidog login --with-token <YOUR_TOKEN>
Import an OpenAPI spec
apidog import \
--project 123456 \
--format openapi \
--file ./openapi.json
This validates the spec on ingest and resolves multi-file $ref references.
Export a consolidated OpenAPI file
apidog export \
--project 123456 \
--format openapi \
--output ./openapi.json \
--oas-version 3.1
This is not a direct equivalent of redocly bundle, but it covers the practical use case: producing one consolidated OpenAPI file.
Run API tests in CI
apidog run \
--project 123456 \
-t <testScenarioId> \
-e <environmentId> \
-r "cli,html,json,junit"
This gives you CI-friendly reports, including JUnit output.
See the Apidog CLI docs and the complete Apidog CLI guide for command details.
Best for: teams that want design, mock, test, and docs in one platform.
Option 2: Spectral if you only need linting
If redocly lint is the only command you care about, you may not need a platform replacement. Spectral is an open-source, rule-based linter for OpenAPI and AsyncAPI.
Install it:
npm install -g @stoplight/spectral-cli
Create a .spectral.yaml ruleset:
extends:
- spectral:oas
rules:
operation-operationId:
severity: error
Run it:
spectral lint openapi.yaml
Spectral and Redocly’s linter overlap heavily:
- both are config-driven
- both support built-in rulesets
- both support custom rules
- both work well in CI
Example CI command:
spectral lint openapi.yaml --fail-severity=warn
Read more in the Spectral OpenAPI linting guide and the broader API linting guide.
Best for: teams whose main requirement is customizable OpenAPI or AsyncAPI linting.
Option 3: Scalar or Bump.sh if you mainly need docs
If you mainly use Redocly CLI for build-docs, compare documentation tools instead of API lifecycle platforms.
Scalar and Bump.sh both turn OpenAPI descriptions into hosted, browsable API reference docs. They focus on documentation experience rather than linting, mocking, or testing.
Best for: teams whose main goal is hosted API reference documentation.
Option 4: Avoid swagger-cli for new work
You may still see swagger-cli in older tutorials, but it is deprecated. The swagger-cli GitHub repo says it is no longer maintained and points users to Redocly CLI as the successor.
swagger-cli only had two main jobs:
swagger-cli validate openapi.yaml
swagger-cli bundle openapi.yaml
It did not provide:
- style-guide linting
- documentation generation
- test execution
- mock servers
- visual design tools
If you still use it, migrate away from it. The swagger-cli guide explains what it did, and Redocly provides a migration guide from swagger-cli.
Comparison table
“Lint custom rules” means a configurable, code-first style-guide linter with custom rulesets.
| Tool | Lint custom rules | Bundle | Docs | Mock | Test | GUI | Open source | Best for |
|---|---|---|---|---|---|---|---|---|
| Redocly CLI | Yes | Yes | Yes, Redoc | No | No | No | Yes | Code-first linting, bundling, and docs from the terminal |
| Apidog | No | Via export | Yes | Yes | Yes, CI runner | Yes | No, freemium | One platform for design, mock, test, and docs |
| Spectral | Yes | No | No | No | No | No | Yes | Pure OpenAPI and AsyncAPI linting |
| Scalar / Bump.sh | No | No | Yes | No | No | Yes | Varies | Hosted API reference docs |
| swagger-cli | No | Yes | No | No | No | No | Yes, deprecated | No new projects; it is unmaintained |
Apidog’s “Via export” means apidog export emits one consolidated OpenAPI file. It solves the practical bundling need, but it is not a like-for-like bundle command.
swagger-cli to Redocly CLI flag mapping
If you are migrating from deprecated swagger-cli to Redocly CLI, the bundle flags map like this:
| swagger-cli | Redocly CLI | Meaning |
|---|---|---|
-o, --outfile <file> |
--output or -o
|
Write output to a file instead of stdout |
-t, --type <json|yaml> |
--ext <json|yaml|yml> |
Set the output file type |
-r, --dereference |
-d, --dereferenced |
Fully inline all $refs
|
Example migration:
# Old
swagger-cli bundle -o output.json openapi.yaml
# New
redocly bundle openapi.yaml --output output.json
Recommended setup by use case
Keep Redocly CLI if you need code-first governance
Use Redocly CLI when your workflow is:
redocly lint openapi.yaml
redocly bundle openapi.yaml --output dist/openapi.json
redocly build-docs openapi.yaml -o docs.html
This is a good fit for teams that want:
- open-source tooling
- terminal-first workflows
- custom API style rules
- CI-based spec governance
- Redoc documentation output
Choose Apidog if you want one lifecycle platform
Use Apidog when your team needs:
- visual API design
- built-in mock servers
- API documentation
- visual test building
- CLI-based CI test runs
- OpenAPI import and export
A practical setup is:
# Lint with Spectral or Redocly CLI
redocly lint openapi.yaml
# Import into Apidog
apidog import --project 123456 --format openapi --file ./openapi.yaml
# Run API tests in CI
apidog run --project 123456 -t <testScenarioId> -e <environmentId> -r "cli,html,json,junit"
This gives you strict linting plus lifecycle management.
The Apidog CLI in CI/CD guide shows how to wire the runner into a pipeline. The Apidog CLI vs Newman comparison is useful if your team already uses Newman.
You can download Apidog and try it free.
Choose Spectral if linting is the whole job
If your only requirement is custom-rule linting, do not switch platforms just to replace one command.
Use Spectral or keep Redocly CLI.
FAQ
Is Apidog a drop-in replacement for Redocly CLI?
No. Apidog covers more of the API lifecycle, including design, mock, test, and docs, but it does not provide a custom-ruleset linter like redocly lint.
If strict configurable spec governance is your main requirement, keep Redocly CLI or use Spectral.
Does Apidog CLI have a lint command?
No. Apidog validates structure when you import a spec with apidog import, but there is no apidog lint command and no CLI-based custom rule authoring.
For custom lint rules, pair Apidog with Redocly CLI or Spectral.
Can I bundle an OpenAPI file without Redocly CLI?
Yes. Apidog can export a consolidated OpenAPI file:
apidog export \
--project <id> \
--format openapi \
--output ./openapi.json \
--oas-version 3.1
This is not a literal bundle command, but it covers the common need: producing one output file.
If you only need bundling, redocly bundle is still a focused and reliable choice.
Should I use swagger-cli in 2026?
No. swagger-cli is deprecated and unmaintained. Its own repository points users to Redocly CLI as the successor.
Use Redocly CLI for validation and bundling, or use a broader platform like Apidog if you also need design, mocking, testing, and docs.
What is the difference between this and a Redocly docs platform comparison?
This article compares alternatives to the open-source @redocly/cli package: lint, bundle, split, join, and build docs.
If you are comparing the hosted Redocly docs platform or Redoc as a documentation renderer, read Redocly alternatives for API documentation.
For specification details, the OpenAPI Specification is the source of truth. For installation details, see Redocly CLI on npm.



Top comments (0)