# /hf-cli: Give your agent the complete Hugging Face Hub command line

Source: https://trendhub.net/skills/huggingface-skills/hf-cli
Skill folder: https://github.com/huggingface/skills/tree/main/skills/hf-cli
Pack: Hugging Face Skills (https://trendhub.net/skills/huggingface-skills)
Works with: Claude Code, Gemini CLI

hf-cli is a reference skill generated from the installed huggingface_hub version that lists every hf command and its options. It covers downloads and uploads, auth, cache, buckets, collections, datasets SQL, discussions and pull requests, Inference Endpoints, Jobs, sandboxes, Spaces and webhooks, and replaces the deprecated huggingface-cli tool.

## When to use it

- You want the agent to download, upload or sync model, dataset or Space files.
- You need to run or schedule a job on Hugging Face hardware from the terminal.
- You manage Space secrets, variables, hardware or logs and want correct flags.

## How it works

1. **Install and authenticate**: The skill gives the one-line installer and points auth commands to hf auth, preferring an HF_TOKEN variable over passing --token.
2. **Find the command**: The agent looks up the matching hf subcommand group, such as repos, buckets, jobs or spaces, with its arguments and flags.
3. **Pick an output format**: Commands accept a format option, so the agent can ask for JSON or quiet ID-only output when it needs to parse results.
4. **Mount instead of copying**: For large repos or buckets the skill suggests hf-mount, which exposes them as a local filesystem and fetches files on demand.

## What it steers the agent away from

- Calling the deprecated huggingface-cli command.
- Guessing flags that the installed CLI version does not support.
- Downloading whole repositories when an on-demand mount would do.

## What it can touch

It runs hf commands that can read and write Hub repos, buckets, Spaces, Jobs and endpoints under your account, plus your local cache.

## Pairs well with

- `/hf-mem`
- `/huggingface-llm-trainer`
- `/huggingface-spaces`

## Questions

### How does it stay current with new CLI releases?

The file is produced from your local huggingface_hub install; running hf skills add --force regenerates it after you update the CLI.

### Can it delete things?

Yes. The command list includes deleting repos, buckets, endpoints and cached files, so review destructive commands before approving them.
