Skip to content
Skill

hugging-face-cli

by huggingface

AI Summary

Enables developers to interact with Hugging Face Hub directly from Claude Code using the `hf` CLI—downloading models/datasets, uploading files, creating repositories, and managing cache without leaving the coding environment.

Install

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

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

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

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

Description

Execute Hugging Face Hub operations using the `hf` CLI. Use when the user needs to download models/datasets/spaces, upload files to Hub repositories, create repos, manage local cache, or run compute jobs on HF infrastructure. Covers authentication, file transfers, repository creation, cache operations, and cloud compute.

Check Cache Usage

`bash hf cache ls # See all cached repos and sizes hf cache rm model/gpt2 # Remove a repo from cache `

Hugging Face CLI

The hf CLI provides direct terminal access to the Hugging Face Hub for downloading, uploading, and managing repositories, cache, and compute resources.

Quick Command Reference

| Task | Command | |------|---------| | Login | hf auth login | | Download model | hf download <repo_id> | | Download to folder | hf download <repo_id> --local-dir ./path | | Upload folder | hf upload <repo_id> . . | | Create repo | hf repo create <name> | | Create tag | hf repo tag create <repo_id> <tag> | | Delete files | hf repo-files delete <repo_id> <files> | | List cache | hf cache ls | | Remove from cache | hf cache rm <repo_or_revision> | | List models | hf models ls | | Get model info | hf models info <model_id> | | List datasets | hf datasets ls | | Get dataset info | hf datasets info <dataset_id> | | List spaces | hf spaces ls | | Get space info | hf spaces info <space_id> | | List endpoints | hf endpoints ls | | Run GPU job | hf jobs run --flavor a10g-small <image> <cmd> | | Environment info | hf env |

Authentication

`bash hf auth login # Interactive login hf auth login --token $HF_TOKEN # Non-interactive hf auth whoami # Check current user hf auth list # List stored tokens hf auth switch # Switch between tokens hf auth logout # Log out `

Discussion

0/2000
Loading comments...

Health Signals

MaintenanceCommitted 1mo ago
Active
Adoption1K+ stars on GitHub
8.3k ★ · Popular
DocsREADME + description
Well-documented

GitHub Signals

Stars8.3k
Forks490
Issues15
Updated1mo ago
View on GitHub
Apache-2.0 License

My Fox Den

Community Rating

Sign in to rate this booster

Works With

Claude Code