Manage Hugging Face Hub with CLI
Full reference for the hf CLI (successor to huggingface-cli): Hub auth, downloads/uploads, repos, datasets, endpoints, and Jobs.
Why it matters
Streamline your interactions with the Hugging Face Hub by leveraging the powerful `hf` CLI. This asset enables efficient management of repositories, datasets, and authentication for your AI projects.
Outcomes
What it gets done
Authenticate and manage access to Hugging Face Hub.
Download and upload files and folders to Hugging Face repositories.
Sync local directories with Hugging Face buckets.
Manage Hugging Face cache and datasets.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/ag-hugging-face-cli | bash Overview
Hugging Face Cli
A full command reference for the hf CLI, the successor to huggingface-cli, covering Hub authentication, file download/upload, repo/collection management, dataset and model browsing, Inference Endpoints, scheduled Jobs, webhooks, and the companion hf-mount filesystem tool. Use when a task needs the hf CLI for Hub authentication, file transfer, repo management, Inference Endpoints, or Jobs.
What it does
Documents the hf command-line tool for the Hugging Face Hub, which replaces the deprecated huggingface-cli. It covers authentication, file download/upload, repository and collection management, dataset/model/paper browsing, discussions and pull requests, Inference Endpoints, scheduled/on-demand Jobs, bucket storage, webhooks, and CLI extensions.
When to use - and when NOT to
Use this skill when the task needs the hf CLI for Hub authentication, downloads, uploads, repo management, or basic compute operations. Auth commands now live entirely under hf auth (e.g. hf auth whoami) rather than top-level flags used by the old huggingface-cli.
Inputs and outputs
Install by downloading and reviewing the installer before running it:
tmpdir="$(mktemp -d)" && trap 'rm -rf "$tmpdir"' EXIT && curl -LsSf https://hf.co/cli/install.sh -o "$tmpdir/hf-install.sh" && less "$tmpdir/hf-install.sh" && bash "$tmpdir/hf-install.sh"
Core commands: hf download REPO_ID and hf upload REPO_ID (single-commit) / hf upload-large-folder (resumable) for Hub file transfer; hf sync for local-directory-to-bucket sync; hf env/hf version for environment info.
Command groups: hf auth (login/logout/switch/whoami, token listing); hf buckets (create/delete/list/copy/move/sync bucket storage); hf cache (list/prune/rm/verify the local cache); hf collections (create/update/add-item/delete-item on Hub collections); hf datasets (info/list/parquet URLs/SQL queries via DuckDB against parquet); hf discussions (create/comment/merge/close/reopen/diff on discussions and PRs); hf endpoints (deploy/list/pause/resume/scale-to-zero/update Inference Endpoints, including one-command deploys from the Model Catalog); hf extensions (install/list/remove/search GitHub-hosted CLI extensions); hf jobs (run/cancel/inspect/logs/stats for one-off Jobs, plus hf jobs scheduled for cron-like scheduled Jobs and hf jobs uv run for running UV scripts on HF infrastructure); hf models/hf papers/hf spaces (info/list/search browsing); hf repos (create/delete/duplicate/move repos, branch and tag management, irreversible delete); hf skills (install/preview AI-assistant skills); and hf webhooks (create/enable/disable/update webhooks watching repo events).
Common options across commands: --format json/--format table, -q/--quiet, --revision for branch/tag/commit, --token (prefer the HF_TOKEN env var instead), and --type for model/dataset/space repo scoping.
A companion tool, hf-mount, mounts Hub repos or buckets as local filesystems with on-demand file fetching - no download or copy step - installed the same reviewed-installer way, with hf-mount start repo <id> <path> for read-only repo mounts and hf-mount start bucket <id> <path> for read-write bucket mounts.
Integrations
Built on huggingface_hub (this reference generated from v1.8.0, regenerable via hf skills add --force), covering the full Hugging Face Hub surface - repos, datasets, models, Spaces, Inference Endpoints, Jobs, and webhooks - plus the separate hf-mount filesystem-mounting tool.
Who it's for
ML engineers and Hub users who need to authenticate, transfer files, manage repos/collections, run Inference Endpoints or Jobs, or automate Hub events via webhooks from the command line, using the current hf CLI rather than the deprecated huggingface-cli.
FAQ
Common questions
Discussion
Questions & comments ยท 0
Sign In Sign in to leave a comment.