CLI Configuration
The OpenChoreo CLI (occ) is the command-line interface for managing OpenChoreo resources, projects, and deployments. It provides commands to create, read, update, and delete OpenChoreo resources from your terminal.
Prerequisitesβ
Before configuring the CLI, ensure the following:
- OpenChoreo Control Plane installed and accessible
- CLI installed (see CLI Installation)
- Network connectivity to the OpenChoreo API endpoint
Using an External Identity Providerβ
By default, OpenChoreo configures Thunder as the identity provider for the CLI with a pre-configured OAuth client for testing purposes. If you are using an external identity provider, create an OAuth 2.0 client with the following requirements:
OAuth Client Requirements:
-
Grant Types: The OAuth client must support:
authorization_code- For user authentication and login flowsrefresh_token- For refreshing access tokens without re-authentication- Support for PKCE (Proof Key for Code Exchange) - For secure authentication without client secrets
-
Token Format: Configure the client to issue JWT tokens (not opaque tokens)
-
Redirect URLs: Add the CLI callback URL:
http://127.0.0.1:55152/auth-callback- This is the local callback URL where the CLI receives the authentication response
-
Public Client: The CLI OAuth client should be configured as a public client (does not require client secret) since it uses PKCE flow
The CLI uses the OAuth 2.0 Authorization Code flow with PKCE extension. This is a secure authentication method for public clients (like CLI tools) that don't store client secrets.
Configuring the CLI OAuth Clientβ
Once you have created the OAuth client in your identity provider, update the OpenChoreo control plane configuration with the client ID:
helm upgrade --install openchoreo-control-plane oci://ghcr.io/openchoreo/helm-charts/openchoreo-control-plane \
--version 0.0.0-latest-dev \
--namespace openchoreo-control-plane \
--reuse-values \
--set security.oidc.externalClients\[0\].name="cli" \
--set security.oidc.externalClients\[0\].client_id="your-cli-client-id" \
--set security.oidc.externalClients\[0\].scopes="{openid,profile,email}"
Configuration Parameters:
security.oidc.externalClients[0].name: Client name (use "cli")security.oidc.externalClients[0].client_id: OAuth client ID from your identity providersecurity.oidc.externalClients[0].scopes: OAuth scopes required for authentication (openid, profile, email)
After updating the configuration, you can use the CLI to login. The CLI will automatically open a browser window for authentication:
occ login
Service Account Authenticationβ
For automation scenarios (CI/CD pipelines, scripts, etc.), you can use client credentials flow with a service account OAuth client:
OAuth Client Requirements for Service Accounts:
- Grant Type:
client_credentials - Token Format: JWT tokens
- Confidential Client: Store client secret securely
- Token Endpoint Authentication:
client_secret_post(credentials sent in the request body, not as a Basic auth header)
You can authenticate using command-line flags:
occ login --client-credentials \
--client-id <your-client-id> \
--client-secret <your-client-secret>
Configuration Parameters:
--client-credentials: Enable client credentials flow--client-id: OAuth client ID for service account--client-secret: OAuth client secret for service account
Alternative: Using Environment Variables
For CI/CD pipelines, you can use environment variables instead of command-line flags:
export OCC_CLIENT_ID="your-client-id"
export OCC_CLIENT_SECRET="your-client-secret"
occ login --client-credentials
Environment Variables:
OCC_CLIENT_ID: OAuth client ID for service accountOCC_CLIENT_SECRET: OAuth client secret for service account
Verifying the Configurationβ
After logging in, verify that the CLI is configured correctly:
occ component list
This should display both the CLI version and the OpenChoreo server version, confirming that the CLI can communicate with the control plane.
Troubleshootingβ
Browser Not Openingβ
If the browser doesn't open automatically during login:
- Check that you have a default browser configured
- Manually copy the URL displayed in the terminal and open it in your browser
- Complete the authentication flow and return to the terminal
Authentication Timeoutβ
If authentication times out:
# Ensure the API endpoint is accessible
curl https://api.openchoreo.example.com/health
Token Refresh Failuresβ
If token refresh fails:
# Re-authenticate with the CLI
occ logout
occ login
See Identity Provider Configuration for detailed identity provider setup instructions.
Next Stepsβ
After configuring the CLI:
- Explore available commands with
occ --help - See the CLI Reference for detailed command documentation