hf-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseInstall: .
curl -LsSf https://hf.co/cli/install.sh | bash -sThe Hugging Face Hub CLI tool is available. IMPORTANT: The command replaces the deprecated command.
hfhfhuggingface-cliUse to view available functions. Note that auth commands are now all under e.g. .
hf --helphf authhf auth whoamiGenerated with . Run to regenerate.
huggingface_hub v1.6.0hf skills add --force安装命令:。
curl -LsSf https://hf.co/cli/install.sh | bash -sHugging Face Hub CLI工具现已可用。重要提示:命令替代了已弃用的命令。
hfhfhuggingface-cli使用查看可用功能。请注意,身份验证相关命令现已全部归类到下,例如。
hf --helphf authhf auth whoami由生成。运行可重新生成。
huggingface_hub v1.6.0hf skills add --forceCommands
命令
- — Download files from the Hub.
hf download REPO_ID - — Print information about the environment.
hf env - — Sync files between local directory and a bucket.
hf sync - — Upload a file or a folder to the Hub. Recommended for single-commit uploads.
hf upload REPO_ID - — Upload a large folder to the Hub. Recommended for resumable uploads.
hf upload-large-folder REPO_ID LOCAL_PATH - — Print information about the hf version.
hf version
- — 从Hub下载文件。
hf download REPO_ID - — 打印环境相关信息。
hf env - — 同步本地目录与存储桶之间的文件。
hf sync - — 上传单个文件或文件夹到Hub,推荐用于单次提交上传场景。
hf upload REPO_ID - — 上传大文件夹到Hub,推荐用于支持断点续传的上传场景。
hf upload-large-folder REPO_ID LOCAL_PATH - — 打印hf版本相关信息。
hf version
hf auth
— Manage authentication (login, logout, etc.).
hf authhf auth
— 管理身份验证(登录、登出等)。
hf auth- — List all stored access tokens.
hf auth list - — Login using a token from huggingface.co/settings/tokens.
hf auth login - — Logout from a specific token.
hf auth logout - — Switch between access tokens.
hf auth switch - — Find out which huggingface.co account you are logged in as.
hf auth whoami
- — 列出所有已存储的访问令牌。
hf auth list - — 使用huggingface.co/settings/tokens中生成的令牌登录。
hf auth login - — 登出指定令牌对应的账号。
hf auth logout - — 在多个访问令牌之间切换。
hf auth switch - — 查看当前登录的huggingface.co账号信息。
hf auth whoami
hf buckets
— Commands to interact with buckets.
hf bucketshf buckets
— 与存储桶交互的相关命令。
hf buckets- — Copy a single file to or from a bucket.
hf buckets cp SRC - — Create a new bucket.
hf buckets create BUCKET_ID - — Delete a bucket.
hf buckets delete BUCKET_ID - — Get info about a bucket.
hf buckets info BUCKET_ID - — List buckets or files in a bucket.
hf buckets list - — 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 - — Sync files between local directory and a bucket.
hf buckets sync
- — 向存储桶复制文件或从存储桶复制单个文件。
hf buckets cp SRC - — 创建新的存储桶。
hf buckets create BUCKET_ID - — 删除存储桶。
hf buckets delete BUCKET_ID - — 获取存储桶的相关信息。
hf buckets info BUCKET_ID - — 列出存储桶或存储桶中的文件。
hf buckets list - — 移动(重命名)存储桶到新名称或命名空间。
hf buckets move FROM_ID TO_ID - — 从存储桶中删除文件。
hf buckets remove ARGUMENT - — 同步本地目录与存储桶之间的文件。
hf buckets sync
hf cache
— Manage local cache directory.
hf cachehf cache
— 管理本地缓存目录。
hf cache- — List cached repositories or revisions.
hf cache ls - — Remove detached revisions from the cache.
hf cache prune - — Remove cached repositories or revisions.
hf cache rm TARGETS - — Verify checksums for a single repo revision from cache or a local directory.
hf cache verify REPO_ID
- — 列出已缓存的仓库或版本。
hf cache ls - — 从缓存中移除无关联的版本。
hf cache prune - — 移除已缓存的仓库或版本。
hf cache rm TARGETS - — 验证缓存或本地目录中单个仓库版本的校验和。
hf cache verify REPO_ID
hf collections
— Interact with collections on the Hub.
hf collectionshf collections
— 与Hub上的收藏集交互。
hf collections- — Add an item to a collection.
hf collections add-item COLLECTION_SLUG ITEM_ID ITEM_TYPE - — Create a new collection on the Hub.
hf collections create TITLE - — Delete a collection from the Hub.
hf collections delete COLLECTION_SLUG - — Delete an item from a collection.
hf collections delete-item COLLECTION_SLUG ITEM_OBJECT_ID - — Get info about a collection on the Hub.
hf collections info COLLECTION_SLUG - — List collections on the Hub.
hf collections ls - — Update a collection's metadata on the Hub.
hf collections update COLLECTION_SLUG - — Update an item in a collection.
hf collections update-item COLLECTION_SLUG ITEM_OBJECT_ID
- — 向收藏集添加条目。
hf collections add-item COLLECTION_SLUG ITEM_ID ITEM_TYPE - — 在Hub上创建新的收藏集。
hf collections create TITLE - — 从Hub删除收藏集。
hf collections delete COLLECTION_SLUG - — 从收藏集删除条目。
hf collections delete-item COLLECTION_SLUG ITEM_OBJECT_ID - — 获取Hub上某收藏集的相关信息。
hf collections info COLLECTION_SLUG - — 列出Hub上的收藏集。
hf collections ls - — 更新Hub上收藏集的元数据。
hf collections update COLLECTION_SLUG - — 更新收藏集中的条目。
hf collections update-item COLLECTION_SLUG ITEM_OBJECT_ID
hf datasets
— Interact with datasets on the Hub.
hf datasetshf datasets
— 与Hub上的数据集交互。
hf datasets- — Get info about a dataset on the Hub.
hf datasets info DATASET_ID - — List datasets on the Hub.
hf datasets ls - — List parquet file URLs available for a dataset.
hf datasets parquet DATASET_ID - — Execute a raw SQL query with DuckDB against dataset parquet URLs.
hf datasets sql SQL
- — 获取Hub上某数据集的相关信息。
hf datasets info DATASET_ID - — 列出Hub上的数据集。
hf datasets ls - — 列出数据集可用的parquet文件URL。
hf datasets parquet DATASET_ID - — 基于数据集的parquet文件URL,通过DuckDB执行原生SQL查询。
hf datasets sql SQL
hf discussions
— Manage discussions and pull requests on the Hub.
hf discussionshf discussions
— 管理Hub上的讨论和拉取请求。
hf discussions- — Close a discussion or pull request.
hf discussions close REPO_ID NUM - — Comment on a discussion or pull request.
hf discussions comment REPO_ID NUM - — Create a new discussion or pull request on a repo.
hf discussions create REPO_ID title - — Show the diff of a pull request.
hf discussions diff REPO_ID NUM - — Get info about a discussion or pull request.
hf discussions info REPO_ID NUM - — List discussions and pull requests on a repo.
hf discussions list REPO_ID - — Merge a pull request.
hf discussions merge REPO_ID NUM - — Rename a discussion or pull request.
hf discussions rename REPO_ID NUM NEW_TITLE - — Reopen a closed discussion or pull request.
hf discussions reopen REPO_ID NUM
- — 关闭讨论或拉取请求。
hf discussions close REPO_ID NUM - — 在讨论或拉取请求下评论。
hf discussions comment REPO_ID NUM - — 在仓库下创建新的讨论或拉取请求。
hf discussions create REPO_ID title - — 展示拉取请求的差异。
hf discussions diff REPO_ID NUM - — 获取讨论或拉取请求的相关信息。
hf discussions info REPO_ID NUM - — 列出仓库下的讨论和拉取请求。
hf discussions list REPO_ID - — 合并拉取请求。
hf discussions merge REPO_ID NUM - — 重命名讨论或拉取请求。
hf discussions rename REPO_ID NUM NEW_TITLE - — 重新打开已关闭的讨论或拉取请求。
hf discussions reopen REPO_ID NUM
hf endpoints
— Manage Hugging Face Inference Endpoints.
hf endpointshf endpoints
— 管理Hugging Face Inference Endpoints。
hf endpoints- — Interact with the Inference Endpoints catalog.
hf endpoints catalog - — Delete an Inference Endpoint permanently.
hf endpoints delete NAME - — Deploy an Inference Endpoint from a Hub repository.
hf endpoints deploy NAME repo framework accelerator instance_size instance_type region vendor - — Get information about an existing endpoint.
hf endpoints describe NAME - — Lists all Inference Endpoints for the given namespace.
hf endpoints ls - — Pause an Inference Endpoint.
hf endpoints pause NAME - — Resume an Inference Endpoint.
hf endpoints resume NAME - — Scale an Inference Endpoint to zero.
hf endpoints scale-to-zero NAME - — Update an existing endpoint.
hf endpoints update NAME
- — 与推理端点目录交互。
hf endpoints catalog - — 永久删除推理端点。
hf endpoints delete NAME - — 从Hub仓库部署推理端点。
hf endpoints deploy NAME repo framework accelerator instance_size instance_type region vendor - — 获取现有端点的相关信息。
hf endpoints describe NAME - — 列出指定命名空间下的所有推理端点。
hf endpoints ls - — 暂停推理端点。
hf endpoints pause NAME - — 恢复推理端点。
hf endpoints resume NAME - — 将推理端点缩容到0实例。
hf endpoints scale-to-zero NAME - — 更新现有端点。
hf endpoints update NAME
hf extensions
— Manage hf CLI extensions.
hf extensionshf extensions
— 管理hf CLI扩展。
hf extensions- — Execute an installed extension.
hf extensions exec NAME - — Install an extension from a public GitHub repository.
hf extensions install REPO_ID - — List installed extension commands.
hf extensions list - — Remove an installed extension.
hf extensions remove NAME
- — 执行已安装的扩展。
hf extensions exec NAME - — 从公开GitHub仓库安装扩展。
hf extensions install REPO_ID - — 列出已安装的扩展命令。
hf extensions list - — 移除已安装的扩展。
hf extensions remove NAME
hf jobs
— Run and manage Jobs on the Hub.
hf jobshf jobs
— 运行和管理Hub上的任务。
hf jobs- — Cancel a Job
hf jobs cancel JOB_ID - — List available hardware options for Jobs
hf jobs hardware - — Display detailed information on one or more Jobs
hf jobs inspect JOB_IDS - — Fetch the logs of a Job.
hf jobs logs JOB_ID - — List Jobs.
hf jobs ps - — Run a Job.
hf jobs run IMAGE COMMAND - — Create and manage scheduled Jobs on the Hub.
hf jobs scheduled - — Fetch the resource usage statistics and metrics of Jobs
hf jobs stats - — Run UV scripts (Python with inline dependencies) on HF infrastructure.
hf jobs uv
- — 取消任务
hf jobs cancel JOB_ID - — 列出任务可用的硬件选项
hf jobs hardware - — 展示一个或多个任务的详细信息
hf jobs inspect JOB_IDS - — 获取任务的日志。
hf jobs logs JOB_ID - — 列出任务。
hf jobs ps - — 运行任务。
hf jobs run IMAGE COMMAND - — 创建和管理Hub上的定时任务。
hf jobs scheduled - — 获取任务的资源使用统计数据和指标
hf jobs stats - — 在HF基础设施上运行UV脚本(带内联依赖的Python)。
hf jobs uv
hf models
— Interact with models on the Hub.
hf modelshf models
— 与Hub上的模型交互。
hf models- — Get info about a model on the Hub.
hf models info MODEL_ID - — List models on the Hub.
hf models ls
- — 获取Hub上某模型的相关信息。
hf models info MODEL_ID - — 列出Hub上的模型。
hf models ls
hf papers
— Interact with papers on the Hub.
hf papershf papers
— 与Hub上的论文交互。
hf papers- — List daily papers on the Hub.
hf papers ls
- — 列出Hub上的每日论文。
hf papers ls
hf repos
— Manage repos on the Hub.
hf reposhf repos
— 管理Hub上的仓库。
hf repos- — Manage branches for a repo on the Hub.
hf repos branch - — Create a new repo on the Hub.
hf repos create REPO_ID - — Delete a repo from the Hub. This is an irreversible operation.
hf repos delete REPO_ID - — Delete files from a repo on the Hub.
hf repos delete-files REPO_ID PATTERNS - — Duplicate a repo on the Hub (model, dataset, or Space).
hf repos duplicate FROM_ID - — Move a repository from a namespace to another namespace.
hf repos move FROM_ID TO_ID - — Update the settings of a repository.
hf repos settings REPO_ID - — Manage tags for a repo on the Hub.
hf repos tag
- — 管理Hub上仓库的分支。
hf repos branch - — 在Hub上创建新仓库。
hf repos create REPO_ID - — 从Hub删除仓库,该操作不可撤销。
hf repos delete REPO_ID - — 从Hub上的仓库删除文件。
hf repos delete-files REPO_ID PATTERNS - — 复制Hub上的仓库(模型、数据集或Space)。
hf repos duplicate FROM_ID - — 将仓库从一个命名空间移动到另一个命名空间。
hf repos move FROM_ID TO_ID - — 更新仓库的设置。
hf repos settings REPO_ID - — 管理Hub上仓库的标签。
hf repos tag
hf skills
— Manage skills for AI assistants.
hf skillshf skills
— 管理AI助手的技能。
hf skills- — Download a skill and install it for an AI assistant.
hf skills add - — Print the generated SKILL.md to stdout.
hf skills preview
- — 下载技能并为AI助手安装。
hf skills add - — 将生成的SKILL.md打印到标准输出。
hf skills preview
hf spaces
— Interact with spaces on the Hub.
hf spaceshf spaces
— 与Hub上的Spaces交互。
hf spaces- — Enable or disable dev mode on a Space.
hf spaces dev-mode SPACE_ID - — Hot-reload any Python file of a Space without a full rebuild + restart.
hf spaces hot-reload SPACE_ID - — Get info about a space on the Hub.
hf spaces info SPACE_ID - — List spaces on the Hub.
hf spaces ls
- — 开启或关闭Space的开发者模式。
hf spaces dev-mode SPACE_ID - — 热重载Space的任意Python文件,无需完整重建+重启。
hf spaces hot-reload SPACE_ID - — 获取Hub上某Space的相关信息。
hf spaces info SPACE_ID - — 列出Hub上的Spaces。
hf spaces ls
hf webhooks
— Manage webhooks on the Hub.
hf webhookshf webhooks
— 管理Hub上的webhooks。
hf webhooks- — Create a new webhook.
hf webhooks create watch - — Delete a webhook permanently.
hf webhooks delete WEBHOOK_ID - — Disable an active webhook.
hf webhooks disable WEBHOOK_ID - — Enable a disabled webhook.
hf webhooks enable WEBHOOK_ID - — Show full details for a single webhook as JSON.
hf webhooks info WEBHOOK_ID - — List all webhooks for the current user.
hf webhooks list - — Update an existing webhook. Only provided options are changed.
hf webhooks update WEBHOOK_ID
- — 创建新的webhook。
hf webhooks create watch - — 永久删除webhook。
hf webhooks delete WEBHOOK_ID - — 禁用活跃的webhook。
hf webhooks disable WEBHOOK_ID - — 启用已禁用的webhook。
hf webhooks enable WEBHOOK_ID - — 以JSON格式展示单个webhook的完整详情。
hf webhooks info WEBHOOK_ID - — 列出当前用户的所有webhooks。
hf webhooks list - — 更新现有webhook,仅修改指定的选项。
hf webhooks update WEBHOOK_ID
Tips
提示
- Use for full options, usage, and real-world examples
hf <command> --help - Use for machine-readable output on list commands
--format json - Use /
-qto print only IDs--quiet - Authenticate with env var (recommended) or with
HF_TOKEN--token
- 执行查看完整的选项、用法和实际案例
hf <command> --help - 列表类命令可使用获取机器可读的输出
--format json - 使用/
-q仅打印ID--quiet - 推荐通过环境变量进行身份验证,也可使用
HF_TOKEN参数--token