Scalar CLI
Quick Start#
npx @scalar/cli helpInstallation#
If you really want to become friends you should install the CLI:
npm -g install @scalar/cliOtherwise just prefix all commands with npx @scalar/cli instead of scalar. That's fine, too.
Conflict: EXIST: file already exists#
There's another scalar CLI, which is bundled with git. If you run into naming conflicts, but never use the other CLI anyway, you can replace it like this:
npm -g --force install @scalar/cliOr, if you want to keep using the other scalar CLI, you can just stick to npx (or pnpm dlx):
# Execute without installation (npm)
npx @scalar/cli help
# Execute without installation (pnpm)
pnpm dlx @scalar/cli helpCommands#
- auth Manage authorization on Scalar platform
- document Manage local openapi files
- project Manage Scalar docs project
- registry Manage your Scalar registry
- team Manage user teams
Authentication#
To use the CLI with Scalar services, see the Authentication guide.
GitHub Actions#
To validate your OpenAPI file in GitHub Actions, add this workflow:
# .github/workflows/validate-openapi-file.yml
name: Validate OpenAPI File
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version: 24
- name: Validate OpenAPI File
# Replace `./my-openapi-file.yaml` with the correct path and filename for your project.
# Or: run `npx @scalar/cli init` and add the config file to your repository.
run: npx @scalar/cli document validate docs/openapi.yaml