diff --git a/sdk/cli.mdx b/sdk/cli.mdx index e5b074834..aa6b126c4 100644 --- a/sdk/cli.mdx +++ b/sdk/cli.mdx @@ -50,11 +50,15 @@ App lifecycle commands live under `rp flash`. Login, secrets, registries, logs, Authenticate with Runpod and save your credentials to `~/.runpod/config.toml`: ```bash -rp login # Approve access in your browser +rp login # Approve in your browser, then paste the key rp login --api-key API_KEY # Store a key directly rp login --profile staging # Save credentials to a named profile ``` +Without `--api-key` or `--agent`, `rp login` opens the Runpod console so you can approve the login request. After you approve, the console shows a new API key. Copy it and paste it at the prompt in your terminal. The input is hidden, and the CLI verifies the key before saving it. If the key is empty or rejected, you can try again up to three times before you need to run `rp login` again. + +Browser login needs an interactive terminal to read the pasted key. In CI pipelines or scripts, set the `RUNPOD_API_KEY` environment variable or run `rp login --api-key API_KEY` instead. When an AI coding agent runs the login for you, use [agent login](#log-in-with-an-emailed-code). + Use `--profile PROFILE_NAME` with either login method to update only that profile. The default profile is `default`. To print the approval URL instead of opening a browser, add `--no-open`. ### Log in with an emailed code diff --git a/sdk/overview.mdx b/sdk/overview.mdx index 6eaf268dd..0a9810e3d 100644 --- a/sdk/overview.mdx +++ b/sdk/overview.mdx @@ -66,7 +66,7 @@ Log in once to store your credentials: rp login ``` -This opens your browser to approve access. Credentials are saved to `~/.runpod/config.toml` and are shared by the SDK and the CLI. See [`rp login`](/sdk/cli#rp-login) for other options, including named profiles. +This opens your browser to approve access. After you approve, copy the API key the console shows and paste it at the prompt in your terminal. Credentials are saved to `~/.runpod/config.toml` and are shared by the SDK and the CLI. See [`rp login`](/sdk/cli#rp-login) for other options, including named profiles. You can also set the `RUNPOD_API_KEY` environment variable. This is the only environment variable the SDK reads for authentication. diff --git a/sdk/quickstart.mdx b/sdk/quickstart.mdx index 3b1b02c11..4bca83ce3 100644 --- a/sdk/quickstart.mdx +++ b/sdk/quickstart.mdx @@ -44,7 +44,7 @@ rp login uv run rp login ``` -This opens your browser so you can approve access. Your credentials are saved to `~/.runpod/config.toml`, and both the SDK and the CLI use them from then on. +This opens your browser so you can approve access. After you approve, copy the API key the console shows and paste it at the prompt in your terminal. Your credentials are saved to `~/.runpod/config.toml`, and both the SDK and the CLI use them from then on. To skip the browser, run `rp login --api-key API_KEY` with a key from the [API keys page](https://console.runpod.io/user/settings), or set the `RUNPOD_API_KEY` environment variable.