Authentication with tcloud CLI
This guide covers how to authenticate with the Thalassa Cloud Platform using the tcloud CLI.
Authentication Methods
The tcloud CLI supports these authentication methods:
- Browser OIDC login (default for interactive use)
- Personal Access Token (PAT) (automation and non-interactive use)
- OIDC client credentials (service accounts and automation)
- Access tokens
For day-to-day work on a trusted workstation, prefer browser OIDC. Use personal access tokens or client credentials when you need non-interactive authentication (CI/CD, scripts, headless environments).
Browser OIDC login (recommended)
Browser-based OIDC is the default when you run tcloud context create or tcloud context login without other credentials. The CLI opens your browser, completes the OIDC authorization code flow with PKCE, and stores credentials securely.
Create a context
tcloud context create --name productiontcloud opens your default browser for sign-in and binds the session to the context. Optionally set organisation scope during create:
tcloud context create --name production --organisation=my-companyRe-authenticate an existing context
tcloud context loginTo switch an existing PAT-based context to browser OIDC:
tcloud context login --browserCredential storage
Access and refresh tokens are stored in your OS keychain (macOS Keychain, Windows Credential Manager, or Linux secret service). The config file (~/.tcloud on Linux/macOS) holds context metadata such as API endpoint, organisation, and project scope — not the tokens themselves.
If you migrated from an older setup with credentials in the config file:
tcloud context fix --migrate-credentialsPersonal Access Token (PAT)
Personal Access Tokens remain supported for automation and integrations. Prefer them when a browser session is not available.
Creating a Personal Access Token
- Log in to your Thalassa Cloud Console
- In the top right, navigate to
/personal-access-tokens - Click “Create Personal Access Token”
- Give your token a descriptive name
- Select the appropriate permissions
- Optionally, configure the expiry date (recommended)
- Copy the generated token (you won’t be able to see it again)
Using a Personal Access Token
Method 1: Create a Context (Recommended)
tcloud context create --name my-context \
--api=https://api.thalassa.cloud \
--token=your-personal-access-tokenMethod 2: Use Global Flags
tcloud --api=https://api.thalassa.cloud \
--token=your-personal-access-token \
meOptionally, you can also use --organisation to target a specific organisation. By default, it will select the first organisation you are a member of. You can always switch between organisations by using tcloud context organisation <organisation>.
Security Best Practices
- Never commit tokens to version control
- Rotate tokens regularly
- Use the minimum required permissions
- Prefer browser OIDC for interactive use so long-lived tokens are not needed on workstations
OIDC client credentials
For service accounts and non-interactive OIDC flows:
tcloud context create --name automation \
--api=https://api.thalassa.cloud \
--client-id=<oidc-client-id> \
--client-secret=<oidc-client-secret> \
--organisation=<org-slug>Context Management
Contexts allow you to manage multiple authentication configurations and switch between them easily. See Context Management for details.
Creating Contexts
# Interactive browser login (default)
tcloud context create --name production --organisation=my-org
# Non-interactive with a PAT
tcloud context create --name staging \
--api=https://api.thalassa.cloud \
--token=staging-token \
--organisation=my-org-stagingListing Contexts
tcloud context listSwitching Contexts
# Use a specific context
tcloud --context=production me
# Set default context
tcloud context use productionDeleting Contexts
This deletes the current context.
tcloud context deleteVerifying Authentication
After setting up authentication, verify it’s working:
tcloud me organisationsYou should see output similar to:
ID NAME SLUG
d0nm4fiacp3nbhm3nv2g my company my-company-betyt