Conversation
Adds a `volumes` subcommand group under `hf spaces` to manage Space volumes from the CLI, wrapping `set_space_volumes` and `delete_space_volumes` API methods. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b46aa7b. Configure here.
|
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. |
| "hf spaces volumes ls username/my-space", | ||
| ], | ||
| ) | ||
| def volumes_ls( |
There was a problem hiding this comment.
this is not the exact equivalent of an API method but it feels necessary / good to have for the CLI
hanouticelina
left a comment
There was a problem hiding this comment.
only a small suggestion to re-write the to_hf_handle helper, otherwise looks good to me!
davanstrien
left a comment
There was a problem hiding this comment.
Thanks!
One small suggestion for a follow-up, the VolumesOpt help text in _cli_utils.py says "Mount a volume", which makes it less clear that you can pass multiple -v flags. Changing to "Mount one or more volumes" could make it obvious to humans and agents?
|
|
This PR has been shipped as part of the v1.11.0 release. |

Mentioned by @davanstrien in huggingface/hub-docs#2381 (comment).
Summary
Adds
hf spaces volumes ls/set/deleteto manage Space volumes from the CLI. Reuses the existing-v/--volumesyntax fromhf repos createandhf jobs run.Examples
🤖 Generated with Claude Code
Next I think we should also add commands for environment variables, secrets, sleep time and to request new hardware. If we agree on the syntax in this PR, adding the next ones should be straightforward.
Note
Medium Risk
Adds new CLI paths that can modify a Space’s mounted volumes (including destructive replace/delete), so mistakes could impact running Spaces but the change is largely additive and gated behind explicit user actions.
Overview
Adds a new
hf spaces volumesCLI group withls,set, anddeletecommands to manage Space volume mounts viaspace_info,set_space_volumes, anddelete_space_volumes, including confirmation prompting for deletes.Introduces
Volume.to_hf_handle()to round-trip volumes back into the CLIhf://...syntax for output, and updates docs (manage-spaces.mdand generatedcli.md) to document the new commands and examples.Reviewed by Cursor Bugbot for commit 8f2137d. Bugbot is set up for automated code reviews on this repo. Configure here.