{“content”:”---\nname: huggingface-hub\ndescription: Hugging Face Hub CLI (hf) — search, download, and upload models and datasets, manage repos, query datasets with SQL, deploy inference endpoints, manage Spaces and buckets.\nversion: 1.0.0\nauthor: Hugging Face\nlicense: MIT\ntags: [huggingface, hf, models, datasets, hub, mlops]\n---\n\n# Hugging Face CLI (hf) Reference Guide\n\nThe hf command is the modern command-line interface for interacting with the Hugging Face Hub, providing tools to manage repositories, models, datasets, and Spaces.\n\n> IMPORTANT: The hf command replaces the now deprecated huggingface-cli command.\n\n## Quick Start\n* Installation: curl -LsSf https://hf.co/cli/install.sh | bash -s\n* Help: Use hf --help to view all available functions and real-world examples.\n* Authentication: Recommended via HF_TOKEN environment variable or the --token flag.\n\n---\n\n## Core Commands\n\n### General Operations\n* hf download REPO_ID: Download files from the Hub.\n* hf upload REPO_ID: Upload files/folders (recommended for single-commit).\n* hf upload-large-folder REPO_ID LOCAL_PATH: Recommended for resumable uploads of large directories.\n* hf sync: Sync files between a local directory and a bucket.\n* hf env / hf version: View environment and version details.\n\n### Authentication (hf auth)\n* login / logout: Manage sessions using tokens from huggingface.co/settings/tokens.\n* list / switch: Manage and toggle between multiple stored access tokens.\n* whoami: Identify the currently logged-in account.\n\n### Repository Management (hf repos)\n* create / delete: Create or permanently remove repositories.\n* duplicate: Clone a model, dataset, or Space to a new ID.\n* move: Transfer a repository between namespaces.\n* branch / tag: Manage Git-like references.\n* delete-files: Remove specific files using patterns.\n\n---\n\n## Specialized Hub Interactions\n\n### Datasets & Models\n* Datasets: hf datasets list, info, and parquet (list parquet URLs).\n* SQL Queries: hf datasets sql SQL — Execute raw SQL via DuckDB against dataset parquet URLs.\n* Models: hf models list and info.\n* Papers: hf papers list — View daily papers.\n\n### Discussions & Pull Requests (hf discussions)\n* Manage the lifecycle of Hub contributions: list, create, info, comment, close, reopen, and rename.\n* diff: View changes in a PR.\n* merge: Finalize pull requests.\n\n### Infrastructure & Compute\n* Endpoints: Deploy and manage Inference Endpoints (deploy, pause, resume, scale-to-zero, catalog).\n* Jobs: Run compute tasks on HF infrastructure. Includes hf jobs uv for running Python scripts with inline dependencies and stats for resource monitoring.\n* Spaces: Manage interactive apps. Includes dev-mode and hot-reload for Python files without full restarts.\n\n### Storage & Automation\n* Buckets: Full S3-like bucket management (create, cp, mv, rm, sync).\n* Cache: Manage local storage with list, prune (remove detached revisions), and verify (checksum checks).\n* Webhooks: Automate workflows by managing Hub webhooks (create, watch, enable/disable).\n* Collections: Organize Hub items into collections (add-item, update, list).\n\n---\n\n## Advanced Usage & Tips\n\n### Global Flags\n* --format json: Produces machine-readable output for automation.\n* -q / --quiet: Limits output to IDs only.\n\n### Extensions & Skills\n* Extensions: Extend CLI functionality via GitHub repositories using hf extensions install REPO_ID.\n* Skills: Manage AI assistant skills with hf skills add.\n”}