scalar document

Manage local openapi file. Generated from @scalar/cli 2.10.0.

Command Description
scalar document bundle Bundle an OpenAPI document by resolving all references and external dependencies
scalar document split Split OpenAPI or AsyncAPI documents into small chunks
scalar document join Merge multiple OpenAPI or AsyncAPI documents into a single unified document
scalar document format Format an OpenAPI or AsyncAPI file
scalar document convert Convert a Postman collection to an OpenAPI document
scalar document markdown Generate Markdown from an OpenAPI file
scalar document mock Mock an OpenAPI API or AsyncAPI WebSocket and SSE channels
scalar document serve Serve an API Reference from an OpenAPI or AsyncAPI file
scalar document share Share an OpenAPI or AsyncAPI file
scalar document validate Validate an OpenAPI or AsyncAPI file
scalar document void Boot a server to mirror HTTP requests
scalar document lint Lint your OpenAPI or AsyncAPI file using spectral rules
scalar document upgrade Upgrade an OpenAPI or AsyncAPI document to version 3.1

bundle

Bundle an OpenAPI document by resolving all references and external dependencies.

scalar document bundle [options] [file|url]

Arguments

Argument Description
file|url Path to OpenAPI file or URL to bundle.

Options

Option Description
-o, --output <file> Path to save the bundled output 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 URLs to fetch during bundling at the same time.

split

Split OpenAPI or AsyncAPI documents into small chunks.

scalar document split [options] [file|url]

Arguments

Argument Description
file|url Path to OpenAPI or AsyncAPI file or URL to split.

Options

Option Description
-o, --output <path> Path to save the chunks.

join

Merge multiple OpenAPI or AsyncAPI documents into a single unified document.

scalar document join [options] <files...>

Arguments

Argument Description
files... Required. Paths to the OpenAPI or AsyncAPI files to merge.

Options

Option Description
-o, --output <file> Path to save the merged output file.
-p, --prefix-components-with-path-value <path> Dot-separated path to extract a prefix value from each input file for component names.

format

Format an OpenAPI or AsyncAPI file.

scalar document format [options] [file|url]

Arguments

Argument Description
file|url File or URL to format.

Options

Option Description
-o, --output <file> Output file.

convert

Convert a Postman collection to an OpenAPI document.

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.

markdown

Generate Markdown from an OpenAPI file.

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

mock

Mock an OpenAPI API 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 for changes.
-o, --once Run the server only once and exit after that.
-p, --port <port> Set the HTTP port for the mock server.

serve

Serve an API Reference from an OpenAPI or AsyncAPI file.

scalar document serve [options] [file|url]

Arguments

Argument Description
file|url OpenAPI or AsyncAPI file or URL to show the reference for.

Options

Option Description
-c, --config <file> JSON file with API Reference configuration.
-w, --watch Watch the file for changes.
-o, --once Run the server only once and exit after that.
-p, --port <port> Set the HTTP port for the API reference server.

share

Share an OpenAPI or AsyncAPI file.

scalar document share [options] [file]

Arguments

Argument Description
file File to share.

Options

Option Description
-t, --token <token> Pass a token to update an existing sandbox.

validate

Validate an OpenAPI or AsyncAPI file.

scalar document validate [options] [file|url]

Arguments

Argument Description
file|url File or URL to validate.

void

Boot a server to mirror HTTP requests.

scalar document void [options]

Options

Option Description
-o, --once Run the server only once and exit after that.
-p, --port <port> Set the HTTP port for the mock server.

lint

Lint your OpenAPI or AsyncAPI file using spectral rules.

scalar document lint [options] [file|url]

Arguments

Argument Description
file|url OpenAPI or AsyncAPI file path or url.

Options

Option Description Default
-r, --rule <file|url> Rule 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).

upgrade

Upgrade an OpenAPI or AsyncAPI document to version 3.1.

scalar document upgrade [options] [file|url]

Arguments

Argument Description
file|url File or URL to upgrade.

Options

Option Description
-o, --output <file> Path to save the upgraded output file.