Interactive login
The default authentication method opens your browser to sign in with a confirmation code.- Prints a six-digit confirmation code and opens the login page in your browser
- Waits while you sign in and enter the code
- Creates a
defaultprofile with your credentials
After successful authentication, the CLI is ready to use with your default profile.
Unattended authentication
For automation where no person is available to complete a sign-in (CI/CD pipelines, scripts, long-lived 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 service account token 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 session expired or timed out
Login session expired or timed out
The confirmation code is valid for about 10 minutes. If it expires before you finish signing in, the CLI stops waiting and reports that the session expired. Run
cpln login again to get a fresh URL and code.No browser available on the machine running the CLI
No browser available on the machine running the CLI
The browser does not have to run on the same machine as the CLI. Copy the printed URL to a browser on any device, sign in, and enter the confirmation code — the waiting CLI picks up the credentials automatically.If no person is available to complete a sign-in at all, such as in a CI/CD pipeline, use a service account token instead.
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.
Next steps
Profiles
Manage multiple authentication contexts
CI/CD Setup
Automate with service accounts