> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hexr.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# hexr login

> Authenticate with Hexr Cloud to enable cloud builds, deploys, and dashboard access.

## Usage

```bash theme={null}
hexr login --key <api_key>
```

***

## Options

<ParamField path="--key, -k" type="string">
  Your Hexr Cloud API key. Format: `hxr_live_<64 hex characters>`.

  ```bash theme={null}
  hexr login --key hxr_live_0f0ea94b...
  ```
</ParamField>

<ParamField path="--url" type="string" default="https://api.hexr.cloud">
  Cloud API endpoint (for self-hosted Cloud API).
</ParamField>

<ParamField path="--status" type="flag">
  Show current authentication status without modifying anything.

  ```bash theme={null}
  $ hexr login --status

  Authenticated: ✓
  API Key: hxr_live_0f0e...d739 (masked)
  Tenant: Hexr Internal (tnt_e979ae50...)
  Role: admin
  Endpoint: https://api.hexr.cloud
  ```
</ParamField>

***

## What Happens

`hexr login` stores credentials in `~/.hexr/config.json`:

```json theme={null}
{
  "api_key": "hxr_live_...",
  "api_url": "https://api.hexr.cloud",
  "tenant_id": "tnt_e979ae50...",
  "tenant_name": "Hexr Internal"
}
```

This enables:

* `hexr push --cloud` — build via Google Cloud Build
* `hexr deploy --cloud` — deploy to Hexr Cloud GKE
* `hexr status` — show agents deployed in Hexr Cloud

***

## hexr logout

Remove stored credentials:

```bash theme={null}
$ hexr logout
✓ Credentials removed from ~/.hexr/config.json
```
