Skills hf-cli
Hugging Face Hub CLI (`hf`) for downloading, uploading, and managing models, datasets, spaces, buckets, repos, papers, jobs, and more on the Hugging Face Hub. Use when: handling authentication; managing local cache; managing Hugging Face Buckets; running or scheduling jobs on Hugging Face infrastructure; managing Hugging Face repos; discussions and pull requests; browsing models, datasets and spaces; reading, searching, or browsing academic papers; managing collections; querying datasets; configuring spaces; setting up webhooks; or deploying and managing HF Inference Endpoints. Make sure to use this skill whenever the user mentions 'hf', 'huggingface', 'Hugging Face', 'huggingface-cli', or 'hugging face cli', or wants to do anything related to the Hugging Face ecosystem and to AI and ML in general. Also use for cloud storage needs like training checkpoints, data pipelines, or agent traces. Use even if the user doesn't explicitly ask for a CLI command. Replaces the deprecated `huggingface-cli`.
git clone https://github.com/huggingface/skills
T=$(mktemp -d) && git clone --depth=1 https://github.com/huggingface/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/hf-cli" ~/.claude/skills/huggingface-skills-hf-cli && rm -rf "$T"
skills/hf-cli/SKILL.mdInstall:
curl -LsSf https://hf.co/cli/install.sh | bash -s.
The Hugging Face Hub CLI tool
hf is available. IMPORTANT: The hf command replaces the deprecated huggingface-cli command.
Use
hf --help to view available functions. Note that auth commands are now all under hf auth e.g. hf auth whoami.
Generated with
huggingface_hub v1.11.0. Run hf skills add --force to regenerate.
Commands
— Download files from the Hub.hf download REPO_ID[--type CHOICE --revision TEXT --include TEXT --exclude TEXT --cache-dir TEXT --local-dir TEXT --force-download --dry-run --max-workers INTEGER --format CHOICE]
— Print information about the environment.hf env
— Sync files between local directory and a bucket.hf sync[--delete --ignore-times --ignore-sizes --plan TEXT --apply TEXT --dry-run --include TEXT --exclude TEXT --filter-from TEXT --existing --ignore-existing --verbose --quiet]
— Upload a file or a folder to the Hub. Recommended for single-commit uploads.hf upload REPO_ID[--type CHOICE --revision TEXT --private --include TEXT --exclude TEXT --delete TEXT --commit-message TEXT --commit-description TEXT --create-pr --every FLOAT --format CHOICE]
— Upload a large folder to the Hub. Recommended for resumable uploads.hf upload-large-folder REPO_ID LOCAL_PATH[--type CHOICE --revision TEXT --private --include TEXT --exclude TEXT --num-workers INTEGER --no-report --no-bars --format CHOICE]
— Print information about the hf version.hf version
hf auth
— Manage authentication (login, logout, etc.).
hf auth
— List all stored access tokens.hf auth list
— Login using a token from huggingface.co/settings/tokens.hf auth login[--add-to-git-credential --force]
— Logout from a specific token.hf auth logout[--token-name TEXT]
— Switch between access tokens.hf auth switch[--token-name TEXT --add-to-git-credential]
— Print the current access token to stdout.hf auth token
— Find out which huggingface.co account you are logged in as.hf auth whoami[--format CHOICE]
hf buckets
— Commands to interact with buckets.
hf buckets
— Copy files to or from buckets.hf buckets cp SRC[--quiet]
— Create a new bucket.hf buckets create BUCKET_ID[--private --exist-ok --quiet]
— Delete a bucket.hf buckets delete BUCKET_ID[--yes --missing-ok --quiet]
— Get info about a bucket.hf buckets info BUCKET_ID[--quiet]
— List buckets or files in a bucket.hf buckets list[--human-readable --tree --recursive --format CHOICE --quiet]
— Move (rename) a bucket to a new name or namespace.hf buckets move FROM_ID TO_ID
— Remove files from a bucket.hf buckets remove ARGUMENT[--recursive --yes --dry-run --include TEXT --exclude TEXT --quiet]
— Sync files between local directory and a bucket.hf buckets sync[--delete --ignore-times --ignore-sizes --plan TEXT --apply TEXT --dry-run --include TEXT --exclude TEXT --filter-from TEXT --existing --ignore-existing --verbose --quiet]
hf cache
— Manage local cache directory.
hf cache
— List cached repositories or revisions.hf cache list[--cache-dir TEXT --revisions --filter TEXT --format CHOICE --sort CHOICE --limit INTEGER]
— Remove detached revisions from the cache.hf cache prune[--cache-dir TEXT --yes --dry-run --format CHOICE]
— Remove cached repositories or revisions.hf cache rm TARGETS[--cache-dir TEXT --yes --dry-run --format CHOICE]
— Verify checksums for a single repo revision from cache or a local directory.hf cache verify REPO_ID[--type CHOICE --revision TEXT --cache-dir TEXT --local-dir TEXT --fail-on-missing-files --fail-on-extra-files --format CHOICE]
hf collections
— Interact with collections on the Hub.
hf collections
— Add an item to a collection.hf collections add-item COLLECTION_SLUG ITEM_ID ITEM_TYPE[--note TEXT --exists-ok --format CHOICE]
— Create a new collection on the Hub.hf collections create TITLE[--namespace TEXT --description TEXT --private --exists-ok --format CHOICE]
— Delete a collection from the Hub.hf collections delete COLLECTION_SLUG[--missing-ok --format CHOICE]
— Delete an item from a collection.hf collections delete-item COLLECTION_SLUG ITEM_OBJECT_ID[--missing-ok --format CHOICE]
— Get info about a collection on the Hub.hf collections info COLLECTION_SLUG[--format CHOICE]
— List collections on the Hub.hf collections list[--owner TEXT --item TEXT --sort CHOICE --limit INTEGER --format CHOICE]
— Update a collection's metadata on the Hub.hf collections update COLLECTION_SLUG[--title TEXT --description TEXT --position INTEGER --private --theme TEXT --format CHOICE]
— Update an item in a collection.hf collections update-item COLLECTION_SLUG ITEM_OBJECT_ID[--note TEXT --position INTEGER --format CHOICE]
hf datasets
— Interact with datasets on the Hub.
hf datasets
— Get info about a dataset on the Hub.hf datasets info DATASET_ID[--revision TEXT --expand TEXT --format CHOICE]
— List datasets on the Hub.hf datasets list[--search TEXT --author TEXT --filter TEXT --sort CHOICE --limit INTEGER --expand TEXT --format CHOICE]
— List parquet file URLs available for a dataset.hf datasets parquet DATASET_ID[--subset TEXT --split TEXT --format CHOICE]
— Execute a raw SQL query with DuckDB against dataset parquet URLs.hf datasets sql SQL[--format CHOICE]
hf discussions
— Manage discussions and pull requests on the Hub.
hf discussions
— Close a discussion or pull request.hf discussions close REPO_ID NUM[--comment TEXT --yes --type CHOICE --format CHOICE]
— Comment on a discussion or pull request.hf discussions comment REPO_ID NUM[--body TEXT --body-file PATH --type CHOICE --format CHOICE]
— Create a new discussion or pull request on a repo.hf discussions create REPO_ID --title TEXT[--body TEXT --body-file PATH --pull-request --type CHOICE --format CHOICE]
— Show the diff of a pull request.hf discussions diff REPO_ID NUM[--type CHOICE --format CHOICE]
— Get info about a discussion or pull request.hf discussions info REPO_ID NUM[--type CHOICE --format CHOICE]
— List discussions and pull requests on a repo.hf discussions list REPO_ID[--status CHOICE --kind CHOICE --author TEXT --limit INTEGER --type CHOICE --format CHOICE]
— Merge a pull request.hf discussions merge REPO_ID NUM[--comment TEXT --yes --type CHOICE --format CHOICE]
— Rename a discussion or pull request.hf discussions rename REPO_ID NUM NEW_TITLE[--type CHOICE --format CHOICE]
— Reopen a closed discussion or pull request.hf discussions reopen REPO_ID NUM[--comment TEXT --yes --type CHOICE --format CHOICE]
hf endpoints
— Manage Hugging Face Inference Endpoints.
hf endpoints
— Deploy an Inference Endpoint from the Model Catalog.hf endpoints catalog deploy --repo TEXT[--name TEXT --accelerator TEXT --namespace TEXT --format CHOICE]
— List available Catalog models.hf endpoints catalog list[--format CHOICE]
— Delete an Inference Endpoint permanently.hf endpoints delete NAME[--namespace TEXT --yes --format CHOICE]
— Deploy an Inference Endpoint from a Hub repository.hf endpoints deploy NAME --repo TEXT --framework TEXT --accelerator TEXT --instance-size TEXT --instance-type TEXT --region TEXT --vendor TEXT[--namespace TEXT --task TEXT --format CHOICE --min-replica INTEGER --max-replica INTEGER --scale-to-zero-timeout INTEGER --scaling-metric CHOICE --scaling-threshold FLOAT]
— Get information about an existing endpoint.hf endpoints describe NAME[--namespace TEXT --format CHOICE]
— Lists all Inference Endpoints for the given namespace.hf endpoints list[--namespace TEXT --format CHOICE]
— Pause an Inference Endpoint.hf endpoints pause NAME[--namespace TEXT --format CHOICE]
— Resume an Inference Endpoint.hf endpoints resume NAME[--namespace TEXT --fail-if-already-running --format CHOICE]
— Scale an Inference Endpoint to zero.hf endpoints scale-to-zero NAME[--namespace TEXT --format CHOICE]
— Update an existing endpoint.hf endpoints update NAME[--namespace TEXT --repo TEXT --accelerator TEXT --instance-size TEXT --instance-type TEXT --framework TEXT --revision TEXT --task TEXT --min-replica INTEGER --max-replica INTEGER --scale-to-zero-timeout INTEGER --scaling-metric CHOICE --scaling-threshold FLOAT --format CHOICE]
hf extensions
— Manage hf CLI extensions.
hf extensions
— Execute an installed extension.hf extensions exec NAME
— Install an extension from a public GitHub repository.hf extensions install REPO_ID[--force]
— List installed extension commands.hf extensions list[--format CHOICE]
— Remove an installed extension.hf extensions remove NAME
— Search extensions available on GitHub (tagged with 'hf-extension' topic).hf extensions search[--format CHOICE]
hf jobs
— Run and manage Jobs on the Hub.
hf jobs
— Cancel a Jobhf jobs cancel JOB_ID[--namespace TEXT]
— List available hardware options for Jobshf jobs hardware
— Display detailed information on one or more Jobshf jobs inspect JOB_IDS[--namespace TEXT]
— Fetch the logs of a Job.hf jobs logs JOB_ID[--follow --tail INTEGER --namespace TEXT]
— List Jobs.hf jobs ps[--all --namespace TEXT --filter TEXT --format TEXT --quiet]
— Run a Job.hf jobs run IMAGE COMMAND[--env TEXT --secrets TEXT --label TEXT --volume TEXT --env-file TEXT --secrets-file TEXT --flavor CHOICE --timeout TEXT --detach --namespace TEXT]
— Delete a scheduled Job.hf jobs scheduled delete SCHEDULED_JOB_ID[--namespace TEXT]
— Display detailed information on one or more scheduled Jobshf jobs scheduled inspect SCHEDULED_JOB_IDS[--namespace TEXT]
— List scheduled Jobshf jobs scheduled ps[--all --namespace TEXT --filter TEXT --format TEXT --quiet]
— Resume (unpause) a scheduled Job.hf jobs scheduled resume SCHEDULED_JOB_ID[--namespace TEXT]
— Schedule a Job.hf jobs scheduled run SCHEDULE IMAGE COMMAND[--suspend --concurrency --env TEXT --secrets TEXT --label TEXT --volume TEXT --env-file TEXT --secrets-file TEXT --flavor CHOICE --timeout TEXT --namespace TEXT]
— Suspend (pause) a scheduled Job.hf jobs scheduled suspend SCHEDULED_JOB_ID[--namespace TEXT]
— Run a UV script (local file or URL) on HF infrastructurehf jobs scheduled uv run SCHEDULE SCRIPT[--suspend --concurrency --image TEXT --flavor CHOICE --env TEXT --secrets TEXT --label TEXT --volume TEXT --env-file TEXT --secrets-file TEXT --timeout TEXT --namespace TEXT --with TEXT --python TEXT]
— Fetch the resource usage statistics and metrics of Jobshf jobs stats[--namespace TEXT]
— Run a UV script (local file or URL) on HF infrastructurehf jobs uv run SCRIPT[--image TEXT --flavor CHOICE --env TEXT --secrets TEXT --label TEXT --volume TEXT --env-file TEXT --secrets-file TEXT --timeout TEXT --detach --namespace TEXT --with TEXT --python TEXT]
hf models
— Interact with models on the Hub.
hf models
— Get info about a model on the Hub.hf models info MODEL_ID[--revision TEXT --expand TEXT --format CHOICE]
— List models on the Hub.hf models list[--search TEXT --author TEXT --filter TEXT --num-parameters TEXT --sort CHOICE --limit INTEGER --expand TEXT --format CHOICE]
hf papers
— Interact with papers on the Hub.
hf papers
— Get info about a paper on the Hub.hf papers info PAPER_ID[--format CHOICE]
— List daily papers on the Hub.hf papers list[--date TEXT --week TEXT --month TEXT --submitter TEXT --sort CHOICE --limit INTEGER --format CHOICE]
— Read a paper as markdown.hf papers read PAPER_ID
— Search papers on the Hub.hf papers search QUERY[--limit INTEGER --format CHOICE]
hf repos
— Manage repos on the Hub.
hf repos
— Create a new branch for a repo on the Hub.hf repos branch create REPO_ID BRANCH[--revision TEXT --type CHOICE --exist-ok --format CHOICE]
— Delete a branch from a repo on the Hub.hf repos branch delete REPO_ID BRANCH[--type CHOICE --format CHOICE]
— Create a new repo on the Hub.hf repos create REPO_ID[--type CHOICE --space-sdk TEXT --private --public --protected --exist-ok --resource-group-id TEXT --flavor CHOICE --storage CHOICE --sleep-time INTEGER --secrets TEXT --secrets-file TEXT --env TEXT --env-file TEXT --volume TEXT --format CHOICE]
— Delete a repo from the Hub. This is an irreversible operation.hf repos delete REPO_ID[--type CHOICE --missing-ok --yes --format CHOICE]
— Delete files from a repo on the Hub.hf repos delete-files REPO_ID PATTERNS[--type CHOICE --revision TEXT --commit-message TEXT --commit-description TEXT --create-pr --format CHOICE]
— Duplicate a repo on the Hub (model, dataset, or Space).hf repos duplicate FROM_ID[--type CHOICE --private --public --protected --exist-ok --flavor CHOICE --storage CHOICE --sleep-time INTEGER --secrets TEXT --secrets-file TEXT --env TEXT --env-file TEXT --volume TEXT --format CHOICE]
— Move a repository from a namespace to another namespace.hf repos move FROM_ID TO_ID[--type CHOICE --format CHOICE]
— Update the settings of a repository.hf repos settings REPO_ID[--gated CHOICE --private --public --protected --type CHOICE --format CHOICE]
— Create a tag for a repo.hf repos tag create REPO_ID TAG[--message TEXT --revision TEXT --type CHOICE --format CHOICE]
— Delete a tag for a repo.hf repos tag delete REPO_ID TAG[--yes --type CHOICE --format CHOICE]
— List tags for a repo.hf repos tag list REPO_ID[--type CHOICE --format CHOICE]
hf skills
— Manage skills for AI assistants.
hf skills
— Download a Hugging Face skill and install it for an AI assistant.hf skills add[--claude --global --dest PATH --force]
— Print the generatedhf skills preview
SKILL.md to stdout.hf-cli
— Upgrade installed Hugging Face marketplace skills.hf skills upgrade[--claude --global --dest PATH]
hf spaces
— Interact with spaces on the Hub.
hf spaces
— Enable or disable dev mode on a Space.hf spaces dev-mode SPACE_ID[--stop]
— Hot-reload any Python file of a Space without a full rebuild + restart.hf spaces hot-reload SPACE_ID[--local-file TEXT --skip-checks --skip-summary]
— Get info about a space on the Hub.hf spaces info SPACE_ID[--revision TEXT --expand TEXT --format CHOICE]
— List spaces on the Hub.hf spaces list[--search TEXT --author TEXT --filter TEXT --sort CHOICE --limit INTEGER --expand TEXT --format CHOICE]
— Fetch the run or build logs of a Space.hf spaces logs SPACE_ID[--build --follow --tail INTEGER]
— Search spaces on the Hub using semantic search.hf spaces search QUERY[--filter TEXT --sdk TEXT --include-non-running --description --limit INTEGER --format CHOICE]
— Remove all volumes from a Space.hf spaces volumes delete SPACE_ID[--yes --format CHOICE]
— List volumes mounted in a Space.hf spaces volumes list SPACE_ID[--format CHOICE]
— Set (replace) volumes for a Space.hf spaces volumes set SPACE_ID[--volume TEXT --format CHOICE]
hf webhooks
— Manage webhooks on the Hub.
hf webhooks
— Create a new webhook.hf webhooks create --watch TEXT[--url TEXT --job-id TEXT --domain CHOICE --secret TEXT --format CHOICE]
— Delete a webhook permanently.hf webhooks delete WEBHOOK_ID[--yes --format CHOICE]
— Disable an active webhook.hf webhooks disable WEBHOOK_ID[--format CHOICE]
— Enable a disabled webhook.hf webhooks enable WEBHOOK_ID[--format CHOICE]
— Show full details for a single webhook.hf webhooks info WEBHOOK_ID[--format CHOICE]
— List all webhooks for the current user.hf webhooks list[--format CHOICE]
— Update an existing webhook. Only provided options are changed.hf webhooks update WEBHOOK_ID[--url TEXT --watch TEXT --domain CHOICE --secret TEXT --format CHOICE]
Common options
— Output format:--format
(or--format json
) or--json
(default).--format table
— Minimal output.-q / --quiet
— Git revision id which can be a branch name, a tag, or a commit hash.--revision
— Use a User Access Token. Prefer setting--token
env var instead of passingHF_TOKEN
.--token
— The type of repository (model, dataset, or space).--type
Mounting repos as local filesystems
To mount Hub repositories or buckets as local filesystems — no download, no copy, no waiting — use
hf-mount. Files are fetched on demand. GitHub: https://github.com/huggingface/hf-mount
Install:
curl -fsSL https://raw.githubusercontent.com/huggingface/hf-mount/main/install.sh | sh
Some command examples:
— mount a repo (read-only)hf-mount start repo openai-community/gpt2 /tmp/gpt2
— mount a bucket (read-write)hf-mount start --hf-token $HF_TOKEN bucket myuser/my-bucket /tmp/data
/hf-mount status
— list or unmounthf-mount stop /tmp/data
Tips
- Use
for full options, descriptions, usage, and real-world exampleshf <command> --help - Authenticate with
env var (recommended) or withHF_TOKEN--token