[CLI] Add hf update + drop interactive update prompt#4131
Merged
Conversation
- Replace the blocking Y/n auto-update prompt with a one-line stderr warning pointing to `hf upgrade` - New `hf upgrade` command (under `help` topic) that picks the right command for the detected install method (brew/hf_installer/pip) - New `HF_HUB_NO_UPDATE_CHECK` env var to silence the startup PyPI check entirely (handy for CI / quieter shells)
Surface non-zero pip/brew/installer exits via `typer.Exit` so scripts and CI can detect upgrade failures. Matches the convention in extensions.py.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2a09347. Configure here.
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Join the list[str] update_command with spaces before interpolating into the user-facing message, so it displays as a shell command rather than a Python repr like ['python', '-m', 'pip', ...]. Co-authored-by: Lucain <Wauplin@users.noreply.github.com>
hf upgrade + drop interactive update prompthf update + drop interactive update prompt
Member
|
Sounds reasonable. |
hanouticelina
approved these changes
Apr 27, 2026
Collaborator
hanouticelina
left a comment
There was a problem hiding this comment.
it works and looks good to me! thanks 👍
Contributor
|
This PR has been shipped as part of the v1.13.0 release. |
julien-c
reviewed
Apr 30, 2026
| if returncode != 0: | ||
| raise typer.Exit(code=returncode) | ||
| out.hint( | ||
| "You may also want to run `hf skills upgrade` to refresh any installed skills " |
Member
There was a problem hiding this comment.
maybe should be update for consistency
hanouticelina
added a commit
that referenced
this pull request
Apr 30, 2026
Per Julien's feedback in #4131. No backward compat alias kept.
hanouticelina
added a commit
that referenced
this pull request
Apr 30, 2026
Per Julien's feedback in #4131. No backward compat alias kept.
hanouticelina
added a commit
that referenced
this pull request
Apr 30, 2026
Per Julien's feedback in #4131. No backward compat alias kept.
Wauplin
pushed a commit
that referenced
this pull request
May 4, 2026
Per Julien's feedback in #4131. No backward-compat alias kept.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Follow-up after discussion in #3983 (comment) (also see internal slack thread)
Summary
hf updatecommand.hf update(grouped underhelplikeenv/version): detects howhfwas installed (brew / standalone installer / pip) and runs the right command. Hints athf skills upgradeon success so installed agent skills stay in sync with the new command surface.HF_HUB_DISABLE_UPDATE_CHECK=1to silence the startup PyPI check entirely (offline CI, quieter shell output). The check was already a no-op on dev / pre-release versions and 24h-cached.Breaking change
The interactive auto-update prompt is gone. Users who relied on pressing Enter to accept an upgrade will now get a warning and run
hf updatethemselves. No flag change, no scripting breakage — the prompt only ran in TTY sessions.Notes / decisions
_prompt_autoupdateentirely rather than gating it on a new heuristic. Once the prompt is gone the leftover check is just a 24h-cached PyPI GET + one stderr line — both harmless in CI.HF_HUB_DISABLE_UPDATE_CHECKis the only opt-out; no auto-detection ofCI/NONINTERACTIVE/Jupyter (no premature abstraction)._check_cli_update, not the outercheck_cli_updatewrapper — keeps the exception-swallowing guarantee.hf updatehas no flags (no--yes): the user already opted in by running it. Transformers is not updateable fromhf update— the helper still exists but isn't exposed.topic="help"next toenv/version— it's installation meta, not a Hub operation.hf updateshows up without touchingbuild_skill_md. Added a single tip bullet to_SKILL_TIPS.Note
Medium Risk
Alters CLI startup behavior and introduces a new command that shells out to platform/package-manager update commands, so failures or mis-detected install methods could impact user workflows (though core Hub operations are unchanged).
Overview
Adds a new
hf updatecommand (wired intohfviasystem.update+_cli_utils.run_update) that detects the CLI installation method (Homebrew/standalone installer/pip) and runs the appropriate upgrade command, then hints to refresh installed skills.Changes the CLI startup PyPI version check to be non-interactive by removing the blocking Y/n auto-update prompt and always emitting a one-line hint (pointing at
hf updateforhuggingface_hub), with a newHF_HUB_DISABLE_UPDATE_CHECKenv var to skip the check entirely.Updates docs and generated CLI reference to document
hf updateandHF_HUB_DISABLE_UPDATE_CHECK, and adds a short tip inskillsdocs about upgrading viahf update.Reviewed by Cursor Bugbot for commit d210829. Bugbot is set up for automated code reviews on this repo. Configure here.