Hugging Face CLI (hf) Skill for Hermes Agent: Reference Guide
HuggingFace hf CLI: search/download/upload models, datasets.
Written by Neura Market from the official Hermes Agent documentation for Huggingface Hub. Commands, paths, and version numbers are reproduced from the source unchanged.
Read the official documentationThe Hugging Face CLI skill gives a Hermes Agent session a direct line to the Hugging Face Hub: searching and downloading models and datasets, uploading artifacts, and managing repositories, endpoints, jobs, and Spaces from the terminal. It is the skill to install when your agent needs to pull weights, push a fine-tuned checkpoint, or script Hub operations as part of a larger pipeline. If your work stays entirely inside Python and you never touch the Hub from a shell, you probably do not need it.
What it does
The skill wraps the hf command, the current command-line interface for the Hugging Face Hub. Through it an agent can move files in both directions, inspect what a repository contains, run SQL against dataset parquet files, and administer the surrounding infrastructure: authentication tokens, branches and tags, discussions and pull requests, Inference Endpoints, Jobs, Spaces, buckets, the local cache, webhooks, and collections.
Because the CLI exposes a JSON output mode, the results are usable by an agent rather than only by a human reading a terminal. That is the main reason to reach for this skill over a one-off script.
Before you start
The skill is optional and installed on demand. Its path is optional-skills/mlops/models/huggingface-hub, version 1.0.1, authored by Hugging Face under the MIT license. It runs on linux, macos, and windows.
The CLI itself is installed with:
curl -LsSf https://hf.co/cli/install.sh | bash -s
Run hf --help to see the available functions and the examples that ship with them. For authentication, the recommended route is the HF_TOKEN environment variable or the --token flag. Tokens are created at huggingface.co/settings/tokens.
One naming note matters before you copy any older instructions: hf replaces the deprecated huggingface-cli command.
Core commands
General operations
hf download REPO_ID: Download files from the Hub.hf upload REPO_ID: Upload files/folders (recommended for single-commit; also handles resumable uploads of large directories).hf upload-large-folder REPO_ID LOCAL_PATH: [Deprecated], usehf uploadinstead.hf sync: Sync files between a local directory and a bucket.hf env/hf version: View environment and version details.
Download and upload are the two commands most sessions will use. hf upload is the recommended path for a single commit and also covers resumable uploads when a directory is large, which is why upload-large-folder is marked deprecated: the general command now handles that case.
Authentication (hf auth)
login/logout: Manage sessions using tokens from huggingface.co/settings/tokens.list/switch: Manage and toggle between multiple stored access tokens.whoami: Identify the currently logged-in account.
If you work across more than one account or organization, list and switch let you keep several tokens stored and move between them instead of re-authenticating. whoami is the quick check for which identity a command will act as.
Repository management (hf repos)
create/delete: Create or permanently remove repositories.duplicate: Clone a model, dataset, or Space to a new ID.move: Transfer a repository between namespaces.branch/tag: Manage Git-like references.delete-files: Remove specific files using patterns.
Deletion here is permanent, so treat delete and delete-files as commands to run deliberately. duplicate and move are the tools for promoting a repository from a personal namespace into an organization.
Specialized Hub interactions
Datasets and models
- Datasets:
hf datasets list,info, andparquet(list parquet URLs). - SQL Queries:
hf datasets sql SQL, Execute raw SQL via DuckDB against dataset parquet URLs. - Models:
hf models listandinfo. - Papers:
hf papers ls, View daily papers.
The parquet subcommand gives you the underlying file URLs, and datasets sql runs DuckDB queries directly against them. That combination lets an agent answer questions about a dataset without downloading it first.
Discussions and pull requests (hf discussions)
- Manage the lifecycle of Hub contributions:
list,create,info,comment,close,reopen, andrename. diff: View changes in a PR.merge: Finalize pull requests.
This is the review workflow for Hub contributions, handled from the same interface as everything else.
Infrastructure and compute
- Endpoints: Deploy and manage Inference Endpoints (
deploy,pause,resume,scale-to-zero,catalog). - Jobs: Run compute tasks on HF infrastructure. Includes
hf jobs uvfor running Python scripts with inline dependencies andstatsfor resource monitoring. - Spaces: Manage interactive apps. Includes
dev-modeandhot-reloadfor Python files without full restarts.
scale-to-zero is worth knowing about if you are managing cost on an endpoint that sees intermittent traffic. For Spaces, dev-mode and hot-reload shorten the edit cycle when you are iterating on a Python file.
Storage and automation
- Buckets: Full S3-like bucket management (
create,cp,mv,rm,sync). - Cache: Manage local storage with
list,prune(remove detached revisions), andverify(checksum checks). - Webhooks: Automate workflows by managing Hub webhooks (
create,watch,enable/disable). - Collections: Organize Hub items into collections (
add-item,update,list).
hf cache verify runs checksum checks, which is the command to reach for when a download looks corrupted. prune clears detached revisions to reclaim disk space.
Advanced usage and tips
Global flags
--format json: Produces machine-readable output for automation.-q/--quiet: Limits output to IDs only.
For agent work, --format json is the flag that makes the CLI composable. -q is the lighter option when you only need identifiers.
Extensions and skills
- Extensions: Extend CLI functionality via GitHub repositories using
hf extensions install REPO_ID. - Skills: Manage AI assistant skills with
hf skills add.
Limits and gotchas
huggingface-cli is deprecated; instructions written against it should be translated to hf. hf upload-large-folder is also deprecated in favour of hf upload. Repository delete and delete-files are permanent operations. Authentication is expected through HF_TOKEN or --token, so plan for token handling before running commands in an automated context.
What pairs with this
This skill sits in the MLOps group alongside the other model-handling skills in the optional set. Within the CLI itself, the natural companions are the cache commands for local storage hygiene and the Jobs commands when you want compute to run on Hugging Face infrastructure rather than locally.