The Hugging Face Hub CLI tool `hf` provides commands for interacting with the Hugging Face Hub, replacing the deprecated `huggingface-cli`. It is designed for developers who need a command line interface for downloading, uploading, and managing files in the Hub.
curl -LsSf https://hf.co/cli/install.sh | bash -s.The hf-cli skill integrates the Hugging Face Hub CLI directly into your AI agent, enabling full command-line access to Hub operations. Agents can download models and datasets, upload files, manage repositories and buckets, launch Spaces, and execute cloud compute jobs—all through the hf command. The skill is auto-generated from your locally installed CLI, ensuring it stays synchronized with the latest Hub features and commands. This is the recommended first skill to install when giving your agent access to Hugging Face infrastructure.
Install using the command: `$ npx skills add https://github.com/huggingface/skills --skill hf-cli`.
Download datasets from the Hugging Face Hub
Manage authentication with the `hf auth` command
Upload files or entire folders to the Hub
Sync local directories with Hub repositories
curl -LsSf https://hf.co/cli/install.sh | bash -s.git clone https://github.com/huggingface/skillsCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Use the Hugging Face Hub CLI (`hf`) to [ACTION, e.g., download a model, upload a dataset, list files in a repo]. Replace [REPO_ID], [FILE_PATH], or [OPTIONS] with your specific details. Example: `hf download [REPO_ID] --local-dir [FILE_PATH]` or `hf upload [REPO_ID] --path [FILE_PATH] --repo-type [dataset/model]`.
```bash # Downloading a model from the Hugging Face Hub hf download mistralai/Mistral-7B-v0.1 --local-dir ./models/mistral-7b # Uploading a dataset to a Hugging Face repo hf upload my-username/my-dataset --path ./data/processed --repo-type dataset # Listing files in a model repository hf ls t5-small --repo-type model ``` **Output:** ``` Downloading (…) tokenizer.json: 100%|██████████| 1.20M/1.20M [00:01<00:00, 1.12MB/s] Downloading (…) config.json: 100%|██████████| 1.10k/1.10k [00:00<00:00, 1.05kB/s] Downloading pytorch_model.bin: 100%|██████████| 456M/456M [02:30<00:00, 3.02MB/s] Files in `t5-small` (model): - config.json - pytorch_model.bin - spiece.model - tokenizer.json - tokenizer_config.json ```
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan