pypi huggingface-hub 1.17.0
[v1.17.0] Cross-repo copies, ssh to Spaces, smarter CLI tables

7 hours ago

📋 Copy files between repositories

You can now copy files or entire folders between different repositories on the Hub — model to model, model to dataset, any combination — without downloading or re-uploading data. CommitOperationCopy accepts src_repo_id and src_repo_type for cross-repo sources, and LFS blobs are deduplicated server-side via the /lfs-files/duplicate endpoint. Non-LFS files are fetched from the source repo and committed as regular payloads. copy_files and hf buckets cp now support repo-to-repo in addition to the existing bucket destinations.

>>> from huggingface_hub import copy_files

# Copy an entire folder
>>> copy_files(
...     "hf://datasets/username/source-dataset/data/",
...     "hf://datasets/username/target-dataset/data/",
... )

📚 Documentation: Upload guide — Copy files between repositories

🖥️ SSH into a Space with hf spaces ssh

A new hf spaces ssh command opens an SSH session directly into a Space's Dev Mode container. If Dev Mode is not enabled yet, the CLI prompts you to enable it. You can also use --dry-run to print the SSH command without running it, or -i to forward a specific key. Your SSH public key must be registered in your HF user settings.

# SSH into a Space
$ hf spaces ssh username/my-space

# Print the SSH command without running it
$ hf spaces ssh username/my-space --dry-run

📚 Documentation: CLI guide — SSH into a Space | Spaces guide — SSH into a Space

📂 List all your repos with hf repos ls

A new hf repos ls command lists all your repositories — models, datasets, spaces, and buckets — with storage size and percentage of namespace total, sorted by storage usage. It supports --type, --search, --namespace, and --limit (default 30, --limit 0 for all), plus the standard --format family.

# List all your repos
$ hf repos ls

# List all datasets under org with JSON output
$ hf repos ls --namespace my-org --type dataset --limit 0 --format json | jq '.[].id'

📚 Documentation: CLI guide — List repos | Repository guide — List your repositories

📊 CLI tables auto-fit terminal width and right-align numbers

Human-mode CLI tables now use a column-aware algorithm that computes per-column width caps from the actual terminal width, shrinking only the widest columns when needed. Non-TTY output keeps the legacy fixed cap, and --no-truncate bypasses truncation entirely. Numeric columns (all int/float values) are automatically right-aligned.

# Tables adapt to your terminal width
$ hf models ls --search qwen3

# Force full values regardless of width
$ hf models ls --no-truncate

📚 Documentation: CLI guide — Output formatting

🔧 Jobs hardware decoupled from Spaces, auto-synced with Hub API

Jobs now have their own JobHardware enum, independent of SpaceHardware, so the two catalogs can diverge as needed. The old JobHardware dataclass (return type of list_jobs_hardware()) has been renamed to JobHardwareInfo. CLI --flavor / --hardware flags use a new SoftChoice type that shows known values for autocomplete but accepts any string — older CLI versions won't reject new server-side flavors. A daily CI workflow (update-hardware-flavors.yaml) runs utils/check_hardware_flavors.py to sync both enums from the live Hub API and opens a bot PR when something changes.

# Unknown flavors pass through instead of raising a validation error
$ hf jobs run --flavor future-gpu-x99 python:3.12 echo "works with unknown flavors"
  • [Jobs] Decouple Job hardware from Spaces, auto-sync enums with Hub API by @Wauplin in #4266

📚 Documentation: Jobs guide

💔 Breaking Change

Note: The second item changes hf jobs ps and hf jobs scheduled ps to use --format auto|human|agent|json|quiet (removing --format table and -q). JSON output for hf jobs ps now flattens command to a string and status to a stage string.

🖥️ CLI

  • [CLI] Migrate extensions, lfs-enable-largefiles, version to out singleton by @hanouticelina in #4284
  • [CLI] Fix parent aliases leaking into subcommand headers in CLI reference by @Wauplin in #4253

📊 Jobs

📚 Documentation: Jobs guide — Update labels | Jobs guide — Hardware

🔧 Other QoL Improvements

  • Fix failing on read-only file system even if the non-existence of file is already cached by @ydshieh in #4274
  • [CLI] Add click as an explicit dependency (typer 0.26.0 fix) by @hanouticelina in #4270

📖 Documentation

  • [Docs] Document missing parameters in lfs, hf_file_system, and repocard_data by @kratos0718 in #4289

🐛 Bug and typo fixes

🏗️ Internal

  • Post-release: bump version to 1.17.0.dev0 by @huggingface-hub-bot[bot] in #4247
  • ci(release): migrate PyPI publish to Trusted Publishing + attestations by @XciD in #4249
  • [CI] Add import check with base dependencies only by @Wauplin in #4250
  • [Internal] Update style bot permissions by @hanouticelina in #4260
  • chore: enable Dependabot weekly GitHub Actions bumps by @hf-dependantbot-rollout[bot] in #4262
  • Bump actions in the actions group by @dependabot[bot] in #4263
  • chore: update release.yml by @hf-security-analysis[bot] in #4264
  • fix(release.yml): restore env: block on 'Detect version' step by @paulinebm in #4267
  • [Internal] Cap typer below 0.26.0 (CLI incompatibility) by @hanouticelina in #4272
  • [Internal] Run pinact (lock versions in workflow files) by @Wauplin in #4275
  • [Internal] Use Comment bot in model card gh action by @Wauplin in #4277
  • [CI] fix collection test by making its name unique by @Wauplin in #4279
  • Bump astral-sh/setup-uv from 7.6.0 to 8.1.0 in the actions group by @dependabot[bot] in #4281
  • [CLI] Drop legacy printing helpers from _cli_utils.py by @hanouticelina in #4285

Don't miss a new huggingface-hub release

NewReleases is sending notifications on new releases.