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

# Authenticate the CLI

> Sign in to Dataerai from the command line with a browser flow, or use the device flow on machines without a browser.

Before uploading, downloading, or reading metadata, sign in with `dataerai auth`.

## Log in

```bash theme={null}
dataerai auth login [flags]
```

| Flag          | Description                                                                            |
| ------------- | -------------------------------------------------------------------------------------- |
| `--server`    | Base URL of your Dataerai deployment (`https://<your-server>`), or `$DATAERAI_SERVER`. |
| `--client-id` | OAuth2 client ID, or `$DATAERAI_CLIENT_ID`.                                            |
| `--timeout`   | How long to wait for the browser callback (default `5m`).                              |
| `--device`    | Use the device authorization flow for environments without a browser.                  |

### Browser login

```bash theme={null}
dataerai auth login --server https://<your-server>
```

This opens your browser, completes a secure (PKCE) sign-in, and prints `Logged in as you@example.com`.

### Device login without a browser

On a server or runner with no browser, use the **device flow**:

```bash theme={null}
dataerai auth login --device
```

The CLI prints a verification URL. Open it on any device with a browser, approve the request, and the CLI completes sign-in — no keys to copy.

## Check status

```bash theme={null}
dataerai auth status
# User:    you@example.com
# Token:   valid
# Expires: Tue, 06 May 2026 12:00:00 UTC
# Server:  https://<your-server>
```

## Log out

```bash theme={null}
dataerai auth logout
```

This removes your stored credentials from the system keychain (and the fallback file, if one was used).

## Next steps

<Card title="Commands" icon="terminal" href="/cli/commands">
  Upload, download, and manage metadata.
</Card>
