Skip to main content
The Ravion CLI authenticates with your Ravion account and stores credentials locally for subsequent commands.

Sign in

Sign in with:
By default, login uses the device-authorization flow. The CLI prints a URL and a short code, and you approve the sign-in from any browser, including a browser on another device. This works on headless hosts.

Check your identity

Confirm who you are signed in as:
Add --json to get machine-readable output.

Select an organization

If you belong to more than one organization, choose the active one:
This walks through your organizations and persists the selection. Pass --org <id-or-name> to skip the interactive picker. Switching organization clears the active workspace, so ravion terraform asks you to pick a workspace again.

Sign out

Clear locally stored credentials:

Credential storage

Credentials are stored under your config directory:

Service accounts and API keys

For CI and automation, use a service-account API key instead of a personal membership key or interactive login.
  1. In the dashboard, open Settings / Service accounts.
  2. Create or select the service account for your automation.
  3. On that account’s detail panel, click Create API key and copy the key.
  4. Store it as your CI secret and pass it to the CLI as RAVION_API_KEY.
Create the key on the service account, not on your personal member profile.

Create a key with the CLI

Use CLI v1.16.9 or later. Sign in as a user and select your organization:
Create or select a service account with the permissions your automation needs. Key creation requires your user login; an existing API key cannot create another key. For GitHub Actions jobs that use the CLI, run gh auth login and make sure your GitHub account can manage repository secrets. From your repository, replace sa_YOUR_SERVICE_ACCOUNT_ID with the service account’s ID and pipe the new key directly into the GitHub CLI:
The token is returned only once. For other CI systems or without the GitHub CLI, run only ravion api-key create with the same flags and store its output in your secret manager as RAVION_API_KEY. If transfer fails, find the unused key with ravion api-key list, delete it with ravion api-key delete <key-id>, and retry. Do not log or save the token to a file.

Non-interactive authentication

Set a credential in the environment to authenticate without ravion login. When one of these variables is set, the CLI uses it instead of the stored credentials and skips the device-authorization flow. An API key is scoped to its organization, so you don’t run ravion switch when you use RAVION_API_KEY. This is the recommended way to authenticate CLI commands in CI. The Ravion GitHub App plans and applies repository config changes without a CLI API key.

Troubleshoot “not found” errors

CLI commands run against the organization of your current credential. A “resource not found” error (HTTP 404) for an ID that you know exists usually means the CLI is pointed at a different organization.
  1. Run ravion whoami to print the authenticated identity and active organization.
  2. If RAVION_API_KEY is set, the CLI uses that key’s organization instead of your stored login. Run unset RAVION_API_KEY to fall back to your stored credentials, or export a key from the correct organization.
  3. If you signed in with ravion login, run ravion switch to select the organization that owns the resource.
  4. Run ravion describe <id> to confirm the ID resolves in the active organization. The output includes a dashboard link.
If the error persists, contact support and include the command, the error message, and the requestId if the error includes one.

Next steps

Command reference

Browse every CLI command.

Terraform credentials

Run Terraform with Ravion-managed credentials.