Skip to content
Skill

hf-cli

by huggingface

AI Summary

Provides the Hugging Face Hub CLI (`hf`) tool for downloading, uploading, and managing models, datasets, and Spaces directly from Claude Code. Essential for developers integrating Hugging Face resources into AI workflows.

Install

Copy this and paste it into Claude Code, Cursor, or any AI assistant:

I want to install the "hf-cli" skill in my project.

Please run this command in my terminal:
# Install skill into your project
mkdir -p .claude/skills/hf-cli && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/hf-cli/SKILL.md "https://raw.githubusercontent.com/huggingface/skills/main/skills/hf-cli/SKILL.md"

Then restart Claude Code (or reload the window in Cursor) so the skill is picked up.

Description

Hugging Face Hub CLI (`hf`) for downloading, uploading, and managing models, datasets, spaces, buckets, repos, papers, jobs, and more on the Hugging Face Hub. Use when: handling authentication; managing local cache; managing Hugging Face Buckets; running or scheduling jobs on Hugging Face infrastructure; managing Hugging Face repos; discussions and pull requests; browsing models, datasets and spaces; reading, searching, or browsing academic papers; managing collections; querying datasets; configuring spaces; setting up webhooks; or deploying and managing HF Inference Endpoints. Make sure to use this skill whenever the user mentions 'hf', 'huggingface', 'Hugging Face', 'huggingface-cli', or 'hugging face cli', or wants to do anything related to the Hugging Face ecosystem and to AI and ML in general. Also use for cloud storage needs like training checkpoints, data pipelines, or agent traces. Use even if the user doesn't explicitly ask for a CLI command. Replaces the deprecated `huggingface-cli`.

Commands

• hf download REPO_ID — Download files from the Hub. [--type CHOICE --revision TEXT --include TEXT --exclude TEXT --cache-dir TEXT --local-dir TEXT --force-download --dry-run --quiet --max-workers INTEGER] • hf env — Print information about the environment. • hf sync — Sync files between local directory and a bucket. [--delete --ignore-times --ignore-sizes --plan TEXT --apply TEXT --dry-run --include TEXT --exclude TEXT --filter-from TEXT --existing --ignore-existing --verbose --quiet] • hf upload REPO_ID — Upload a file or a folder to the Hub. Recommended for single-commit uploads. [--type CHOICE --revision TEXT --private --include TEXT --exclude TEXT --delete TEXT --commit-message TEXT --commit-description TEXT --create-pr --every FLOAT --quiet] • hf upload-large-folder REPO_ID LOCAL_PATH — Upload a large folder to the Hub. Recommended for resumable uploads. [--type CHOICE --revision TEXT --private --include TEXT --exclude TEXT --num-workers INTEGER --no-report --no-bars] • hf version — Print information about the hf version.

`hf auth` — Manage authentication (login, logout, etc.).

• hf auth list — List all stored access tokens. • hf auth login — Login using a token from huggingface.co/settings/tokens. [--add-to-git-credential --force] • hf auth logout — Logout from a specific token. [--token-name TEXT] • hf auth switch — Switch between access tokens. [--token-name TEXT --add-to-git-credential] • hf auth whoami — Find out which huggingface.co account you are logged in as. [--format CHOICE]

`hf buckets` — Commands to interact with buckets.

• hf buckets cp SRC — Copy files to or from buckets. [--quiet] • hf buckets create BUCKET_ID — Create a new bucket. [--private --exist-ok --quiet] • hf buckets delete BUCKET_ID — Delete a bucket. [--yes --missing-ok --quiet] • hf buckets info BUCKET_ID — Get info about a bucket. [--quiet] • hf buckets list — List buckets or files in a bucket. [--human-readable --tree --recursive --format CHOICE --quiet] • hf buckets move FROM_ID TO_ID — Move (rename) a bucket to a new name or namespace. • hf buckets remove ARGUMENT — Remove files from a bucket. [--recursive --yes --dry-run --include TEXT --exclude TEXT --quiet] • hf buckets sync — Sync files between local directory and a bucket. [--delete --ignore-times --ignore-sizes --plan TEXT --apply TEXT --dry-run --include TEXT --exclude TEXT --filter-from TEXT --existing --ignore-existing --verbose --quiet]

`hf cache` — Manage local cache directory.

• hf cache list — List cached repositories or revisions. [--cache-dir TEXT --revisions --filter TEXT --format CHOICE --quiet --sort CHOICE --limit INTEGER] • hf cache prune — Remove detached revisions from the cache. [--cache-dir TEXT --yes --dry-run] • hf cache rm TARGETS — Remove cached repositories or revisions. [--cache-dir TEXT --yes --dry-run] • hf cache verify REPO_ID — Verify checksums for a single repo revision from cache or a local directory. [--type CHOICE --revision TEXT --cache-dir TEXT --local-dir TEXT --fail-on-missing-files --fail-on-extra-files]

Discussion

0/2000
Loading comments...

Health Signals

MaintenanceCommitted 6d ago
Active
Adoption1K+ stars on GitHub
10.2k ★ · Popular
DocsREADME + description
Well-documented

GitHub Signals

Stars10.2k
Forks633
Issues22
Updated6d ago
View on GitHub
Apache-2.0 License

My Fox Den

Community Rating

Sign in to rate this booster

Works With

Claude Code