Hugging Face Hub CLI: manage models, datasets and repositories
Use the Hugging Face hf command-line interface to manage repositories, models, datasets and Spaces on the Hugging Face Hub, covering downloads, uploads, token-based login, SQL queries over datasets, Inference Endpoints, compute jobs, buckets and collections.
Requirements
- Authentication is recommended via the
HF_TOKENenvironment variable or the--tokenflag. - Sessions are managed with
loginandlogoutusing tokens from huggingface.co/settings/tokens.
How to use
The hf command replaces the now deprecated huggingface-cli command.
Install the CLI with curl -LsSf https://hf.co/cli/install.sh | bash -s.
Use hf --help to view all available functions and real-world examples.
Use hf download REPO_ID to download files from the Hub.
Use hf upload REPO_ID to upload files or folders; it is recommended for single-commit uploads and also handles resumable uploads of large directories.
The hf upload-large-folder REPO_ID LOCAL_PATH command is deprecated; use hf upload instead.
Use hf sync to sync files between a local directory and a bucket.
Use hf env or hf version to view environment and version details.
Manage sessions with login and logout using tokens from huggingface.co/settings/tokens.
Use list and switch to manage and toggle between multiple stored access tokens.
Use whoami to identify the currently logged-in account.
Use create and delete to create or permanently remove repositories.
Use duplicate to clone a model, dataset, or Space to a new ID.
Use move to transfer a repository between namespaces.
Use branch and tag to manage Git-like references.
Use delete-files to remove specific files using patterns.
For datasets, use hf datasets list, info, and parquet to list parquet URLs.
Use hf datasets sql SQL to execute raw SQL via DuckDB against dataset parquet URLs.
For models, use hf models list and info.
Use hf papers ls to view daily papers.
Manage the lifecycle of Hub contributions with list, create, info, comment, close, reopen, and rename.
Use diff to view changes in a PR.
Use merge to finalize pull requests.
Deploy and manage Inference Endpoints with deploy, pause, resume, scale-to-zero, and catalog.
Run compute tasks on HF infrastructure, including hf jobs uv for running Python scripts with inline dependencies and stats for resource monitoring.
Manage interactive apps in Spaces, including dev-mode and hot-reload for Python files without full restarts.
Perform full S3-like bucket management with create, cp, mv, rm, and sync.
Manage local storage with list, prune to remove detached revisions, and verify for checksum checks.
Automate workflows by managing Hub webhooks with create, watch, and enable/disable.
Organize Hub items into collections with add-item, update, and list.
Extend CLI functionality via GitHub repositories using hf extensions install REPO_ID.
Manage AI assistant skills with hf skills add.
Source: nousresearch/hermes-agent and its contributors. License: MIT.
Copyright (c) 2025 Nous Research
Translation and editorial adaptation by ClawCases.
>Resources
>Related Use Cases
Agent Merge-Conflict Arbiter
Resolve a git merge conflict between two agents' branches as an impartial third party: a neutral arbiter that takes both diffs and their stated intents and produces a merged result without overwriting either side.
Automate the macOS UI with the Peekaboo CLI
Use Peekaboo to inspect the macOS UI, act on the intended target, and verify the result. The examples use v4 syntax; check the current documentation and the installed command's help, and for older versions follow that version's help.
Second Brain
This workflow turns OpenClaw into a second-brain memory system you feed by text message through Telegram, iMessage, or Discord, backed by a custom searchable Next.js dashboard you can browse anytime.