hf-cli

Manages Hugging Face Hub models, datasets, spaces, jobs, and repos via the hf CLI.

1|1|Updated Apr 21, 2025
One-click install
npx skills add https://github.com/jrp2014/check_models --skill hf-cli-jrp2014
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: hf-cli
Source: https://github.com/jrp2014/check_models/tree/main/.agents/skills/hf-cli
Command: npx skills add https://github.com/jrp2014/check_models --skill hf-cli-jrp2014

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working with the Hugging Face Hub involves many distinct operations—downloading models, uploading files, managing repos, running jobs, configuring spaces—that are tedious to perform through the web UI or raw API calls. This Skill provides the complete hf CLI command reference so an AI assistant can execute any Hub operation directly and correctly. ## Core Features & Use Cases - Model and Dataset Operations: Download, upload, search, and inspect models and datasets, including SQL queries against dataset parquet files and leaderboard lookups. - Infrastructure Management: Run and schedule Jobs on Hugging Face hardware, deploy Inference Endpoints, manage Spaces (hardware, secrets, logs, SSH), and create sandboxes. - Repo and Collaboration Workflows: Create and configure repos, manage branches and tags, handle discussions and pull requests, organize collections, and set up webhooks. - Use Case: Ask the assistant to download a specific MLX model revision, check local cache usage with hf cache list, then schedule a nightly training job on an A100 with hf jobs scheduled run—all without leaving the conversation. ## Quick Start Ask the assistant to download the model 'mlx-community/Llama-3.2-3B-Instruct-4bit' from the Hugging Face Hub and then show which account is currently authenticated.

Frequently Asked Questions about hf-cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I download a model from Hugging Face using the CLI?▼

Use `hf download REPO_ID` with optional flags like `--revision`, `--include`, `--exclude`, and `--local-dir` to control what gets fetched and where it is stored. The `hf` command replaces the deprecated `huggingface-cli`.

How do I authenticate with the Hugging Face Hub from the command line?▼

Run `hf auth login` to log in from your browser or with a token from huggingface.co/settings/tokens. Use `hf auth whoami` to verify the active account and `hf auth switch` to change between stored tokens.

Can I run training or inference jobs on Hugging Face infrastructure?▼

Yes, `hf jobs run IMAGE COMMAND` launches a job on selectable hardware flavors from cpu-basic up to h200x8. You can also schedule recurring jobs with `hf jobs scheduled run` and monitor them via `hf jobs logs` and `hf jobs inspect`.

How do I free up space in the Hugging Face local cache?▼

Use `hf cache list` to inspect cached repositories sorted by size or access time, then `hf cache prune` to remove detached revisions and incomplete downloads, or `hf cache rm` to delete specific repos.

What is the difference between huggingface-cli and the hf command?▼

The `hf` command is the current Hugging Face Hub CLI and fully replaces the deprecated `huggingface-cli`. Auth commands moved under `hf auth`, and the new CLI adds buckets, jobs, sandboxes, endpoints, and skills management.