You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b250d0a
Browse filesBrowse the repository at this point in the historyBrowse files
feat(upgrade): gate commands on a new release; rename update→upgrade (#178)
* feat(upgrade): gate commands on a new release and rename update→upgrade
When a newer release is available, the running CLI may be incompatible
with the API. Detect this before dispatching an API-touching command and
require the user to upgrade first:
- New `update::enforce_latest_or_exit()` runs before command dispatch. On
an interactive terminal, if a newer release exists it prompts to
upgrade. Declining (or Ctrl-D) exits without running the command;
accepting upgrades in place and exits so the user re-runs on the new
binary.
- Exempts commands that don't hit the API (`completions`, bare help) and
the upgrader itself.
- No-op for non-interactive/CI sessions (no TTY, --no-input, or
HOTDATA_NO_UPDATE_CHECK), so scripts and pipelines are never blocked.
- Status messages go to stderr so they never pollute redirected stdout;
the explicit upgrade command still exits non-zero on failure.
Also renames the `update` subcommand to `upgrade`, drops the old
post-command background notice, and removes the now-unused
decline-suppression cache field.
* docs(skills): document hotdata upgrade command and the pre-command upgrade gate
* docs: fix stale 'update' references (command index + install_for_version comment)
* fix(upgrade): accept 'yes' (not just 'y') at the upgrade prompt
* style: cargo fmt the upgrade-prompt confirmation expression
* fix(upgrade): mention HOTDATA_NO_UPDATE_CHECK escape hatch in gate messages
Avoids locking an offline user out of every command when a fresh cache
records a newer version but the network is unavailable (decline exits 1,
and accepting also fails in update_to). Surface the bypass in both the
decline and failed-upgrade messages.
---------
Co-authored-by: Eddie A Tejeda <669988+eddietejeda@users.noreply.github.com>
Writes completion script for the chosen shell to stdout (redirect into your shell’s completion path as usual).
326
326
327
+
### Upgrade (`upgrade`)
328
+
329
+
```
330
+
hotdata upgrade
331
+
```
332
+
333
+
Upgrades the CLI in place to the latest release (`brew upgrade` for Homebrew installs, otherwise a direct binary download), refreshing bundled skills to match. After a successful upgrade, re-run your command.
334
+
335
+
A newer release can be incompatible with the API, so in an **interactive terminal** the CLI checks for a new release before running any API-touching command and prompts to upgrade. Declining (or `Ctrl-D`) exits without running the command — `hotdata upgrade` is then required to continue. The check is a **no-op in non-interactive sessions** (no TTY, `--no-input`, or `HOTDATA_NO_UPDATE_CHECK` set), so typical agent and CI usage is never blocked; set `HOTDATA_NO_UPDATE_CHECK=1` to disable it entirely.
0 commit comments