Authentication Commands

The CRE CLI supports two authentication methods:

  • Browser-based login (cre login) — Interactive login for local development
  • API key (CRE_API_KEY environment variable) — Non-interactive authentication for CI/CD pipelines and headless environments

Browser-based authentication

cre login

Starts the interactive authentication flow. This command opens your browser for user login and saves your credentials locally.

Usage:

cre login

Authentication steps:

  1. The CLI opens your default web browser to the login page
  2. Enter your account email address
  3. Enter your account password
  4. Enter your one-time password (OTP) from your authenticator app
  5. The CLI automatically captures and saves your credentials locally

For a detailed walkthrough with screenshots, see Logging in with the CLI.

cre logout

Revokes authentication tokens and removes local credentials. This invalidates the current authentication tokens and deletes stored credentials from your machine.

Usage:

cre logout

cre whoami

Shows your current account details. This command fetches and displays your account information, including your email and organization ID. This works with both browser-based login and API key authentication.

Usage:

cre whoami

API key authentication

For CI/CD pipelines, automated scripts, or any environment where a browser is not available, you can authenticate using an API key. When the CRE_API_KEY environment variable is set, the CLI uses it automatically — no cre login required.

Creating an API key

  1. Log in to the CRE platform
  2. Navigate to the Organization page
  3. Select the APIs tab
  4. Click + Organization API
  5. Give your key a name and confirm

Using the API key

Set the CRE_API_KEY environment variable before running CLI commands:

export CRE_API_KEY="your-api-key"
cre whoami

When CRE_API_KEY is set, the CLI skips the browser-based login flow entirely. All commands that require authentication (deploying, managing workflows, etc.) will use the API key.

In a CI/CD pipeline, configure CRE_API_KEY as a secret environment variable in your platform and run CLI commands as usual.

Authentication methods summary

Method
Best forHow it works
cre loginLocal developmentOpens a browser for interactive login with 2FA
CRE_API_KEYCI/CD, scripts, headless environmentsSet the environment variable — no browser needed(*)

(*) API key authentication requires your account to have Early Access approval.

Learn more

Get the latest Chainlink content straight to your inbox.