Skip to content
Agentmart
Submit a tool

hf-cli

Use the `hf` CLI tool to interact with Hugging Face Hub — downloading models/datasets, uploading files, managing repos, running jobs, and managing…

Skill by Kubementat

IndexedMIT★ 2
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/kubementat-hf-cli

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Use the `hf` CLI tool to interact with Hugging Face Hub — downloading models/datasets, uploading files, managing repos, running jobs, and managing authentication and cache. Use when the user wants to work with Hugging Face Hub from the command line.

Use cases: ml

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/hf-cli

What's inside

Skill name
hf-cli
Description
Use the `hf` CLI tool to interact with Hugging Face Hub — downloading models/datasets, uploading files, managing repos, running jobs, and managing authentication and cache. Use when the user wants to work with Hugging Face Hub from the command line.
License
MIT
Instructions
188 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# hf CLI — Hugging Face Hub CLI

The `hf` command is the official CLI for Hugging Face Hub.

## Authentication

```bash
hf auth login                          # Interactive login (prompts for token)
hf auth login --token hf_xxx          # Login with token directly
hf auth login --add-to-git-credential # Also save token to git credentials
hf auth logout                         # Logout current token
hf auth logout --token-name mytoken   # Logout specific named token
hf auth whoami                         # Show current logged-in user
hf auth list                           # List all stored tokens
hf auth switch                         # Interactive switch between tokens
hf auth switch --token-name mytoken   # Switch to specific token
```

Token from: https://huggingface.co/settings/tokens
Env var alternative: `HF_TOKEN=hf_xxx hf <command>`

## Download

```bash
hf download username/repo-name                          # Download entire repo (model by default)
hf download username/repo-name config.json              # Download specific file
hf download username/repo-name "*.safetensors"          # Download matching files
hf download username/repo-name --repo-type dataset      # Download dataset
hf download username/repo-name --repo-type space        # Download space
hf download username/repo-name --revision main          # Specific branch/tag/commit
hf download username/repo-name --local-dir ./my-model   # Download to specific dir (not cache)
hf download username/repo-name --cache-dir /tmp/cache   # Custom cache dir
hf download username/repo-name --include "*.json"       # Include glob pattern
hf download username/repo-name --exclude "*.bin"        # Exclude glob pattern
hf download username/repo-name --force-download         # Re-download even if cached
hf download username/repo-name --quiet                  # Suppress progress bars
hf download username/repo-name --max-workers 4          # Parallel workers (default: 8)
```

`--repo-type`: `model` (default), `dataset`, `space`

## Upload

For single-commit uploads:

```bash
hf upload username/repo-name ./local-file.bin          # Upload single file
hf upload username/repo-name ./local-folder            # Upload folder
hf upload username/repo-name ./file.bin path/in/repo   # Upload to specific path in repo
hf upload username/repo-name --repo-type dataset       # Upload to dataset repo
hf upload username/repo-name --private                 # Create private repo if new
hf upload username/repo-name --revision mybranch       # Push to specific branch
hf upload username/repo-name --create-pr               # Upload as a PR
hf upload username/repo-name --include "*.safetensors" # Only upload matching files
hf upload username/repo-name --exclude "*.tmp"         # Exclude matching files
hf upload username/repo-name --delete "old/*.bin"      # Delete files while committing
hf upload username/repo-name --commit-message "Update" # Custom commit message
hf upload username/repo-name --every 5                 # Auto-commit every 5 minutes
hf upload username/repo-name --quiet                   # Suppress progress bars
```

## Upload Large Folder (resumable)

For large uploads that may need to resume:

```bash
hf upload-large-folder username/repo-name ./large-folder
hf upload-large-folder username/repo-name ./folder --repo-type dataset
hf upload-large-folder username/repo-name ./folder --num-workers 4
hf upload-large-folder username/repo-name ./folder --include "*.bin"
hf upload-large-folder username/repo-name ./folder --exclude "*.tmp"
hf upload-large-folder username/repo-name ./folder --no-report  # Disable status reports
hf upload-large-folder username/repo-name ./folder --no-bars    # Disable progress bars
```

## Cache Management

Default cache: `~/.cache/huggingface/hub`

```bash
hf cache scan                          # Show cached models/datasets
hf cache scan -v                       # Verbose (show all revisions)
hf cache scan --dir /custom/cache      # Scan custom cache dir
hf cache delete                        # Interactive TUI to select and delete revisions
hf cache delete --disable-tui         # Non-interactive mode (pipe-friendly)
hf cache delete --sort size           # Sort by: alphabetical, lastUpdated, lastUsed, size
hf cache delete --dir /custom/cache   # Delete from custom cache dir
```

## Repo Management

```bash
# Create repos
hf repo create username/my-model                           # Create model repo
hf repo create my-dataset --repo-type dataset              # Create dataset
hf repo create my-space --repo-type space --space_sdk gradio  # Create space
hf repo create username/repo --private                     # Create private repo
hf repo create username/repo --exist-ok                    # No error if exists

# Tags
hf repo tag create username/repo v1.0                      # Create tag
hf repo tag create username/repo v1.0 --revision mybranch  # Tag specific revision
hf repo tag create username/repo v1.0 -m "Release 1.0"    # Tag with message
hf repo tag list username/repo                             # List all tags
hf repo tag delete username/repo v1.0                      # Delete tag
hf repo tag delete username/repo v1.0 -y                   # Skip confirmation
```

`--repo-type` for tag commands: `model` (default), `dataset`, `space`

## Repo Files

```bash
hf repo-files delete username/repo "old_file.bin"          # Delete file
hf repo-files delete username/repo "*.tmp" "*.bak"         # Delete by glob patterns
hf repo-files delete username/repo "data/" --repo-type dataset
hf repo-files delete username/repo "file.bin" --create-pr  # Delete via PR
hf repo-files delete username/repo "file.bin" --revision branch
```

From Kubementat/ai_agent_skills, MIT.

More from Kubementat/ai_agent_skills

Signals

Stars
2
Forks
0
Open issues
0
Last commit (this folder)
Mar 20, 2026 (7 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from Kubementat

Cite this page

hf-cli skill. Agent Mart. https://agentmart.dev/skills/kubementat-hf-cli (last updated 2026-10-24)