Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Scalar CLI

$ scalar Official Low Risk
Scalar · Design & Docs · MIT · macos / linux / windows

Scalar CLI (@scalar/cli) provides a modern developer workflow for OpenAPI/Swagger documents: validating specs, bundling multi-file $ref trees, formatting JSON/YAML, running a local mock server, and serving Scalar API Reference docs. Note that scalar document bundle overwrites the input file unless --output is passed.

FCRS-1.0 Score
84 /100
Good
Medium Confidence
Zero-Friction Install
npm install -g @scalar/cli
CLI vs MCP Decision CLI Preferred vs MCP

Local OpenAPI validation, formatting, and bundling with scalar runs instantaneously on disk without an MCP round-trip.

Agent-Readiness Checklist

— JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 19 / 25

document validate, bundle, and format run headlessly with clear exit codes, though validation diagnostics are plain text without a native --json flag and mock/reference block as servers.

  • document validate/bundle/format run headlessly
  • No --json diagnostics flag on validation; mock/reference are blocking servers
Trust & Safety 22 / 25

validate is read-only, while bundle and format mutate the input file by default unless --output is explicitly specified.

  • scalar document bundle overwrites the source file if --output is omitted
Setup & Portability 13 / 15

Cross-platform Node package runnable via npm install -g @scalar/cli or npx @scalar/cli.

  • Published on npm as @scalar/cli
Utility & Efficiency 13 / 15

Convenient single CLI combining OpenAPI validation, Prettier-backed formatting, bundling, mocking, and API Reference previews.

  • Covers full OpenAPI local lifecycle in one CLI
Maintenance & Lineage 9 / 10

Official Scalar repository (scalar/scalar) actively maintained under the MIT license.

  • Official scalar/scalar GitHub repository
Docs & Verifiability 8 / 10

Clear official guides at guides.scalar.com/scalar/scalar-cli and structured subcommand --help.

  • Official documentation at guides.scalar.com

Security, Auth & Guardrails

Auth Modes
No Auth Env API Key Config File
Credential Storage

Local OpenAPI commands need no credentials; Scalar Registry login tokens are stored locally when publishing projects.

Side Effects
Read-Only Local Write Remote Write
Cost & Quotas

MIT open-source CLI; optional hosted Scalar Registry publishing has free and paid tiers.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# Scalar CLI Agent Rules
- Always pass `--output <new-path>` with `scalar document bundle` so the source spec is not overwritten in place.
- Do not invoke `scalar mock` or `scalar reference` in foreground turns without backgrounding—they run long-lived HTTP servers.

Agent-Ready Command Recipes

Safe Read-Only Queries

Validate an OpenAPI specification
scalar document validate openapi.yaml

Checks Swagger 2.0 or OpenAPI 3.0/3.1 conformance without modifying openapi.yaml.

Controlled Writes & Previews

Bundle multi-file OpenAPI refs to a new file
scalar document bundle openapi.yaml --output dist/openapi.bundled.yaml

Writes the resolved bundle to dist/openapi.bundled.yaml rather than overwriting openapi.yaml in place.

Strengths for Agents

  • + Unified CLI for OpenAPI validation, bundling, formatting, local mocking, and Scalar Reference previews.
  • + Instant zero-install execution via npx @scalar/cli.
  • + Clean MIT-licensed codebase backed by Scalar.

Caveats & Pitfalls

  • ! scalar document bundle overwrites the input file in place when --output is omitted.
  • ! scalar mock and scalar reference start persistent HTTP servers that block unless backgrounded.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI