Skip to main content
skill CX Codex

hugging-face-cli · patchy631 — Claude Code skill: features and installation

hugging-face-cli is a Claude Code skill for managing Hugging Face Hub with hf, including downloads, uploads, and cloud jobs. It handles these tasks from an agent session.

MIT ★ 42,059 updated 2026-10-12

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add patchy631/ai-engineering-hub --skill hugging-face-cli -a claude-code
Open on GitHub

What hugging-face-cli does

The skill guides an agent through hf commands for authentication, downloads, uploads, and repository management. It also covers browsing model, dataset, and Space details, plus listing and cleaning the local cache.

For cloud compute, it includes commands to launch jobs, inspect logs, and cancel runs. It also covers deploying and managing Inference Endpoints. GPU jobs take a flavor such as a10g-small; choose the compute option when forming the command. The command set includes login and checks for the active account, so settle authentication before working with private repositories.

What it helps with

  • download a full repository or select files by pattern
  • upload a folder to a model or dataset repository
  • create a Hub repository, branch, or tag
  • inspect cached repositories and remove revisions
  • launch a CPU or GPU job and inspect its logs

Example prompts for the agent

  • Download a model repository into ./models using hf.
  • Upload ./output to my Hugging Face repository.
  • Run script.py as a CPU job and show me its logs.

How to install hugging-face-cli

1Skills CLI (Vercel)

npx skills add patchy631/ai-engineering-hub --skill hugging-face-cli -a claude-code

2Manually: put the files in place

~/.claude/skills/hugging-face-cli/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/hugging-face-cli/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about hugging-face-cli

How do I install hugging-face-cli in Claude Code?

Run npx skills add patchy631/ai-engineering-hub --skill hugging-face-cli -a claude-code. The skill file is at ~/.claude/skills/hugging-face-cli/SKILL.md.

What does hugging-face-cli do?

It helps an agent use hf for Hugging Face Hub tasks, including repository operations, file transfers, cache management, and cloud jobs.

How do I launch a GPU job with hugging-face-cli?

Run hf jobs run --flavor a10g-small <image> <cmd> with an image and command. Check running jobs with hf jobs ps and logs with hf jobs logs <job_id>.

Source text

SKILL.md · MIT
---
name: hugging-face-cli
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.
---

# 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` |

## Core Commands

### 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
```

### Download
```bash
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 version
```

### Upload
```bash
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 message
```

### Repository Management
```bash
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 tag
```

### Delete Files from Repo
```bash
hf repo-files delete <repo_id> folder/             # Delete folder
hf repo-files delete <repo_id> "*.txt"             # Delete with pattern
```

### Cache Management
```bash
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 revisions
hf cache verify gpt2             # Verify checksums from cache
```

### Browse Hub
```bash
# Models
hf models ls                                        # List top trending models
hf models ls --search "MiniMax" --author MiniMaxAI  # Search models
hf models ls --filter "text-generation" --limit 20  # Filter by task
hf models info MiniMaxAI/MiniMax-M2.1               # Get model info

# Datasets
hf datasets ls                                      # List top trending datasets
hf datasets ls --search "finepdfs" --sort downloads # Search datasets
hf datasets info HuggingFaceFW/finepdfs             # Get dataset info

# Spaces
hf spaces ls                                        # List top trending spaces
hf spaces ls --filter "3d" --limit 10               # Filter by 3D modeling spaces
hf spaces info enzostvs/deepsite                    # Get space info
```

### Jobs (Cloud Compute)
```bash
hf jobs run python:3.12 python script.py           # Run on CPU
hf jobs run --flavor a10g-small <image> <cmd>      # Run on GPU
hf jobs run --secrets HF_TOKEN <image> <cmd>       # With HF token
hf jobs ps                                         # List jobs
hf jobs logs <job_id>                              # View logs
hf jobs cancel <job_id>                            # Cancel job
```

### Inference Endpoints
```bash
hf endpoints ls                                     # List endpoints
hf endpoints deploy my-endpoint \
  --repo openai/gpt-oss-120b \
  --framework vllm \
  --accelerator gpu \
  --instance-size x4 \
  --instance-type nvidia-a10g \
  --region us-east-1 \
  --vendor aws
hf endpoints describe my-endpoint                   # Show endpoint details
hf endpoints pause my-endpoint                      # Pause endpoint
hf endpoints resume my-endpoint                     # Resume endpoint
hf endpoints scale-to-zero my-endpoint              # Scale to zero
hf endpoints delete my-endpoint --yes               # Delete endpoint
```
**GPU Flavors:** `cpu-basic`, `cpu-upgrade`, `cpu-xl`, `t4-small`, `t4-medium`, `l4x1`, `l4x4`, `l40sx1`, `l40sx4`, `l40sx8`, `a10g-small`, `a10g-large`, `a10g-largex2`, `a10g-largex4`, `a100-large`, `h100`, `h100x8`

## Common Patterns

### Download and Use Model Locally
```bash
# Download to local directory for deployment
hf download meta-llama/Llama-3.2-1B-Instruct --local-dir ./model

# Or use cache and get path
MODEL_PATH=$(hf download meta-llama/Llama-3.2-1B-Instruct --quiet)
```

### Publish Model/Dataset
```bash
hf repo create my-username/my-model --private
hf upload my-username/my-model ./output . --commit-message="Initial release"
hf repo tag create my-username/my-model v1.0
```

### Sync Space with Local
```bash
hf upload my-username/my-space . . --repo-type space \
  --exclude="logs/*" --delete="*" --commit-message="Sync"
```

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

## Key Options

- `--repo-type`: `model` (default), `dataset`, `space`
- `--revision`: Branch, tag, or commit hash
- `--token`: Override authentication
- `--quiet`: Output only essential info (paths/URLs)

## References

- **Complete command reference**: See [references/commands.md](references/commands.md)
- **Workflow examples**: See [references/examples.md](references/examples.md)

© patchy631 · MIT · patchy631/ai-engineering-hub

Similar skills

All skills for AI and ML →

hugging-face-cli by other authors comes first.

hugging-face-cli huytran1120 hugging-face-cli is a Claude Code skill that enables interaction with the Hugging Face Hub via the hf tool. It handles model downloads, dataset uploads, buckets, and cache management. CX Codex +1 ★ 85repo stars Hugging Face huggingface Search Hugging Face models, datasets, Spaces, papers and documentation from an AI coding client, or generate an image from a prompt. CX Codex +1 2,405installs hugging-face-jobs sickn33 Prepares, tests, and launches compute workloads on Hugging Face Jobs across managed CPUs, GPUs, and TPUs with strict token controls and Hub persistence. CX Codex +1 1installs hugging-face-ui-skills design-skills hugging-face-ui-skills is a Claude Code skill that sets rules for Hugging Face-style interfaces. It applies to dark screens using Inter and a 4px spacing grid. CX Codex +1 266installs face-swap prime-skills The face-swap skill swaps faces and characters in video and images through the RunComfy CLI. It automatically picks the right model: audio-driven video, single frame, batch, motion-preserving, or identity-preserving. CX Codex +1 390,600installs hugging-science K-Dense-AI A skill to find and evaluate scientific datasets, models, and interactive demos via the Hugging Science catalog. Use it when you need an ML resource for biology, chemistry, genomics, materials science, climate, or physics. CX Codex +1 2,000installs eachlabs-face-swap eachlabs eachlabs-face-swap — a skill for Claude Code, Cursor, Codex and other platforms that swaps faces in photos and videos via EachLabs AI. The agent sends an API request and retrieves the resulting image. CX Codex +1 348installs

From the same set6

Project sponsors

Companies that keep this analytics open