{
  "id": "hf",
  "name": "Hugging Face Hub CLI",
  "homepage": "https://huggingface.co/docs/huggingface_hub/guides/cli",
  "description": "The Hugging Face Hub CLI.",
  "icon": "SimpleIcons:huggingface",
  "executables": [
    "hf"
  ],
  "dotfiles": {
    "paths": [],
    "secret": [
      "~/.cache/huggingface/token",
      "~/.cache/huggingface/stored_tokens"
    ],
    "side_effect": false
  },
  "commands": {
    "format": 1,
    "label": "Hugging Face Hub CLI",
    "description": "Download files or whole repositories from the Hub with hf download. Other hf commands and hf:// URIs are left out.",
    "quality": "ai-draft",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": true,
      "short_bundles": false
    },
    "subcommand": [
      {
        "path": [
          "download"
        ],
        "label": "Download from the Hub",
        "description": "Download a model, dataset or Space, or only some of its files, into the cache or a local folder.",
        "source": [
          {
            "id": "docs",
            "kind": "manual",
            "url": "https://huggingface.co/docs/huggingface_hub/guides/cli",
            "revision": "2026-10-27",
            "evidence": ">>> hf download gpt2 config.json model.safetensors\n>>> hf download stabilityai/stable-diffusion-xl-base-1.0 --include \"*.safetensors\" --exclude \"*.fp16.*\"*\n>>> hf download HuggingFaceH4/ultrachat_200k --repo-type dataset\n>>> hf download bigcode/the-stack --repo-type dataset --revision v1.1\n>>> hf download adept/fuyu-8b model-00001-of-00002.safetensors --local-dir fuyu\n>>> hf download openai-community/gpt2 --dry-run\n>>> hf download adept/fuyu-8b --cache-dir ./path/to/cache"
          }
        ],
        "field": [
          {
            "id": "repo_id",
            "label": "Repository ID",
            "description": "For example gpt2 or HuggingFaceH4/zephyr-7b-beta.",
            "type": "string",
            "position": 0,
            "sources": [
              "docs"
            ]
          },
          {
            "id": "filenames",
            "label": "Files",
            "description": "Specific files in the repo; leave empty for the whole repository.",
            "type": "string",
            "position": 1,
            "multiple": true,
            "min": 0,
            "sources": [
              "docs"
            ]
          },
          {
            "id": "repo_type",
            "label": "Repository type",
            "type": "string",
            "option": [
              "--repo-type"
            ],
            "suggestions": [
              {
                "value": "model",
                "label": "Model"
              },
              {
                "value": "dataset",
                "label": "Dataset"
              },
              {
                "value": "space",
                "label": "Space"
              }
            ],
            "sources": [
              "docs"
            ]
          },
          {
            "id": "revision",
            "label": "Revision",
            "description": "Commit hash, branch name or tag.",
            "type": "string",
            "option": [
              "--revision"
            ],
            "sources": [
              "docs"
            ]
          },
          {
            "id": "include",
            "label": "Include pattern",
            "type": "string",
            "option": [
              "--include"
            ],
            "multiple": true,
            "sources": [
              "docs"
            ]
          },
          {
            "id": "exclude",
            "label": "Exclude pattern",
            "type": "string",
            "option": [
              "--exclude"
            ],
            "multiple": true,
            "sources": [
              "docs"
            ]
          },
          {
            "id": "local_dir",
            "label": "Local folder",
            "type": "path",
            "option": [
              "--local-dir"
            ],
            "path": {
              "kind": "directory",
              "role": "output"
            },
            "sources": [
              "docs"
            ]
          },
          {
            "id": "cache_dir",
            "label": "Cache directory",
            "type": "path",
            "option": [
              "--cache-dir"
            ],
            "path": {
              "kind": "directory",
              "role": "output"
            },
            "sources": [
              "docs"
            ]
          },
          {
            "id": "dry_run",
            "label": "Dry run",
            "description": "List the files that would be downloaded without downloading.",
            "type": "boolean",
            "option": [
              "--dry-run"
            ],
            "sources": [
              "docs"
            ]
          }
        ],
        "task": [
          {
            "id": "repo",
            "label": "Download a repository",
            "fields": [
              "repo_id",
              "repo_type",
              "revision",
              "local_dir"
            ],
            "required": [
              "repo_id"
            ]
          },
          {
            "id": "files",
            "label": "Download selected files",
            "fields": [
              "repo_id",
              "filenames",
              "include",
              "exclude",
              "local_dir"
            ],
            "required": [
              "repo_id"
            ]
          },
          {
            "id": "preview",
            "label": "Preview a download",
            "fields": [
              "repo_id",
              "repo_type",
              "dry_run"
            ],
            "required": [
              "repo_id"
            ],
            "set": {
              "dry_run": [
                true
              ]
            }
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "repo_id",
              "filenames",
              "repo_type",
              "revision",
              "local_dir",
              "dry_run"
            ]
          },
          {
            "id": "advanced",
            "label": "Advanced",
            "fields": [
              "include",
              "exclude",
              "cache_dir"
            ]
          }
        ]
      }
    ]
  }
}
