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

# CLI Authentication

> Sign in and manage API keys

## Browser Login

```bash theme={null}
runtools login
```

Use `--no-browser` to print the URL instead of opening it:

```bash theme={null}
runtools login --no-browser
```

## API Key Auth

```bash theme={null}
runtools auth set-key rt_live_xxx
runtools auth status
```

The CLI also reads `RUNTOOLS_API_KEY`:

```bash theme={null}
RUNTOOLS_API_KEY=rt_live_xxx runtools sandbox list
```

## Inspect Identity

```bash theme={null}
runtools auth whoami
runtools auth status
```

## API Key Management

```bash theme={null}
runtools auth keys list
runtools auth keys create "CI key" --scope sandbox:* --scope agent:run
runtools auth keys revoke key_123
runtools auth keys rotate key_123 --name "Rotated CI key"
```

Use `--test` on `auth keys create` to create an `rt_test_` key, and `--expires-in 90d` for expiring keys.

## OAuth Connections

Provider accounts are separate from CLI login:

```bash theme={null}
runtools oauth connect github
runtools oauth status
runtools oauth disconnect <connection-id>
```

## Logout

```bash theme={null}
runtools logout
```

This clears stored CLI credentials.

## CI Example

```yaml theme={null}
- name: Deploy Runtools project
  env:
    RUNTOOLS_API_KEY: ${{ secrets.RUNTOOLS_API_KEY }}
  run: runtools deploy --dry-run
```
