> ## 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.

# Authentication

> Authenticate the Rime CLI using rime login, rime logout, and rime key.

## `rime login`

Opens your browser to the Rime dashboard for OAuth-based authentication, then saves your API key to `~/.rime/rime.toml`. The CLI starts a local callback server to receive the key from the dashboard.

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

<img src="https://mintcdn.com/rimelabs/hWWUVCw6mopaejUP/images/cli/login-demo.gif?s=adaf31b9d84cc8b652f44958968e2ae2" alt="Demo of the rime login command" width="1080" height="720" data-path="images/cli/login-demo.gif" />

No flags. The CLI checks the key before saving it and doesn't save a key the API rejects as invalid. If the check fails for another reason, such as a network error, the CLI saves the key anyway and prints a warning, so run `rime hello` to confirm it works.

***

## `rime logout`

Remove your saved API key by deleting the config file at `~/.rime/rime.toml`. Deleting the file also removes any named environments you added, so run `rime config init` or `rime login` to set up again.

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

No flags.

***

## `rime key`

Print the resolved API key (no trailing newline). Useful in shell scripts and as a subexpression. For example, `rime curl` uses `$(rime key)` in its generated commands.

```bash theme={null}
rime key
```

No flags. Resolves the key from config or `RIME_CLI_API_KEY`, using the active environment. If no key resolves, it prints nothing, and a command that uses `$(rime key)` sends an empty key. Run `rime config show` to see where the key comes from.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.