Skip to content

[CLI] Accept web URLs in bucket CLI commands#4315

Merged
Wauplin merged 1 commit into
mainfrom
buckets-accept-web-urls
Jun 9, 2026
Merged

[CLI] Accept web URLs in bucket CLI commands#4315
Wauplin merged 1 commit into
mainfrom
buckets-accept-web-urls

Conversation

@Wauplin

@Wauplin Wauplin commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Related to #4296.
Forgot to update _parse_bucket_uri to also accept URLs copy-pasted from the browser in addition to hf:// URIs and plain namespace/name paths.

Example:

hf buckets ls https://huggingface.co/buckets/commoncrawl/commoncrawl

(previously: Error: Invalid bucket path ... Expected format: namespace/bucket_name)


Note

Low Risk
Small, localized parser change reusing existing parse_hf_uri URL handling; behavior for non-URL paths is unchanged.

Overview
Bucket path parsing now treats copy-pasted https://huggingface.co/buckets/... links like existing hf://buckets/... URIs by routing them through parse_hf_uri when _looks_like_hf_url matches, instead of failing as plain namespace/name paths.

Docstrings for _parse_bucket_uri document the new accepted form. A CLI test asserts hf buckets list with a web URL produces the same recursive listing as the hf:// form.

Reviewed by Cursor Bugbot for commit 4d2ea8b. Bugbot is set up for automated code reviews on this repo. Configure here.

Make _parse_bucket_uri accept Hugging Face web URLs (e.g.
https://huggingface.co/buckets/namespace/name) in addition to hf://
URIs and plain namespace/name paths, leveraging URL parsing from #4296.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Wauplin Wauplin changed the title [Buckets] Accept web URLs in bucket CLI commands [CLI] Accept web URLs in bucket CLI commands Jun 5, 2026
@Wauplin Wauplin requested a review from hanouticelina June 5, 2026 11:57
@bot-ci-comment

bot-ci-comment Bot commented Jun 5, 2026

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@hanouticelina hanouticelina left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Wauplin Wauplin merged commit 94363a6 into main Jun 9, 2026
23 of 26 checks passed
@Wauplin Wauplin deleted the buckets-accept-web-urls branch June 9, 2026 13:03
@huggingface-hub-bot

Copy link
Copy Markdown
Contributor

This PR has been shipped as part of the v1.19.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants