scalar document
Work with OpenAPI and AsyncAPI descriptions.
| Command | Description |
|---|---|
scalar document bundle |
Bundle external references into a single API description |
scalar document split |
Split an OpenAPI or AsyncAPI description into referenced JSON files |
scalar document join |
Join API descriptions of the same format into one description |
scalar document format |
Format an OpenAPI or AsyncAPI description |
scalar document convert |
Convert a Postman collection to an OpenAPI description |
scalar document markdown |
Generate Markdown documentation from an OpenAPI description |
scalar document mock |
Run a Mock Server for OpenAPI operations or AsyncAPI WebSocket and SSE channels |
scalar document serve |
Serve API Reference documentation from an OpenAPI or AsyncAPI description |
scalar document share |
Publish an OpenAPI or AsyncAPI description to a public sandbox |
scalar document validate |
Validate an OpenAPI or AsyncAPI description |
scalar document void |
Mirror HTTP requests with a local server |
scalar document lint |
Lint an OpenAPI or AsyncAPI description with Spectral rules |
scalar document upgrade |
Upgrade an API description to OpenAPI 3.1 or the latest supported AsyncAPI version |
bundle
Bundle external references into a single API description.
scalar document bundle [options] [file|url]
Arguments
| Argument | Description |
|---|---|
file|url |
API description file path or URL to bundle. |
Options
| Option | Description |
|---|---|
-o, --output <file> |
Output file, or - for stdout in the input format (required for URLs and non-interactive use; otherwise confirms overwriting the input file). |
--treeShake |
Remove unused components from the bundled output. |
--urlMap |
Generate a map of resolved URLs in the bundled output. |
--fetchLimit <limit> |
Maximum number of concurrent URL fetches. |
--no-input |
Disable prompts and browser launches. |
split
Split an OpenAPI or AsyncAPI description into referenced JSON files.
scalar document split [options] [file|url]
Arguments
| Argument | Description |
|---|---|
file|url |
API description file path or URL to split. |
Options
| Option | Description |
|---|---|
-o, --output <path> |
Output directory for the split description and referenced files. |
--no-input |
Disable prompts and browser launches. |
join
Join API descriptions of the same format into one description.
scalar document join [options] <files...>
Arguments
| Argument | Description |
|---|---|
files... |
Required. OpenAPI or AsyncAPI file paths to join. |
Options
| Option | Description |
|---|---|
-o, --output <file> |
Output file for the joined description (required). |
-p, --prefix-components-with-path-value <path> |
Dot-separated path to extract a prefix value from each input file for component names. |
--no-input |
Disable prompts and browser launches. |
format
Format an OpenAPI or AsyncAPI description.
scalar document format [options] [file|url]
Arguments
| Argument | Description |
|---|---|
file|url |
File or URL to format, or - to read JSON or YAML from stdin. |
Options
| Option | Description |
|---|---|
-o, --output <file> |
Output file, or - for stdout in the input format (required for URLs; defaults to stdout in the input format for stdin, otherwise overwrites the input file). |
--no-input |
Disable prompts and browser launches. |
convert
Convert a Postman collection to an OpenAPI description.
scalar document convert [options] [file|url]
Arguments
| Argument | Description |
|---|---|
file|url |
Postman collection file path or URL to convert. |
Options
| Option | Description |
|---|---|
-o, --output <file> |
Output file (defaults to stdout). |
--merge-operations |
Merge operations with shared path+method combinations. |
--no-input |
Disable prompts and browser launches. |
markdown
Generate Markdown documentation from an OpenAPI description.
scalar document markdown [options] [file|url]
Arguments
| Argument | Description |
|---|---|
file|url |
OpenAPI file path or URL to convert. |
Options
| Option | Description |
|---|---|
-o, --output <file> |
Output file (defaults to stdout). |
--no-input |
Disable prompts and browser launches. |
mock
Run a Mock Server for OpenAPI operations or AsyncAPI WebSocket and SSE channels.
scalar document mock [options] [file|url]
Arguments
| Argument | Description |
|---|---|
file|url |
OpenAPI or AsyncAPI file or URL to mock. |
Options
| Option | Description |
|---|---|
-w, --watch |
Watch the file or URL for changes. |
-p, --port <port> |
HTTP port for the Mock Server. |
--no-input |
Disable prompts and browser launches. |
serve
Serve API Reference documentation from an OpenAPI or AsyncAPI description.
scalar document serve [options] [file|url]
Arguments
| Argument | Description |
|---|---|
file|url |
API description file path or URL to preview. |
Options
| Option | Description |
|---|---|
-c, --config <file> |
JSON file with API Reference configuration. |
-w, --watch |
Watch the file or URL for changes. |
-p, --port <port> |
HTTP port for the API Reference server. |
--no-input |
Disable prompts and browser launches. |
share
Publish an OpenAPI or AsyncAPI description to a public sandbox.
scalar document share [options] [file]
Arguments
| Argument | Description |
|---|---|
file |
API description file path or URL to share. |
Options
| Option | Description |
|---|---|
-t, --token <token> |
Token to update an existing public sandbox. |
--no-input |
Disable prompts and browser launches. |
validate
Validate an OpenAPI or AsyncAPI description.
scalar document validate [options] [file|url]
Arguments
| Argument | Description |
|---|---|
file|url |
File or URL to validate. |
Options
| Option | Description |
|---|---|
--no-input |
Disable prompts and browser launches. |
void
Mirror HTTP requests with a local server.
scalar document void [options]
Options
| Option | Description |
|---|---|
-p, --port <port> |
HTTP port for the request-mirroring server. |
--no-input |
Disable prompts and browser launches. |
lint
Lint an OpenAPI or AsyncAPI description with Spectral rules.
scalar document lint [options] [file|url]
Arguments
| Argument | Description |
|---|---|
file|url |
API description file path or URL to lint. |
Options
| Option | Description | Default |
|---|---|---|
-r, --rule <file|url> |
Spectral ruleset file path or URL. | |
--format <format> |
Report format. One of text, codeframe, markdown, summary, json, github-actions, junit. |
codeframe |
--max-problems <number> |
Maximum displayed findings (totals and exit status include all findings). | 100 |
-o, --output <file> |
Write the report to a file instead of stdout. | |
--generate-ignore-file |
Record current findings in the ignore baseline. | |
--ignore-file <file> |
Ignore baseline path (Scalar file takes priority over Redocly fallback in the current directory). | |
--no-input |
Disable prompts and browser launches. |
upgrade
Upgrade an API description to OpenAPI 3.1 or the latest supported AsyncAPI version.
scalar document upgrade [options] [file|url]
Arguments
| Argument | Description |
|---|---|
file|url |
File or URL to upgrade. |
Options
| Option | Description |
|---|---|
-o, --output <file> |
Output file (required for URLs; otherwise overwrites the input file). |
--no-input |
Disable prompts and browser launches. |
What did you think of this content?