Skip to main content
The openlayer login command logs you into your Openlayer account — or creates one — through Openlayer CLI. It saves the resulting credentials to a CLI profile, so the other commands authenticate without asking again.
openlayer init signs you in as one of its steps, so you do not need to run login separately when setting up a project for the first time.

Usage

login first asks for a profile name, defaulting to default — this prompt is skipped when you pass --profile-name. It then asks how you want to sign in:

Browser sign-in

1

Confirm the API URL

login asks for the Openlayer API URL, defaulting to the one in your profile. Keep https://api.openlayer.com if you use https://app.openlayer.com; enter your own server URL if you are on a self-hosted or on-prem deployment.
2

Enter the code in your browser

The CLI prints an authentication code and opens the verification page in your browser. If it cannot open a browser — over SSH, for example — it prints the URL for you to open manually. Enter the code there, then select your workspace. If you do not have an Openlayer account yet, you can create one on that page, so no separate signup step is needed.
3

Wait for approval

The CLI waits while you finish signing in, then writes the credentials to your profile and makes it the current profile.

API key sign-in

login asks for the Openlayer API URL, then for your Openlayer API key as a hidden prompt. It verifies the key against that URL before saving the profile, so an invalid key fails immediately.

Non-interactive sign-in

login skips every prompt when either of these is true:
  • You supply an API key explicitly, through --api-key or the OPENLAYER_API_KEY environment variable.
  • You pass --output-mode ci.
In this mode login verifies the key, writes the profile and exits. It needs both of the following, and fails with a message naming the missing one:
  • A valid API key, from --api-key or OPENLAYER_API_KEY.
  • A valid API base URL. This defaults to https://api.openlayer.com, so you only set --base-url or OPENLAYER_BASE_URL for a self-hosted, on-prem or local deployment.
Only an explicitly supplied key skips the prompts. A key already saved in your profile does not, so openlayer login still offers the sign-in menu when you want to switch accounts or workspaces.
In CI you often do not need login at all: set OPENLAYER_API_KEY and OPENLAYER_PROJECT_ID and the other commands authenticate directly. See environment variables and the GitHub Actions guide.