From f5ec016c2f51f9e7f8d052e8c6adc7923497b1ea Mon Sep 17 00:00:00 2001 From: mariekarpinska Date: Mon, 2 Nov 2026 16:06:28 -0800 Subject: [PATCH 1/2] fix: point users to --api-key when rp login fails The failure branch of rp login now prints the console settings URL and the rp login --api-key command so a user who hits a login error sees a working alternative without looking it up. --- runpod/rp_cli/main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/runpod/rp_cli/main.py b/runpod/rp_cli/main.py index 8943d9960..67c798fc6 100644 --- a/runpod/rp_cli/main.py +++ b/runpod/rp_cli/main.py @@ -718,7 +718,12 @@ def _read_code() -> str: ) set_credentials(api_key, profile=profile, overwrite=True) except (LoginError, ValueError, OSError) as exc: - _fail(str(exc)) + _fail( + f"{exc}\n\n" + "if rp login keeps failing, grab a key from " + "https://console.runpod.io/user/settings and run:\n" + " rp login --api-key YOUR_KEY" + ) ui.success("logged in, credentials saved to [dim]~/.runpod/config.toml[/dim]") From d28368da13dfff5e1aab605886a2b8c3a32e321a Mon Sep 17 00:00:00 2001 From: mariekarpinska Date: Mon, 2 Nov 2026 16:47:19 -0800 Subject: [PATCH 2/2] add newer-version nudge to rp login error when the daily update cache has a newer runpod cached, the login error appends a line pointing to pip install -U runpod. silent when there's no newer version. --- runpod/rp_cli/main.py | 10 ++++++++++ runpod/rp_cli/update.py | 13 +++++++++++++ 2 files changed, 23 insertions(+) diff --git a/runpod/rp_cli/main.py b/runpod/rp_cli/main.py index 67c798fc6..847d11cb1 100644 --- a/runpod/rp_cli/main.py +++ b/runpod/rp_cli/main.py @@ -718,11 +718,21 @@ def _read_code() -> str: ) set_credentials(api_key, profile=profile, overwrite=True) except (LoginError, ValueError, OSError) as exc: + from runpod.rp_cli.update import cached_newer_version + + newer = cached_newer_version() + upgrade_hint = ( + f"\n\na newer runpod ({newer}) is available; " + "`pip install -U runpod` may fix this." + if newer + else "" + ) _fail( f"{exc}\n\n" "if rp login keeps failing, grab a key from " "https://console.runpod.io/user/settings and run:\n" " rp login --api-key YOUR_KEY" + f"{upgrade_hint}" ) ui.success("logged in, credentials saved to [dim]~/.runpod/config.toml[/dim]") diff --git a/runpod/rp_cli/update.py b/runpod/rp_cli/update.py index 82258b7b1..96a8aff21 100644 --- a/runpod/rp_cli/update.py +++ b/runpod/rp_cli/update.py @@ -126,6 +126,19 @@ def run_install(version: str) -> None: # -- passive background check ------------------------------------------- +def cached_newer_version() -> Optional[str]: + """fresh cached latest release only if newer than current; None otherwise.""" + cache = _read_cache() + if not cache or not _cache_fresh(cache): + return None + latest = cache.get("latest_version") + if not latest: + return None + if compare_versions(parse_version(latest), parse_version(current_version())) > 0: + return latest + return None + + def _read_cache() -> Optional[dict]: try: return json.loads(CACHE_PATH.read_text(encoding="utf-8"))