Interactive login
The default authentication method opens your browser for a secure login flow.- Opens your default browser
- Prompts you to authenticate via Control Plane
- Creates a
defaultprofile with your credentials
After successful authentication, the CLI is ready to use with your default profile.
Using WSL2? Browser login requires extra setup
Using WSL2? Browser login requires extra setup
When you run After installation, Chrome appears in your Windows Start menu under the distro name (e.g., Ubuntu → Google Chrome). Run
cpln login in WSL2, the localhost URL won’t work in your Windows browser because it points to the WSL2 instance, not Windows.Solution: Install a browser in WSL2 (requires WSLg):cpln login, copy the localhost URL from the terminal, and paste it into your WSL2 Chrome.Alternative: Use browser-less login with a service account token.Browser-less authentication
For environments without browser access (SSH sessions, CI/CD, containers), use a service account token.1
Create a service account
- Console
- CLI
- Click Service Accounts in the left menu and click New (or use the Create dropdown in the upper right corner)
- Enter a unique name and optional description
- Click Next (Tags), add any optional tags, then click Create
2
Generate a key
- Console
- CLI
- Open the service account you created
- Click the Keys link
- Enter a key description and click Add
- Copy and download the generated key securely
3
Authenticate with the token
Use the token directly or create a profile:Set as default (optional):
- Create a profile (recommended)
- Use token directly
- Use environment variable
When using
--token, always include --gvc if your commands require a default GVC context.For detailed browser-less setup, see the Browser-less CLI Login guide.
Token management
View your current token
Display the token for a profile:Override token for a single command
Use a different token without changing your profile:Token precedence
The CLI uses tokens in this order:--tokenflag (highest priority)CPLN_TOKENenvironment variable- Profile token (default)
Authentication for CI/CD
For automated environments:- Create a service account with appropriate permissions
- Generate a key and store it securely (e.g.,
CPLN_TOKENin secrets manager) - Create a profile in your CI/CD pipeline
Troubleshooting
Login command doesn't open a browser
Login command doesn't open a browser
If the browser doesn’t open automatically, copy the URL displayed in the terminal and paste it into your browser manually. Complete the login flow in the browser to authenticate.
Login command opens wrong browser
Login command opens wrong browser
The CLI uses your system’s default browser. Change your default browser in your OS settings, or copy the URL from the terminal and paste it into your preferred browser.
Authentication failed or 403 Forbidden error
Authentication failed or 403 Forbidden error
A 403 error typically means one of the following:
- Wrong org: You’re trying to access an org you don’t have access to, or there’s a typo in the org name. Verify with
cpln profile get. - Missing token: No token is provided. Ensure
CPLN_TOKENis set or you’re using a profile with a valid token. - Insufficient permissions: Your token doesn’t have the required permissions. Generate a new key or re-login to refresh your token:
Or for service accounts:
For more troubleshooting help, see the Troubleshooting page.