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

# Authentication

> Connect the QAOS CLI to your account using browser-based OAuth or an API token.

Before running any tests, the QAOS CLI must be authenticated with your account. Two authentication methods are available.

***

## Method 1 — Browser login (recommended)

Open a browser-based login session:

```bash theme={null}
npx qaos auth --ui
```

Your default browser will open the QAOS login page. Sign in with your account credentials — the CLI will automatically capture the session token once authentication completes.

This is the recommended method for interactive use on a personal machine.

***

## Method 2 — API token

Authenticate directly using a personal API token. This is ideal for CI/CD pipelines or non-interactive environments.

**Step 1 — Generate a token**

1. Log in to the [QAOS Dashboard](https://qaos.machdel.com)
2. Navigate to **Settings → API Tokens**
3. Click **New Token**, give it a name, and copy the value

**Step 2 — Authenticate the CLI**

```bash theme={null}
npx qaos auth --api <your-api-token>
```

Replace `<your-api-token>` with the token you copied from the dashboard.

<Warning>
  API tokens grant full access to your QAOS account. Treat them like passwords: never commit them to source control, and rotate them if compromised. Use environment variables to pass tokens in CI pipelines:

  ```bash theme={null}
  npx qaos auth --api $QAOS_API_TOKEN
  ```
</Warning>

***

## Check authentication status

To see whether the CLI is currently authenticated and which account it's connected to:

```bash theme={null}
npx qaos auth
```

This prints your authentication status and account details without making any changes.

***

## Log out

To remove saved credentials from the current machine:

```bash theme={null}
npx qaos auth --logout
```

This clears the stored token from the local keychain. It does not invalidate the token itself — to revoke a token permanently, delete it from the dashboard under **Settings → API Tokens**.

***

## Next steps

With authentication set up, you're ready to [run your first test](/getting-started/quickstart).
