Hugging Face CLI
$ huggingface-cli Official Med RiskBundled with huggingface_hub[cli], huggingface-cli (and its newer hf alias) downloads models/datasets with glob filters, inspects local disk cache (scan-cache), checks auth (whoami), and supports --dry-run plus --format json on modern hf commands.
brew install huggingface-cli Fast, resumable local artifact transfers and cache management belong directly in shell (hf / huggingface-cli).
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Modern hf commands add --format json and --dry-run, while legacy huggingface-cli commands remain non-interactive with --include/--exclude filters.
- Modern
hfsupports--format jsonand--dry-run;huggingface-clisupportswhoami,download,scan-cache
Downloads can pull huge multi-GB repos if unfiltered, and upload/delete-cache mutate Hub/local state; stores plaintext token in ~/.cache/huggingface/token.
- Stores token in
~/.cache/huggingface/token; unfiltered downloads can fill disk
Available via pip, uvx, and brew across macOS, Linux, and Windows.
- Packaged via
huggingface_hub[cli]on PyPI and Homebrew
Resumable, Xet/LFS-aware downloads with hf_transfer speedups and cache inspection.
- Chunked, resumable downloads and
scan-cachedisk auditing
Official Hugging Face project (huggingface/huggingface_hub) under Apache-2.0.
- Official
huggingface/huggingface_hubrepository
Clear official CLI guide, though transitioning between huggingface-cli and hf binary names.
- Official docs at huggingface.co/docs/huggingface_hub/guides/cli
Security, Auth & Guardrails
Reads HF_TOKEN env var or stores the token locally in ~/.cache/huggingface/token via login.
Free, Apache-2.0 open-source Python CLI; Hub downloads are free (subject to storage/bandwidth limits).
# Hugging Face CLI Agent Rules - Always preview repo sizes or pass `--include` / `--exclude` before downloading—full model repos often exceed 50 GB. - Never run `huggingface-cli delete-cache` without `-y` or explicit user confirmation of reclaimed directories.
Agent-Ready Command Recipes
Safe Read-Only Queries
huggingface-cli whoami
Prints the currently authenticated Hub username and org memberships.
hf download gpt2 --include '*.json' --dry-run --format json
Uses --dry-run --format json on hf to inspect matching files without downloading blobs.
Controlled Writes & Previews
huggingface-cli download Qwen/Qwen2.5-0.5B-Instruct --include '*.json' '*.safetensors' --local-dir ./models/qwen-0.5b
Downloads only matching files into ./models/qwen-0.5b.
Strengths for Agents
- + Resumable model/dataset downloads with
--include/--excludeglob filtering. - + Modern
hfentrypoint adds--dry-runand--format json.
Caveats & Pitfalls
- ! Command surface is transitioning from
huggingface-clitohf. - ! Unfiltered
downloadcalls can consume tens of gigabytes of disk space.