Skip to content

Authenticate

Authentication has two parts: an API key proves who you are, and a workspace ID selects the tenant the CLI is allowed to act in.

Create an API key in Developer tools → API keys. That page also shows the active workspace ID with a copy button. A newly created key is displayed once, so save it in your password manager before closing the dialog.

Pick the path that matches where the command runs.

Interactive login, on a machine with a terminal:

  1. Start login with the workspace ID.

    Terminal window
    hlix auth login --workspace <workspace-id>
  2. Paste the API key into the hidden prompt. The value is not echoed.

  3. Wait for verification. The CLI makes an authenticated project-list request before storing anything. An invalid key or inaccessible workspace leaves no convincing saved login behind.

Expected result:

Signed in to https://server.hlix.ai
Credential stored at …/hlix/credentials.json

The credential file is written with owner-only permissions. Its location follows HLIX_CONFIG_HOME, then XDG_CONFIG_HOME, then ~/.config.

Terminal window
hlix auth status

Expected result:

credential file (/Users/you/.config/hlix/credentials.json)
api https://server.hlix.ai (from credential)
workspace org_2p9xk4 (from credential)
status valid

This names the credential’s source — the environment or the stored file — and probes it against the API. It never prints the key, not even a prefix, because machine output gets piped into logs. When the probe fails, the failure code is the same one every other command would return, and the context (credential from file, workspace …, api …) goes to stderr.

hlix status answers the wider question — which workspace this folder resolves to, and why. See Where a command points.

Terminal window
hlix auth logout

This removes the credential file only. It asks first; --yes skips the prompt, and a --json or non-interactive caller is refused with approval_required rather than defaulted to yes.

A key supplied through HLIX_API_KEY is reported and left alone — it belongs to the shell that set it:

HLIX_API_KEY is set in this environment; unset it there to sign out.
  • --workspace is required: pass the workspace ID or set HLIX_WORKSPACE_ID.
  • missing_credentialNo API key entered. Run from a terminal or set HLIX_API_KEY for CI. Run the command in an interactive terminal, or set HLIX_API_KEY for CI.
  • unauthenticated: the key was rejected. Rotate or replace it, then retry.
  • forbidden: the key is valid, but the user cannot act in that workspace.
  • invalid_base_url--base-url must use HTTPS (HTTP is allowed only for localhost). Use TLS, or a loopback hostname for local development.
  • unreachable: verify the API URL, DNS, TLS, and network path.
  • workspace_mismatch: you are inside a folder bound to a different workspace and passed a contradicting --workspace, --base-url, or HLIX_* value. hlix auth login is exempt from this — signing in to a second workspace from a bound folder works — but every other command refuses rather than guessing.
  • approval_required from auth logout: the caller cannot answer a prompt. Repeat with --yes.