Skip to content

CLI authentication

The CLI supports browser login for people and scoped API keys for automation. Stored credentials are kept in the operating-system keychain rather than the CLI configuration file.

Terminal window
champrep auth login

The CLI creates a PKCE-protected approval request, opens the CHAMPREP sign-in experience, waits for approval, and stores the resulting short-lived credential in the keychain.

Use this mode for interactive work on a trusted workstation.

On a remote terminal that cannot open a browser:

Terminal window
champrep auth login --no-browser

Open the displayed approval URL on a trusted browser, sign in, and approve the request before it expires. The terminal polls the Gateway at a bounded interval and completes after approval.

You can change the approval deadline:

Terminal window
champrep auth login --no-browser --timeout 15m
Terminal window
champrep auth whoami
champrep auth status

auth whoami displays the active identity and profile. auth status adds live Gateway quota information and available audit context. Upstream sections can be marked unavailable without invalidating a working local login.

Terminal window
champrep auth list
champrep auth switch PROFILE
champrep config env

Profiles represent roles or organizations available to the same account. A profile switch cannot cross into another account that has not been separately authenticated on the machine.

Use --env NAME to override the configured environment for one command:

Terminal window
champrep --env production auth whoami

Do not set an environment’s API URL to an individual service backend. The CLI requires a Gateway-compatible URL.

Terminal window
champrep auth logout

Use --all to remove stored credentials across every configured environment. Use --force only when a non-interactive workflow must skip confirmation.

Terminal window
champrep auth logout --all

Signing out removes local keychain and profile state. Revoke an API key in the web dashboard when the key itself should stop working everywhere.

For CI, cron, and unattended scripts, use a narrowly scoped API key instead of browser login. Continue with API keys for CLI automation.