hf-cli

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

11|2|Updated Dec 29, 2025
One-click install
npx skills add https://github.com/oskrgab/petrodb --skill hf-cli-oskrgab
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hf-cli
Source: https://github.com/oskrgab/petrodb/tree/main/.agents/skills/hf-cli
Command: npx skills add https://github.com/oskrgab/petrodb --skill hf-cli-oskrgab

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working with the Hugging Face Hub from the terminal requires knowing dozens of commands across authentication, file transfers, repo management, inference endpoints, and scheduled jobs. This Skill gives an AI assistant the complete, current command reference for the hf CLI so it can execute Hub operations correctly on the first attempt. ## Core Features & Use Cases - File and repo operations: Download and upload models, datasets, and spaces, sync buckets, manage branches, tags, and repo settings. - Compute and deployment: Run and schedule jobs on HF infrastructure, deploy and manage Inference Endpoints, and configure Space hardware, secrets, and variables. - Discovery and collaboration: Search models, datasets, spaces, and papers, query dataset parquet files with SQL, and manage discussions, pull requests, collections, and webhooks. - Use Case: Ask the assistant to download a specific dataset revision, run a SQL query against its parquet files, then upload the processed results to a new private dataset repo. ## Quick Start Ask the assistant to download the dataset 'sumpalabs/petrodb' from the Hugging Face Hub and list its parquet files.

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. Authenticate first with 'hf auth login' or by setting the HF_TOKEN environment variable for gated repos.

What is the difference between hf and huggingface-cli?

The 'hf' command is the current Hugging Face Hub CLI and replaces the deprecated 'huggingface-cli' command. Auth commands now live under 'hf auth', for example 'hf auth whoami' and 'hf auth login'.

How do I run a SQL query on a Hugging Face dataset?

Use 'hf datasets sql SQL' to execute a DuckDB query directly against a dataset's parquet URLs without downloading the full dataset. You can list available parquet files first with 'hf datasets parquet DATASET_ID'.

Can I run training jobs on Hugging Face infrastructure from the CLI?

Yes, 'hf jobs run IMAGE COMMAND' launches a job with selectable hardware flavors from cpu-basic up to h200x8 GPUs. Use 'hf jobs scheduled run' with a cron schedule for recurring jobs, and 'hf jobs logs' to monitor output.

How do I upload a large folder to the Hugging Face Hub?

Use 'hf upload-large-folder REPO_ID LOCAL_PATH' for resumable uploads of large directories. For smaller single-commit uploads, 'hf upload REPO_ID' is the recommended command.

Why does my hf command fail with authentication errors?

Authentication failures occur when no valid token is configured or the token lacks required permissions. Run 'hf auth whoami' to check the active account, and set the HF_TOKEN environment variable rather than passing --token on the command line.