Conversation
|
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. |
LysandreJik
left a comment
There was a problem hiding this comment.
Excited for this! hf feels so much more natural than huggingface-cli
One question: wouldn't it make our life simpler during maintenance and to remove the deprecation down the road, to move all commands from commands to cli while keeping a utility to still allow imports from commands, rather than copy-pasting everything?
Keeping two copies means that it's easy for the two to diverge, and I don't think we want that even through the deprecation. If the syntax is too different from the original, feel free to ignore 🤗
Played around with it locally, it works great! When using the deprecated API (like huggingface-cli login, you still get recommendations about the old API, maybe worth recommending only new APIs everywhere? But not key for this PR.
Ex:
- A token is already saved on your machine. Run `huggingface-cli whoami` to get more information or `huggingface-cli logout` if you want to log out.
+ A token is already saved on your machine. Run `hf auth whoami` to get more information or `hf auth logout` if you want to log out.|
BTW, would brew (for instance) be ok with having two aliases (the current huggingface-cli and hf)? Might be worth checking with them |
Co-authored-by: Lysandre Debut <hi@lysand.re>
@LysandreJik I've updated all the documentation and tips to promote |
@LysandreJik as mentioned in DMs, I prefer to stick with the "duplicated code" approach. Even if it's not the cleanest solution, I see a few benefits to it:
|
Gentle ping to @singingwolfboy on this :) For context, we are switching the HF CLI from @singingwolfboy my questions are now: would brew be able to support 2 command lines like this? Or would it simply be a separate (gentle ping to @abitrolly who has maintained the brew script lately) |
hanouticelina
left a comment
There was a problem hiding this comment.
Thank you for this PR @Wauplin! i mainly reviewed the API and tested the commands locally and it looks great, i love it! 🔥
|
Thanks everyone! I'll merge this one now. About brew (#3229 (comment)), I kept the previous |
| hf auth login | ||
| hf auth logout | ||
| hf auth whoami | ||
| hr repo create |
|
@Wauplin For |
|
I confirm that after ✗ brew info huggingface-cli
==> huggingface-cli: stable 0.34.1 (bottled)
Client library for huggingface.co hub
https://huggingface.co/docs/huggingface_hub/guides/cli
Installed
/home/linuxbrew/.linuxbrew/Cellar/huggingface-cli/0.34.1 (1,001 files, 19MB) *
Poured from bottle using the formulae.brew.sh API on 2025-07-25 at 21:31:39
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/h/huggingface-cli.rb
License: Apache-2.0
==> Dependencies
Build: pkgconf ✔, rust ✔
Required: certifi ✔, git-lfs ✔, libyaml ✔, python@3.13 ✔, openssl@3 ✔
==> Analytics
install: 3,992 (30 days), 11,433 (90 days), 28,179 (365 days)
install-on-request: 3,990 (30 days), 11,418 (90 days), 28,081 (365 days)
build-error: 2 (30 days)✗ which hf
/home/linuxbrew/.linuxbrew/bin/hf
✗ which huggingface-cli
/home/linuxbrew/.linuxbrew/bin/huggingface-cli✗ hf
usage: hf <command> [<args>]
positional arguments:
{auth,cache,download,jobs,repo,repo-files,upload,upload-large-folder,env,version,lfs-enable-largefiles,lfs-multipart-upload}
hf command helpers
auth Manage authentication (login, logout, etc.).
cache Manage local cache directory.
download Download files from the Hub
jobs Run and manage Jobs on the Hub.
repo Manage repos on the Hub.
repo-files Manage files in a repo on the Hub.
upload Upload a file or a folder to the Hub. Recommended for single-commit uploads.
upload-large-folder
Upload a large folder to the Hub. Recommended for resumable uploads.
env Print information about the environment.
version Print information about the hf version.
options:
-h, --help show this help message and exit✗ huggingface-cli
⚠️ Warning: 'huggingface-cli' is deprecated. Use 'hf' instead.
usage: huggingface-cli <command> [<args>]
positional arguments:
{download,upload,repo-files,env,login,whoami,logout,auth,repo,lfs-enable-largefiles,lfs-multipart-upload,scan-cache,delete-cache,tag,version,upload-large-folder}
huggingface-cli command helpers
download Download files from the Hub
upload Upload a file or a folder to a repo on the Hub
repo-files Manage files in a repo on the Hub
env Print information about the environment.
login Log in using a token from huggingface.co/settings/tokens
whoami Find out which huggingface.co account you are logged in as.
logout Log out
auth Other authentication related commands
repo {create} Commands to interact with your huggingface.co repos.
lfs-enable-largefiles
Configure your repository to enable upload of files > 5GB.
scan-cache Scan cache directory.
delete-cache Delete revisions from the cache directory.
tag (create, list, delete) tags for a repo in the hub
version Print information about the huggingface-cli version.
upload-large-folder
Upload a large folder to a repo on the Hub
options:
-h, --help show this help message and exitNext I will try to rename the formula to |
|
PR for renaming |
|
Thanks a lot @abitrolly for providing your help on this! Given the discussion in Homebrew/homebrew-core#231234, I think it's fine to keep Note: it's still possible that if (when? 😁) |
Closes #3224.
Partly inspired by #3225 but I preferred to start from scratch.
Goal is to rename
huggingface-clitohf+ harmonize the syntax. We mostly follow ahf <resource> <action> [options]syntax similar to what's done by github CLI https://cli.github.com/manual/gh.Next steps will be to add new commands for a more consistent and feature-complete CLI, but story for another day!