Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Hugging Face CLI

$ huggingface-cli Official Med Risk
Hugging Face · AI & Media · Apache-2.0 · macos / linux / windows

Bundled 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.

FCRS-1.0 Score
83 /100
Good
Medium Confidence
Zero-Friction Install
brew install huggingface-cli
CLI vs MCP Decision CLI Only

Fast, resumable local artifact transfers and cache management belong directly in shell (hf / huggingface-cli).

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
✓ Dry-Run
— Read-Only Mode
— NO_COLOR Clean
— Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 20 / 25

Modern hf commands add --format json and --dry-run, while legacy huggingface-cli commands remain non-interactive with --include/--exclude filters.

  • Modern hf supports --format json and --dry-run; huggingface-cli supports whoami, download, scan-cache
Trust & Safety 20 / 25

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
Setup & Portability 13 / 15

Available via pip, uvx, and brew across macOS, Linux, and Windows.

  • Packaged via huggingface_hub[cli] on PyPI and Homebrew
Utility & Efficiency 13 / 15

Resumable, Xet/LFS-aware downloads with hf_transfer speedups and cache inspection.

  • Chunked, resumable downloads and scan-cache disk auditing
Maintenance & Lineage 9 / 10

Official Hugging Face project (huggingface/huggingface_hub) under Apache-2.0.

  • Official huggingface/huggingface_hub repository
Docs & Verifiability 8 / 10

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

Auth Modes
No Auth Env API Key Config File
Credential Storage

Reads HF_TOKEN env var or stores the token locally in ~/.cache/huggingface/token via login.

Side Effects
Read-Only Local Write Remote Write
Cost & Quotas

Free, Apache-2.0 open-source Python CLI; Hub downloads are free (subject to storage/bandwidth limits).

Copyable Guardrail for CLAUDE.md / AGENTS.md
# 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

Check active Hugging Face account and token status
huggingface-cli whoami

Prints the currently authenticated Hub username and org memberships.

Preview matching model files offline before downloading
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

Download filtered config and safetensors weights locally
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/--exclude glob filtering.
  • + Modern hf entrypoint adds --dry-run and --format json.

Caveats & Pitfalls

  • ! Command surface is transitioning from huggingface-cli to hf.
  • ! Unfiltered download calls can consume tens of gigabytes of disk space.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI