hf CLI accepts Hugging Face web URLs
Introduced 2026-06-05 · score 0.97
HOW TO USE IT
When a Hub file is identified by a Hugging Face web URL, pass that URL to `parse_hf_uri` or use it as `SRC` in `hf cp` to read the file.
from huggingface_hub import parse_hf_uri
uri = parse_hf_uri("https://huggingface.co/datasets/<namespace>/<name>/blob/<revision>/<path>")hf cp https://huggingface.co/nvidia/LocateAnything-3B/blob/main/config.json - | jq '.architectures'WHY THIS HELPS
When reading a Hub file during repository work, pass its Hugging Face web URL directly to the CLI or library parser.
REQUIREMENTS AND LIMITATIONS
- Version: v1.18.0
- parse_hf_uri(uri) — `uri` (required): HF URI or Hugging Face URL to parse; returns an `HfUri`.
- parse_hf_uri(uri, endpoint=...) — `endpoint`: Custom Hub base URL; recognizes web URLs on that endpoint.
- hf cp — `SRC` (required): Source file; docs list local files, `hf://` URIs, or `-` for stdin. Release-note example uses a Hugging Face web URL.
- hf cp — `[DST]`: Destination path or `-` for stdout.
- hf cp — `--token TEXT`: User Access Token.
FIRST-PARTY EVIDENCE
- https://github.com/huggingface/huggingface_hub/releases/tag/v1.18.0
- https://github.com/huggingface/huggingface_hub/blob/v1.18.0/docs/source/en/package_reference/hf_uris.md
- https://github.com/huggingface/huggingface_hub/blob/v1.18.0/docs/source/en/package_reference/cli.md
Check the installed version and the source before using it. Entry JSON