Hugging Face Cli
Hugging Face Cli is an productivity AI skill with a core value of Execute Hugging Face Hub operations using the `hf` CLI. It
helps developers solve real-world problems in the productivity domain, boosting
efficiency, automating repetitive tasks, and optimizing workflows.
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 comput...
Quick Facts
mkdir -p ./skills/hugging-face-cli && curl -sfL https://raw.githubusercontent.com/sickn33/antigravity-awesome-skills/main/skills/hugging-face-cli/SKILL.md -o ./skills/hugging-face-cli/SKILL.md Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).
Skill Content
# 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.
When to Use This Skill
Use this skill when:
- User needs to download models, datasets, or spaces
- Uploading files to Hub repositories
- Creating Hugging Face repositories
- Managing local cache
- Running compute jobs on HF infrastructure
- Working with Hugging Face Hub authentication
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` |
Core Commands
Authentication
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 outDownload
hf download <repo_id> # Full repo to cache
hf download <repo_id> file.safetensors # Specific file
hf download <repo_id> --local-dir ./models # To local directory
hf download <repo_id> --include "*.safetensors" # Filter by pattern
hf download <repo_id> --repo-type dataset # Dataset
hf download <repo_id> --revision v1.0 # Specific versionUpload
hf upload <repo_id> . . # Current dir to root
hf upload <repo_id> ./models /weights # Folder to path
hf upload <repo_id> model.safetensors # Single file
hf upload <repo_id> . . --repo-type dataset # Dataset
hf upload <repo_id> . . --create-pr # Create PR
hf upload <repo_id> . . --commit-message="msg" # Custom messageRepository Management
hf repo create <name> # Create model repo
hf repo create <name> --repo-type dataset # Create dataset
hf repo create <name> --private # Private repo
hf repo create <name> --repo-type space --space_sdk gradio # Gradio space
hf repo delete <repo_id> # Delete repo
hf repo move <from_id> <to_id> # Move repo to new namespace
hf repo settings <repo_id> --private true # Update repo settings
hf repo list --repo-type model # List repos
hf repo branch create <repo_id> release-v1 # Create branch
hf repo branch delete <repo_id> release-v1 # Delete branch
hf repo tag create <repo_id> v1.0 # Create tag
hf repo tag list <repo_id> # List tags
hf repo tag delete <repo_id> v1.0 # Delete tagDelete Files from Repo
hf repo-files delete <repo_id> folder/ # Delete folder
hf repo-files delete <repo_id> "*.txt" # Delete with patternCache Management
hf cache ls # List cached repos
hf cache ls --revisions # Include individual revisions
hf cache rm model/gpt2 # Remove cached repo
hf cache rm <revision_hash> # Remove cached revision
hf cache prune # Remove detached revi🎯 Best For
- Claude users
- Knowledge workers
- Remote teams
- Professionals
💡 Use Cases
- Using Hugging Face Cli in daily workflow
- Automating repetitive productivity tasks
📖 How to Use This Skill
- 1
Install the Skill
Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.
- 2
Load into Your AI Assistant
Open Claude and reference the skill. Paste the SKILL.md content or use the system prompt tab.
- 3
Apply Hugging Face Cli to Your Work
Provide context for your task — paste source material, describe your audience, or share existing work to guide the AI.
- 4
Review and Refine
Edit the AI output for accuracy, tone, and completeness. Add human insight where the AI lacks context.
❓ Frequently Asked Questions
How do I install Hugging Face Cli?
Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/hugging-face-cli/SKILL.md, ready to use.
Can I customize this skill for my team?
Absolutely. Edit the SKILL.md file to add team-specific instructions, examples, or workflows.
⚠️ Common Mistakes to Avoid
Not reading the full skill
Skills contain important context and edge cases beyond the quick start.