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

# rime config

> Manage Rime CLI configuration and named environments with rime config subcommands.

Manage CLI configuration. The config file is TOML-based and lives at `~/.rime/rime.toml`.

## `rime config init`

Create a new config file. Prompts for an API key interactively.

```bash theme={null}
rime config init
```

| Flag      | Default | Description                       |
| --------- | ------- | --------------------------------- |
| `--force` | `false` | Overwrite an existing config file |

The generated file looks like:

```toml theme={null}
default_env = "users"

[env.users]
api_url = "https://users.rime.ai/v1/rime-tts"
api_key = "your_api_key_here"

[env.users-east]
api_url = "https://users-east.rime.ai/v1/rime-tts"
api_key = "your_api_key_here"
```

Both standard Rime endpoints are pre-configured as named environments. The `default_env` field designates which one is active by default.

<Note>Older config files without `default_env` continue to work — the top-level `api_url` and `api_key` fields are still respected as the fallback default.</Note>

## `rime config list`

List all configured environments. The currently active default environment is marked with a `*` in the `NAME` column.

```bash theme={null}
rime config list
```

```
NAME            URL                                                AUTH
--------------------------------------------------------------------------------
users *         https://users.rime.ai/v1/rime-tts                 Bearer
users-east      https://users-east.rime.ai/v1/rime-tts            Bearer
```

| Flag     | Default | Description    |
| -------- | ------- | -------------- |
| `--json` | `false` | Output as JSON |

## `rime config default`

Get or set the default environment.

```bash theme={null}
# Print the current default environment name
rime config default

# Switch the default to a different environment
rime config default users-east
```

With no arguments, prints the name of the current default environment:

```
users
```

With a name argument, updates `default_env` in `~/.rime/rime.toml` and confirms:

```
Default environment set to "users-east"
```

No flags.

## `rime config show`

Show the fully resolved configuration for a given environment, including where the API key comes from (config file vs. environment variable).

```bash theme={null}
rime config show
```

| Flag         | Short | Default   | Description                                    |
| ------------ | ----- | --------- | ---------------------------------------------- |
| `--env`      | `-e`  | `default` | Environment to show                            |
| `--json`     | --    | `false`   | Output as JSON                                 |
| `--show-key` | --    | `false`   | Display the full API key (redacted by default) |

**Example output:**

```
Environment:  users
API URL:      https://users.rime.ai/v1/rime-tts
API Key:      rime_aHR0cHM6Ly... (redacted)
Auth Prefix:  Bearer
Auth Header:  Authorization: Bearer (redacted)
```

## `rime config add`

Add a named environment to `~/.rime/rime.toml`. Prompts interactively for API URL, API key (input hidden), and an optional auth prefix. You cannot add an environment named `default` — use `rime config default` to change which environment is the default.

```bash theme={null}
rime config add <name>
```

| Flag            | Description                                            |
| --------------- | ------------------------------------------------------ |
| `--url`         | API URL (default: `https://users.rime.ai/v1/rime-tts`) |
| `--key`         | API key (skips interactive prompt)                     |
| `--auth-prefix` | Auth header prefix, e.g. `Bearer` (optional)           |

**Examples:**

```bash theme={null}
# Add a staging environment interactively
rime config add staging

# Add an on-prem environment non-interactively
rime config add onprem --url https://rime.internal:8080/v1/rime-tts --key your_key_here
```

## `rime config rm`

Remove a named environment from `~/.rime/rime.toml`. Prompts for confirmation unless `--yes` is passed.

```bash theme={null}
rime config rm <name>
```

| Flag    | Short | Default | Description              |
| ------- | ----- | ------- | ------------------------ |
| `--yes` | `-y`  | `false` | Skip confirmation prompt |

## `rime config edit`

Open `~/.rime/rime.toml` in your default editor (`$VISUAL` or `$EDITOR`, falling back to `nano` or `vi`).

```bash theme={null}
rime config edit
```

No flags. Requires the config file to exist — run `rime config init` first if needed.
