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

# CLI authentication

> Authenticate the Proceeds CLI with a console API key.

Use a **console API key** from the [API Keys](/dashboard/api-keys) page, then log in with the CLI.

## Create a key

1. Open **API Keys** in the Proceeds dashboard.
2. Create a key with the scopes you need (`services`, `paywalls`, `transactions`, `events`).
3. Copy the `mpk_…` value — it is shown only once.

## Log in

```bash theme={null}
proceeds auth login
proceeds auth status --format json
```

Example response (`auth status`):

```json theme={null}
{
  "data": {
    "authenticated": true,
    "profile": "default",
    "apiUrl": "https://api.myproceeds.xyz",
    "source": "profile",
    "user": {
      "id": "cmp…",
      "email": "you@example.com",
      "walletAddress": "0x…"
    },
    "apiKey": {
      "name": "CLI",
      "scopes": ["services:write", "paywalls:write", "transactions:read", "events:read"],
      "keyPrefix": "mpk_…"
    }
  }
}
```

## Profiles

A profile stores an API key and API origin under a name. The first login creates the `default` profile. Create more profiles when you need another key, a different API origin, or a separate workspace.

```bash theme={null}
proceeds auth login --profile staging
proceeds auth profiles --format json
proceeds auth switch default --format json
proceeds auth logout
```

### Flags

Optional flags on auth (and most other) commands:

| Flag                 | Environment variable | Description                                          |
| -------------------- | -------------------- | ---------------------------------------------------- |
| `--profile <string>` | `PROCEEDS_PROFILE`   | Named profile to create or use                       |
| `--api-url <string>` | `PROCEEDS_BASE_URL`  | API origin; defaults to `https://api.myproceeds.xyz` |

```bash theme={null}
# Create or update a named profile
proceeds auth login --profile staging

# Point a profile at a custom API origin
proceeds auth login --profile staging --api-url https://api.example.com

# Run a command against a non-active profile
proceeds services list --profile staging --format json
```

Example response (`auth profiles`):

```json theme={null}
{
  "data": {
    "activeProfile": "default",
    "profiles": [
      {
        "name": "default",
        "apiUrl": "https://api.myproceeds.xyz",
        "credentialType": "api-key",
        "active": true
      }
    ]
  }
}
```

Example response (`auth switch`):

```json theme={null}
{
  "data": {
    "activeProfile": "default"
  }
}
```

`logout` removes the local profile only — revoke the key in the console if it is compromised.

## Next

<CardGroup cols={2}>
  <Card title="Services" icon="server" href="/cli/services">
    Create and manage services.
  </Card>

  <Card title="Paywalls" icon="credit-card" href="/cli/paywalls">
    Create and manage paywalls.
  </Card>
</CardGroup>
