Authenticate
Sign in through your browser or with an API key, select a workspace, and keep credentials out of shell history.
Authentication has two parts: a browser sign-in (or an API key, for CI) proves who you are, and a workspace ID selects the tenant the CLI is allowed to act in.
Prerequisites
Section titled “Prerequisites”- A working
hlixinstallation - An hlix account you can sign in to in a browser (for CI: an API key)
For CI, 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.
Sign in
Section titled “Sign in”Pick the path that matches where the command runs.
Interactive login, on a machine with a terminal:
-
Start login.
Terminal window hlix loginAdd
--workspace <workspace-id>to choose the workspace up front.hlix auth loginis the same command. -
Approve the code in your browser. The CLI prints a verification URL and a one-time code, and opens the page. Sign in to your hlix account and confirm the code shown in the terminal.
-
Choose the workspace. After verifying the sign-in, the CLI lists the workspaces you can act in. With one, it is selected automatically; with several, pick one by number.
Expected result:
Signed in to https://server.hlix.aiCredential stored at …/hlix/credentials.jsonThe credential file is written with owner-only permissions. Its location follows HLIX_CONFIG_HOME, then XDG_CONFIG_HOME, then ~/.config.
In CI, supply credentials through secret environment variables, then run commands directly:
export HLIX_API_KEY='…'export HLIX_WORKSPACE_ID='<workspace-id>'hlix projects list --jsonExpected result: a JSON envelope with schemaVersion and data. HLIX_BASE_URL is optional and defaults to https://server.hlix.ai.
When HLIX_API_KEY is set, the CLI uses the environment credential instead of any saved file. That makes a CI override explicit and leaves a machine login untouched.
Against another API endpoint, such as a local development server, point --base-url at it:
hlix auth login \ --workspace <workspace-id> \ --base-url https://api.example.comUse HTTPS. Local development also accepts HTTP on localhost, 127.0.0.1 or ::1.
The stored credential remembers this origin, so later commands can use the endpoint without repeating the flag. A folder binding or explicit override can take precedence; hlix status shows the resolved endpoint.
Check which credential is in use
Section titled “Check which credential is in use”hlix auth statusExpected result:
credential file (/Users/you/.config/hlix/credentials.json)api https://server.hlix.ai (from credential)workspace org_2p9xk4 (from credential)status validThe output identifies the credential source and checks access to the API and Workspace. The key is omitted.
hlix status answers the wider question — which workspace this folder resolves to, and why. See Where a command points.
Sign out
Section titled “Sign out”hlix auth logoutThis removes the saved credential file after confirmation. In automation, pass --yes to confirm the removal.
To remove an environment credential, unset HLIX_API_KEY in the shell or secret store that supplies it:
HLIX_API_KEY is set in this environment; unset it there to sign out.If login fails
Section titled “If login fails”--workspace is required here: …: the key can act in several workspaces and the CLI could not ask. Pass one of the listed IDs, or setHLIX_WORKSPACE_ID.missing_credential—A browser login needs a terminal. Set HLIX_API_KEY for CI, or pipe a key to `hlix auth login --api-key`.Run the command in an interactive terminal, or setHLIX_API_KEYfor CI.login_denied/login_expired: the code was denied in the browser, or ran out before it was approved. Runhlix loginagain.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: an explicit Workspace or API override conflicts with the folder binding. Checkhlix status, then remove the conflicting override. You can usehlix auth loginto sign in to another Workspace.approval_requiredfromauth logout: the caller cannot answer a prompt. Repeat with--yes.