spotlight-cli
The linter and engine for JSON/YAML API descriptions.
spotlight-cli is a maintained, independently-released 1.0 fork of
Stoplight Spectral — a flexible JSON/YAML linter
with out-of-the-box support for OpenAPI, AsyncAPI, and
Arazzo. It carries that foundation forward as an openly-governed, vendor-neutral build
under API Commons, published to npm under the
@spotlight-rules scope.
Install
npm i -g @spotlight-rules/spotlight-cli
spotlight lint openapi.yaml
spotlight lint openapi.yaml --ruleset .spotlight.yaml
What you get
- The
spotlightbinary — lint one or many files, with JSON/stylish/teamcity output. - Built-in rulesets referenced as
spotlight:oas,spotlight:asyncapi, andspotlight:arazzo. - Custom rulesets discovered from
.spotlight.{yaml,yml,json,js}, extendable and overridable. - A JavaScript API — the engine class is exported as
Spotlight(diagnostics typed asISpotlightDiagnostic), the same engine the VS Code extension and the browser validator run. - 11 workspace packages published as
@spotlight-rules/spotlight-*(core, parsers, functions, formats, rulesets, ruleset-bundler, ruleset-migrator, …).
The ruleset format
Rulesets follow spotlight-spec — the standalone, versioned specification of the rule and ruleset format, with a JSON Schema for validation. Browse the full catalog of rules Spotlight ships.