{
  "slug": "hf-copy-files-and-hf-buckets-cp-copy-between-repositories-861d3ffa5b77",
  "title": "hf copy_files and hf buckets cp copy between repositories",
  "tools": [
    "hf"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-05-28T15:08:07.000Z",
  "announced_at": "2026-05-28T15:08:07.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When copying files or folders between Hub repositories, use `copy_files` with `hf://` source and destination URIs; use `hf buckets cp` for CLI repo-to-repo file copies. For direct `CommitOperationCopy` cross-repository sources, set `src_repo_id` and `src_repo_type` (required when `src_repo_id` is set).",
    "examples": [
      "from huggingface_hub import copy_files\n\ncopy_files(\n    \"hf://datasets/<owner>/<source-repo>/data/\",\n    \"hf://datasets/<owner>/<target-repo>/data/\",\n)",
      "hf buckets cp hf://<owner>/<source-repo>/config.json hf://<owner>/<target-repo>/config.json",
      "CommitOperationCopy(src_path_in_repo=\"<source-path>\", path_in_repo=\"<destination-path>\", src_repo_id=\"<owner>/<source-repo>\", src_repo_type=\"<model|dataset|space>\")"
    ],
    "gotchas": [
      "Version: v1.17.0",
      "source URI / `src_path_in_repo` (required): Source file or folder URI for `copy_files`; source repository path for `CommitOperationCopy`.",
      "destination URI / `path_in_repo` (required): Destination URI for `copy_files`; destination repository path for `CommitOperationCopy`.",
      "`src_repo_id`: Source repository ID; defaults to the destination repository. If set, `src_repo_type` is required.",
      "`src_repo_type`: Source repository type: `model`, `dataset`, or `space`; required when `src_repo_id` is set.",
      "`src_revision`: Revision to copy the source file from.",
      "CLI `SRC` and `DST` (required): The source and destination locations; each can be a local path, `hf://` URI, or `-` for stdin/stdout.",
      "Prerequisite: For Hub uploads, the docs say to log in to a Hugging Face account.",
      "Supports model-to-model, model-to-dataset, and other repository combinations.",
      "LFS blobs are deduplicated server-side; non-LFS files are fetched from the source repository and committed as regular payloads."
    ]
  },
  "why_it_matters": "Copy files or a folder between Hub repositories without downloading and re-uploading the data.",
  "sources": [
    "https://github.com/huggingface/huggingface_hub/releases/tag/v1.17.0",
    "https://huggingface.co/docs/huggingface_hub/v1.20.1/en/guides/upload",
    "https://github.com/huggingface/huggingface_hub/blob/main/docs/source/en/guides/cli.md?plain=1",
    "https://github.com/huggingface/huggingface_hub/blob/main/docs/source/en/guides/upload.md"
  ],
  "rank": 0.97046,
  "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-9ff1dd3f17704b87-0:gate",
    "evidence_hash": "bad0de8b817b1083289bad47ec823477fc61cc7daff55867454c52bf6dd77cad"
  },
  "review": {
    "draft_hash": "8a4cf4b622d4f1ed4f705339f61dd62aadcd5ca7cd0d68353dadd93bc6b7e22d",
    "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.97 >= 0.9; 2 needed) and Jev gave 0.74 (>= 0.6 needed)."
  }
}
