fix: Fix package name in auto-update upgrade hint (#30)

Seth Troisi committed May 27, 2026 at 15:49 UTC 5d8efebd20b1e3adc3d389599ef44a55772ebf48
3 files changed +4 -3
docs/04_automation_and_utility.md
+2 -1
@@ -1,5 +1,6 @@
1 ---
2 log:
3 +2026-05-27: Updated auto-update upgrade hint to recommend `pip install --upgrade google-colab-cli` instead of `colab`, aligning with the PyPI package name.
4 2026-05-27: `colab url` now emits BOTH the `?dbu=<urlencoded path>` query parameter (existing) AND a new `#datalabBackendUrl=<full URL>` hash fragment (new). Format: `https://<host>/notebooks/empty.ipynb?dbu=%2Ftun%2Fm%2F<endpoint>#datalabBackendUrl=<host>/tun/m/<endpoint>`. Why both: some Colab frontend code paths consult the hash fragment first and ignore `dbu` entirely, so the previously-emitted query-only form failed silently for those users (the frontend fell through to allocating a fresh VM via `/tun/m/assign`). The fragment value is a FULL URL with scheme + host (NOT just the path) and is emitted RAW (no URL encoding) because browsers don't decode the fragment before passing `location.hash` to page JS — Colab's parser calls `new URL(rawString)` directly. The fragment host always matches `--host` so Colab's same-origin enforcement on embedded backend URLs doesn't block the connection, and sandbox/dev users (`--host https://colab.sandbox.google.com`) get a sandbox fragment automatically. Three new test cases in `tests/test_url.py` cover the raw-encoding requirement (`%3A`/`%2F` must NOT appear in the fragment), the both-signals-present invariant, and `--open` propagating the fragment to `webbrowser.open()`. Integration-verified live against synthetic session state with three host shapes (default, sandbox, trailing-slash); all produced correctly-shaped URLs with no `//` artifacts.
5 2026-05-07: Added a developer-only `colab whoami` subcommand (hidden from `colab --help`). Mints an access token via the same `auth.get_credentials(...)` path the rest of the CLI uses (honoring the global `--auth=...` flag), refreshes the credentials, then queries `https://oauth2.googleapis.com/tokeninfo` to print the email, scopes, audience, and expiry of whatever the CLI is about to send. Built specifically to short-circuit the "why is my call to colab.pa.googleapis.com 403-ing" debugging loop — the answer is almost always "missing scope" or "wrong identity", both of which `whoami` makes immediately visible. Hidden via `app.command(hidden=True)`; reachable via `colab whoami` or `colab whoami --help`. Suppressed from the daily-update banner check (added to `_AUTO_UPDATE_SUPPRESSED` in `cli.py`) so the banner doesn't obscure the auth output.
6 2026-05-11: Removed the local-file update source (`update_file_path` setting and `_fetch_local` helper); `colab update` now consults PyPI only. Switched the default `update_url` to the canonical PyPI JSON API (`https://pypi.org/pypi/google-colab-cli/json`), which already exposes the `info.version` schema the auto-update subsystem expects. Re-added `colab update --install` as a public self-install path that runs `pip install -U google-colab-cli` against the current `sys.executable`; Linux-only (other platforms exit non-zero with an explanatory message), and a silent no-op when the cached `latest_version` is already at or below the current install.
@@ -181,7 +182,7 @@ remediation guidance) rather than silently after ~1 minute via the daemon.
182 across failed checks so transient network issues do not erase
183 the cache.
184 - **Notification**: If a new version is found, a non-intrusive message is
184 - printed to the console with a `Run 'pip install --upgrade colab' to
185 + printed to the console with a `Run 'pip install --upgrade google-colab-cli' to
186 update.` hint. The cached banner shown between fetches uses the generic
187 `Run 'colab update' to update.` hint.
188 - **Self-install (`--install`)**: An opt-in `--install` flag (default
src/colab_cli/auto_update.py
+1 -1
@@ -140,7 +140,7 @@ def check_for_updates(quiet: bool = False) -> None:
140 announce_upgrade(
141 pypi_v,
142 current,
143 - "pip install --upgrade colab",
143 + "pip install --upgrade google-colab-cli",
144 show_disable_hint=quiet,
145 )
146 elif not quiet:
tests/test_update.py
+1 -1
@@ -127,7 +127,7 @@ def test_pypi_upgrade_uses_pip_hint(app_version, fake_settings, mock_pypi):
127 result = runner.invoke(app, ["update"])
128 assert result.exit_code == 0
129 assert "available: 1.1.0 (current: 1.0.0)" in result.output
130 - assert "Run 'pip install --upgrade colab' to update." in result.output
130 + assert "Run 'pip install --upgrade google-colab-cli' to update." in result.output
131
132
133 def test_explicit_update_omits_disable_hint(app_version, fake_settings, mock_pypi):