HU

hugging-face-cli

Executes Hugging Face Hub commands for managing models, datasets, and infrastructure.

Install

mkdir -p .claude/skills/hugging-face-cli && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/744" && unzip -o skill.zip -d .claude/skills/hugging-face-cli && rm skill.zip

Installs to .claude/skills/hugging-face-cli

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

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.
322 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • Download models and datasets
  • Upload files to repositories
  • Create and manage repositories
  • Execute GPU-backed jobs
  • Manage local cache
  • List and filter models, datasets, and spaces

How it works

The CLI interacts directly with the Hugging Face Hub API to perform operations like file transfers, repository management, and compute job scheduling. It uses local authentication tokens to authorize requests and manages a local cache directory for downloaded assets.

Inputs & outputs

You give it
Repository ID and command parameters
You get back
Terminal output confirming file transfer, job status, or repository state

When to use hugging-face-cli

  • Download models and datasets from Hugging Face
  • Upload local project files to a hub repo
  • List and manage local cache of models
  • Run GPU-backed jobs on HF infrastructure

About this skill

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

TaskCommand
Loginhf auth login
Download modelhf download <repo_id>
Download to folderhf download <repo_id> --local-dir ./path
Upload folderhf upload <repo_id> . .
Create repohf repo create <name>
Create taghf repo tag create <repo_id> <tag>
Delete fileshf repo-files delete <repo_id> <files>
List cachehf cache ls
Remove from cachehf cache rm <repo_or_revision>
List modelshf models ls
Get model infohf models info <model_id>
List datasetshf datasets ls
Get dataset infohf datasets info <dataset_id>
List spaceshf spaces ls
Get space infohf spaces info <space_id>
List endpointshf endpoints ls
Run GPU jobhf jobs run --flavor a10g-small <image> <cmd>
Environment infohf 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 out

Download

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

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

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

hf repo-files delete <repo_id> folder/             # Delete folder
hf repo-files delete <repo_id> "*.txt"             # Delete with pattern

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

Browse Hub

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

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

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

# 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

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

hf upload my-username/my-space . . --repo-type space \
  --exclude="logs/*" --delete="*" --commit-message="Sync"

Check Cache Usage

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

When not to use it

  • Performing complex data processing outside of HF infrastructure
  • Managing non-Hugging Face git repositories

Prerequisites

Hugging Face accountHF_TOKEN for authentication

Limitations

  • Requires active internet connection for Hub operations
  • Limited to Hugging Face ecosystem services

How it compares

It provides a dedicated terminal interface for Hub operations, replacing manual web browser navigation and git command-line interactions.

Compared to similar skills

hugging-face-cli side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
hugging-face-cli (this skill)36moReviewIntermediate
robotics-code-generator147moNo flagsAdvanced
modal57moReviewIntermediate
computer-use-agents106moReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

More by patchy631

View all by patchy631

brightdata-web-mcp

patchy631

Search the web, scrape websites, extract structured data from URLs, and automate browsers using Bright Data's Web MCP. Use when fetching live web content, bypassing blocks/CAPTCHAs, getting product data from Amazon/eBay, social media posts, or when standard requests fail.

951

hugging-face-tool-builder

patchy631

Use this skill when the user wants to build tool/scripts or achieve a task where using data from the Hugging Face API would help. This is especially useful when chaining or combining API calls or the task will be repeated/automated. This Skill creates a reusable script to fetch, enrich or process data.

714

hugging-face-paper-publisher

patchy631

Publish and manage research papers on Hugging Face Hub. Supports creating paper pages, linking papers to models/datasets, claiming authorship, and generating professional markdown-based research articles.

634

hugging-face-datasets

patchy631

Create and manage datasets on Hugging Face Hub. Supports initializing repos, defining configs/system prompts, streaming row updates, and SQL-based dataset querying/transformation. Designed to work alongside HF MCP server for comprehensive dataset workflows.

14

hugging-face-jobs

patchy631

This skill should be used when users want to run any workload on Hugging Face Jobs infrastructure. Covers UV scripts, Docker-based jobs, hardware selection, cost estimation, authentication with tokens, secrets management, timeout configuration, and result persistence. Designed for general-purpose compute workloads including data processing, inference, experiments, batch jobs, and any Python-based tasks. Should be invoked for tasks involving cloud compute, GPU workloads, or when users mention running jobs on Hugging Face infrastructure without local setup.

14

hugging-face-model-trainer

patchy631

This skill should be used when users want to train or fine-tune language models using TRL (Transformer Reinforcement Learning) on Hugging Face Jobs infrastructure. Covers SFT, DPO, GRPO and reward modeling training methods, plus GGUF conversion for local deployment. Includes guidance on the TRL Jobs package, UV scripts with PEP 723 format, dataset preparation and validation, hardware selection, cost estimation, Trackio monitoring, Hub authentication, and model persistence. Should be invoked for tasks involving cloud GPU training, GGUF conversion, or when users mention training on Hugging Face Jobs without local GPU setup.

13

You might also like

robotics-code-generator

HumaizaNaz

Generates clean, runnable ROS 2, Gazebo, Isaac Sim, and VLA code for humanoid robotics

1490

modal

davila7

Run Python code in the cloud with serverless containers, GPUs, and autoscaling. Use when deploying ML models, running batch processing jobs, scheduling compute-intensive tasks, or serving APIs that require GPU acceleration or dynamic scaling.

587

computer-use-agents

davila7

Build AI agents that interact with computers like humans do - viewing screens, moving cursors, clicking buttons, and typing text. Covers Anthropic's Computer Use, OpenAI's Operator/CUA, and open-source alternatives. Critical focus on sandboxing, security, and handling the unique challenges of vision-based control. Use when: computer use, desktop automation agent, screen control AI, vision-based agent, GUI automation.

1040

machine-learning-ops-ml-pipeline

sickn33

Design and implement a complete ML pipeline for: $ARGUMENTS

436

ray-train

davila7

Distributed training orchestration across clusters. Scales PyTorch/TensorFlow/HuggingFace from laptop to 1000s of nodes. Built-in hyperparameter tuning with Ray Tune, fault tolerance, elastic scaling. Use when training massive models across multiple machines or running distributed hyperparameter sweeps.

336

hugging-face-tool-builder

patchy631

Use this skill when the user wants to build tool/scripts or achieve a task where using data from the Hugging Face API would help. This is especially useful when chaining or combining API calls or the task will be repeated/automated. This Skill creates a reusable script to fetch, enrich or process data.

714

Search skills

Search the agent skills registry