Skip to content

[CLI] Add space-specific options to hf repos create and hf repos duplicate#3888

Draft
Wauplin wants to merge 4 commits intomainfrom
cursor/space-options-cli
Draft

[CLI] Add space-specific options to hf repos create and hf repos duplicate#3888
Wauplin wants to merge 4 commits intomainfrom
cursor/space-options-cli

Conversation

@Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Mar 5, 2026

Add --hardware/--flavor, --storage, --sleep-time, -s/--secret, and -e/--env options to both hf repos create and hf repos duplicate CLI commands.

These options map to the existing space_hardware, space_storage, space_sleep_time, space_secrets, and space_variables parameters in the HfApi.create_repo() and HfApi.duplicate_repo() methods.

Secrets and env vars accept KEY=VALUE format or just KEY (reads value from local environment variable).

Follow-up to #3880 (review)

cursoragent and others added 2 commits March 5, 2026 15:09
…uplicate`

Add --hardware/--flavor, --storage, --sleep-time, -s/--secret, and
-e/--env options to both `hf repos create` and `hf repos duplicate`
CLI commands.

These options map to the existing space_hardware, space_storage,
space_sleep_time, space_secrets, and space_variables parameters in the
HfApi.create_repo() and HfApi.duplicate_repo() methods.

Secrets and env vars accept KEY=VALUE format or just KEY (reads value
from local environment variable).

Follow-up to #3880 (review)

Co-authored-by: Lucain <Wauplin@users.noreply.github.com>
Co-authored-by: Lucain <Wauplin@users.noreply.github.com>
@bot-ci-comment
Copy link

bot-ci-comment bot commented Mar 5, 2026

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.

cursoragent and others added 2 commits March 5, 2026 15:39
…bs CLI

- Move EnvOpt, SecretsOpt, EnvFileOpt, SecretsFileOpt type aliases to _cli_utils.py
- Move _get_extended_environ(), parse_env_map(), parse_secrets_map() to _cli_utils.py
- Add env_map_to_key_value_list() converter for Hub API format
- Update repos.py: use shared types and load_dotenv-based parsing (--secrets, -s)
  instead of custom _parse_key_value_pairs; add --env-file and --secrets-file
- Update jobs.py: replace 4x duplicated env/secrets parsing blocks with shared helpers
- Clean up unused imports (os, Path, Dict, get_token, load_dotenv) from jobs.py
- Update tests to patch _get_extended_environ at its new _cli_utils location

Co-authored-by: Lucain <Wauplin@users.noreply.github.com>
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