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

# royaltyport login

> Authenticate with the Royaltyport API.

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

Authenticates with the Royaltyport API. By default, opens your browser for a secure OAuth sign-in. For headless environments, pass an API token with the `--token` flag.

See [Authentication](/cli-reference/authentication) for full details on all login methods and environment variables.

***

## Options

| Option            | Short | Description                                             |
| ----------------- | ----- | ------------------------------------------------------- |
| `--token <token>` | `-t`  | API token — skips browser login                         |
| `--api-url <url>` | —     | Custom API URL (default: `https://api.royaltyport.com`) |

***

***

## Behavior

| Environment                   | What happens                                    |
| ----------------------------- | ----------------------------------------------- |
| Interactive terminal          | Opens your browser for OAuth sign-in            |
| `--token` flag provided       | Validates and stores the API token (no browser) |
| Non-interactive / piped stdin | Prompts for an API token via stdin              |

## Examples

Browser login (default):

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

Login with API token:

```bash theme={null}
royaltyport login --token rp_your_token_here
```

Login with a custom API URL:

```bash theme={null}
royaltyport login --api-url https://your-api-url.com
```

Piped login (non-interactive environments):

```bash theme={null}
echo "rp_your_token_here" | royaltyport login
```
