Authentication

To use the Scalar CLI with Scalar services, you need to authenticate first.

Login

scalar auth login

This opens the dashboard to authenticate, which is typically what you want on a local development machine.

Login with an API Key

For CI/CD or other automated workflows, you can authenticate with an API key directly:

scalar auth login --token your-secret-scalar-api-key

To generate an API key, go to https://dashboard.scalar.com and navigate to Account > API Keys.

You can also set SCALAR_API_KEY and run scalar auth login. When both are set, SCALAR_API_KEY takes precedence over --token.

Check the Current User

scalar auth whoami

Logout

scalar auth logout