## Configuration

---

### Profile Overview

---

Rainbow CLI NG uses a **profile** system to manage your Rainbow credentials. Each profile stores:

- The authentication method used
- Credentials (application ID, secrets, email…)
- The target platform URL (production, sandbox…)

Profiles are saved in `~/.rainbow-cli-config.json`. Secrets (passwords, secret keys) are stored securely in the **OS keyring**: Keychain on macOS, Secret Service on Linux, Windows Credential Manager on Windows.

### Creating a Profile

---

```bash
rbw config create-profile
```

An interactive wizard guides you step by step. You choose a profile name and then an authentication method from the three available options.

### Authentication Methods

---

#### API_KEY

API key authentication with HMAC signing. Requires:

- `apiKey` — your Rainbow API key
- `applicationId` — your application identifier
- `applicationSecret` — your application secret

```bash
rbw config create-profile
# → Choose method: API_KEY
```

#### RAINBOW

Authentication with Rainbow credentials (email + password). Requires:

- `loginEmail` — your Rainbow email address
- `password` — your Rainbow password
- `applicationId` — your application identifier
- `applicationSecret` — your application secret

```bash
rbw config create-profile
# → Choose method: RAINBOW
```

#### OAUTH

OAuth 2.0 browser-based authentication (Authorization Code Flow). Requires:

- `applicationId` — your application identifier
- `applicationSecret` — your application secret

A browser opens automatically for login. The refresh token is stored and renewed automatically.

```bash
rbw config create-profile
# → Choose method: OAUTH
```

### Managing Profiles

---

#### Display the active profile

```bash
rbw config show-profile
```

#### Switch to another profile

```bash
rbw config set-profile <name>
```

#### Display a specific profile

```bash
rbw config show-profile <name>
```

#### Update a profile

```bash
rbw config update-profile <name>
```

#### Delete a profile

```bash
rbw config delete-profile <name>
```

### Using a Profile for a Single Command

---

The global `--profile` option lets you specify a profile for a single command without changing the active profile:

```bash
rbw --profile production user:list
rbw --profile sandbox app:list
```

This is useful for working across multiple environments (sandbox, production) without switching profiles every time.
