Complete Hugging Face CLI keyboard shortcuts and commands reference — 13 shortcuts across 1 category. Quick reference cheat sheet for Windows & Mac.
The Hugging Face CLI moves models and datasets between the Hub and a machine, and its dozen commands cover authentication, downloads, uploads and the cache that silently fills a disk. The table lists them as huggingface-cli; recent releases also accept the shorter hf alias. The notes cover the cache and the pattern download that saves both time and space.
| Shortcut | Action | Description |
|---|---|---|
| huggingface-cli login | Login | Log in to HuggingFace. |
| huggingface-cli download [model] | Download model | Download a model. |
| huggingface-cli upload [path] | Upload | Upload model or dataset. |
| huggingface-cli repo create | Create repo | Create a new repository. |
| huggingface-cli env | Environment | Show environment info. |
| huggingface-cli whoami | Current user | Show which account is currently logged in. |
| huggingface-cli logout | Logout | Remove the stored access token. |
| huggingface-cli scan-cache | Scan cache | List cached models and their disk usage. |
| huggingface-cli delete-cache | Clean cache | Interactively delete cached model revisions. |
| huggingface-cli download [model] --include "*.safetensors" | Pattern download | Download only files matching a pattern. |
| huggingface-cli version | CLI version | Print the installed CLI version. |
| git clone https://huggingface.co/[model] | Clone repo | Clone a model repository with git. |
| huggingface-cli lfs-enable-largefiles . | Enable large files | Allow files over 5GB in a local repo. |
The most essential Hugging Face CLI shortcuts are: huggingface-cli login (Login), huggingface-cli download [model] (Download model), huggingface-cli upload [path] (Upload).
These are command-line commands — type them in your terminal or console. Combine them with shell history search (Ctrl + R) and aliases to work even faster.
The Hugging Face CLI shortcut for login is huggingface-cli login. Log in to HuggingFace.
Print the Hugging Face CLI cheat sheet and keep it next to your keyboard for the first week, then switch to active recall: open Shortcut Speedrun and practice Hugging Face CLI shortcuts against the clock until they're automatic.
Yes — use My Stack to combine Hugging Face CLI shortcuts with any other platform on this site into one printable reference, which is useful if your daily workflow spans several tools.
huggingface-cli login stores a token from your account settings; gated models such as Llama require it, as do uploads. huggingface-cli whoami confirms which account is active and huggingface-cli logout removes the token. On a shared machine, the token can instead be passed per command or set in HF_TOKEN for CI. huggingface-cli env prints the versions and paths the library sees, which is what to paste into a bug report.
huggingface-cli download [model] fetches a repository into the cache and prints the local path; huggingface-cli download [model] --include "*.safetensors" restricts it to a pattern, which for a repo that ships both PyTorch and safetensors weights halves the transfer. huggingface-cli upload [path] pushes a folder to a repo, after huggingface-cli repo create has made one. git clone https://huggingface.co/[model] is the git route, which needs huggingface-cli lfs-enable-largefiles . in the clone before committing files over 5 GB.
Everything downloads into ~/.cache/huggingface/hub (or HF_HOME), and models of tens of gigabytes accumulate there without any command listing them by default. huggingface-cli scan-cache reports what is cached with sizes per repo and revision, and huggingface-cli delete-cache opens an interactive selector to remove revisions — the pair to run when a workstation runs out of space. huggingface-cli version prints the CLI version.
Open your assistant with this page preloaded as the source — great for follow-up questions like "which of these work in other apps?"