{
  "slug": "hf-cp-copies-files-among-local-paths-hub-repos-and-buckets-bd2e3c614c5c",
  "title": "hf cp copies files among local paths, Hub repos, and buckets",
  "tools": [
    "hf"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-06-05T09:26:33.000Z",
  "announced_at": "2026-06-05T09:26:33.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When copying a file between a local path and Hub storage, or between supported Hub locations, use `hf cp` with the source and destination paths. Use `-` for stdin or stdout; for Hub folder copies, a trailing `/` on the source copies its contents.",
    "examples": [
      "hf cp ./model.safetensors hf://username/my-model/model.safetensors",
      "hf cp hf://username/my-model/config.json - | jq .",
      "hf cp hf://username/source-model/config.json hf://username/dest-model/config.json"
    ],
    "gotchas": [
      "Version: v1.18.0",
      "SRC (required): Source: local file, `hf://` URI for a repo or bucket, or `-` for stdin.",
      "DST: Destination: local path, `hf://` URI for a repo or bucket, or `-` for stdout.",
      "--token TEXT: User Access Token; docs identify token generation at Hugging Face settings.",
      "trailing `/` on Hub source path: For Hub folder copies, copies the folder contents rather than nesting the folder itself.",
      "`-` as SRC or DST: Use `-` as source for stdin or destination for stdout.",
      "Remote-to-remote copies only work within the same storage region.",
      "Bucket-to-repo copies are not yet supported.",
      "Docs conflict: Current docs specify `hf cp` copies a single file when a local path is involved; whole local directories require `hf upload`/`hf download` for repos or `hf buckets sync` for buckets. The release note describes trailing-slash folder-content semantics without this local-path limitation."
    ]
  },
  "why_it_matters": "When copying files between a local workspace and Hub storage, or between remote locations, use the unified copy command with the applicable source and destination.",
  "sources": [
    "https://github.com/huggingface/huggingface_hub/releases/tag/v1.18.0",
    "https://huggingface.co/docs/huggingface_hub/v1.20.1/en/guides/cli",
    "https://github.com/huggingface/huggingface_hub/blob/main/docs/source/en/package_reference/cli.md"
  ],
  "rank": 0.98048,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "wave2b-20261017",
    "verdict_id": "wave2b-20261017:wave2b-20261017-833518322073c981-0:gate",
    "evidence_hash": "784beb829c599a04a8c0fbe013b18b5af06b14c45e6667e2eab0bfd798d61b95"
  },
  "review": {
    "draft_hash": "6a11d0b1c0102fc517d0d316e6dc4f4677a82335daed74d525e6b5abf4c686bf",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave2b-20261017:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.98 >= 0.9; 2 needed) and Jev gave 0.76 (>= 0.6 needed)."
  }
}
