hugging-face-cli
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.
Best use case
hugging-face-cli is best used when you need a repeatable AI agent workflow instead of a one-off prompt. It is especially useful for teams working in multi. 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.
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.
Users should expect a more consistent workflow output, faster repeated execution, and less time spent rewriting prompts from scratch.
Practical example
Example input
Use the "hugging-face-cli" skill to help with this workflow task. Context: 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.
Example output
A structured workflow result with clearer steps, more consistent formatting, and an output that is easier to reuse in the next run.
When to use this skill
- Use this skill when you want a reusable workflow rather than writing the same prompt again and again.
When not to use this skill
- Do not use this when you only need a one-off answer and do not need a reusable workflow.
- Do not use it if you cannot install or maintain the related files, repository context, or supporting tools.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/hugging-face-cli/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How hugging-face-cli Compares
| Feature / Agent | hugging-face-cli | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
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.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# 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. ## When to Use This Skill Use this skill when: - User needs to download models, datasets, or spaces - Uploading files to Hub repositories - Creating Hugging Face repositories - Managing local cache - Running compute jobs on HF infrastructure - Working with Hugging Face Hub authentication ## Quick Command Reference | Task | Command | |------|---------| | Login | `hf auth login` | | Download model | `hf download <repo_id>` | | Download to folder | `hf download <repo_id> --local-dir ./path` | | Upload folder | `hf upload <repo_id> . .` | | Create repo | `hf repo create <name>` | | Create tag | `hf repo tag create <repo_id> <tag>` | | Delete files | `hf repo-files delete <repo_id> <files>` | | List cache | `hf cache ls` | | Remove from cache | `hf cache rm <repo_or_revision>` | | List models | `hf models ls` | | Get model info | `hf models info <model_id>` | | List datasets | `hf datasets ls` | | Get dataset info | `hf datasets info <dataset_id>` | | List spaces | `hf spaces ls` | | Get space info | `hf spaces info <space_id>` | | List endpoints | `hf endpoints ls` | | Run GPU job | `hf jobs run --flavor a10g-small <image> <cmd>` | | Environment info | `hf env` | ## Core Commands ### Authentication ```bash 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 ```bash 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 ```bash 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 ```bash 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 ```bash hf repo-files delete <repo_id> folder/ # Delete folder hf repo-files delete <repo_id> "*.txt" # Delete with pattern ``` ### Cache Management ```bash 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 ```bash # 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) ```bash 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 ```bash 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 ```bash # 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 ```bash 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 ```bash hf upload my-username/my-space . . --repo-type space \ --exclude="logs/*" --delete="*" --commit-message="Sync" ``` ### Check Cache Usage ```bash 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 - **Complete command reference**: See [references/commands.md](references/commands.md) - **Workflow examples**: See [references/examples.md](references/examples.md)
Related Skills
faceswap
AI Face Swap - Swap face in video, deepfake face replacement, face swap for portraits. Use from command line. Supports local video files, YouTube, Bilibili URLs, auto-download, real-time progress tracking.
hugging-face-jobs
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.
interface-design
This skill is for interface design — dashboards, admin panels, apps, tools, and interactive products. NOT for marketing design (landing pages, marketing sites, campaigns).
building-chat-interfaces
Build AI chat interfaces with custom backends, authentication, and context injection. Use when integrating chat UI with AI agents, adding auth to chat, injecting user/page context, or implementing httpOnly cookie proxies. Covers ChatKitServer, useChatKit, and MCP auth patterns. NOT when building simple chatbots without persistence or custom agent integration.
tool-interface-analysis
Analyze tool registration, schema generation, and error feedback mechanisms in agent frameworks. Use when (1) understanding how tools are defined and registered, (2) evaluating schema generation approaches (introspection vs manual), (3) tracing error feedback loops to the LLM, (4) assessing retry and self-correction mechanisms, or (5) comparing tool interfaces across frameworks.
azure-quotas
Check/manage Azure quotas and usage across providers. For deployment planning, capacity validation, region selection. WHEN: "check quotas", "service limits", "current usage", "request quota increase", "quota exceeded", "validate capacity", "regional availability", "provisioning limits", "vCPU limit", "how many vCPUs available in my subscription".
raindrop-io
Manage Raindrop.io bookmarks with AI assistance. Save and organize bookmarks, search your collection, manage reading lists, and organize research materials. Use when working with bookmarks, web research, reading lists, or when user mentions Raindrop.io.
zlibrary-to-notebooklm
自动从 Z-Library 下载书籍并上传到 Google NotebookLM。支持 PDF/EPUB 格式,自动转换,一键创建知识库。
discover-skills
当你发现当前可用的技能都不够合适(或用户明确要求你寻找技能)时使用。本技能会基于任务目标和约束,给出一份精简的候选技能清单,帮助你选出最适配当前任务的技能。
web-performance-seo
Fix PageSpeed Insights/Lighthouse accessibility "!" errors caused by contrast audit failures (CSS filters, OKLCH/OKLAB, low opacity, gradient text, image backgrounds). Use for accessibility-driven SEO/performance debugging and remediation.
project-to-obsidian
将代码项目转换为 Obsidian 知识库。当用户提到 obsidian、项目文档、知识库、分析项目、转换项目 时激活。 【激活后必须执行】: 1. 先完整阅读本 SKILL.md 文件 2. 理解 AI 写入规则(默认到 00_Inbox/AI/、追加式、统一 Schema) 3. 执行 STEP 0: 使用 AskUserQuestion 询问用户确认 4. 用户确认后才开始 STEP 1 项目扫描 5. 严格按 STEP 0 → 1 → 2 → 3 → 4 顺序执行 【禁止行为】: - 禁止不读 SKILL.md 就开始分析项目 - 禁止跳过 STEP 0 用户确认 - 禁止直接在 30_Resources 创建(先到 00_Inbox/AI/) - 禁止自作主张决定输出位置
obsidian-helper
Obsidian 智能笔记助手。当用户提到 obsidian、日记、笔记、知识库、capture、review 时激活。 【激活后必须执行】: 1. 先完整阅读本 SKILL.md 文件 2. 理解 AI 写入三条硬规矩(00_Inbox/AI/、追加式、白名单字段) 3. 按 STEP 0 → STEP 1 → ... 顺序执行 4. 不要跳过任何步骤,不要自作主张 【禁止行为】: - 禁止不读 SKILL.md 就开始工作 - 禁止跳过用户确认步骤 - 禁止在非 00_Inbox/AI/ 位置创建新笔记(除非用户明确指定)