CLI Authorization
Authorize the Layers CLI via a browser-based PKCE OAuth flow.
The layers CLI signs in using a browser-based PKCE OAuth flow. Run:
layers loginThe CLI:
- Opens your default browser to the sign-in page.
- Starts a short-lived local HTTP listener on
127.0.0.1. - Waits for the identity provider to redirect the authorization code back to that listener.
- Exchanges the code for an access + refresh token and stores them locally.
If the browser can't be opened automatically, the CLI prints the URL so you can paste it manually.
Force re-authentication
layers login --forceClears the current credentials and sends you back through the sign-in flow. Useful when switching accounts.
Sign out
layers logoutRemoves local credentials.
Current identity
layers whoamiPrints the signed-in email and user ID.
Default org / project
layers orgs list
layers orgs switch <org-id>
layers projects list
layers projects switch <project-id>Sets the default organization and project used by subsequent CLI commands.
If your account only has one org (or one project), layers login auto-sets
them for you.
Partner API keys (for server-side use)
For backend integrations and CI/CD, generate a partner API key from Org → Settings → API Keys. The partner API is organization-scoped and does not expire until revoked or rotated. See API Keys.