Skip to content

Conversation

@lhoestq
Copy link
Member

@lhoestq lhoestq commented Dec 11, 2025

fix this error

>>> hf jobs run python:3.12 python -c 'print("Hello from the cloud!")'
Usage: hf jobs run [OPTIONS] IMAGE COMMAND...
Try 'hf jobs run --help' for help.

Error: No such option: -c

and

>>> hf jobs uv run python -c 'print("Hello from the cloud!")'
Usage: hf jobs uv run [OPTIONS] SCRIPT [SCRIPT_ARGS]...
Try 'hf jobs uv run --help' for help.

Error: No such option: -c

@lhoestq lhoestq requested a review from Wauplin December 11, 2025 15:22
@HuggingFaceDocBuilderDev

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.

@Wauplin
Copy link
Contributor

Wauplin commented Dec 11, 2025

We've recently got this PR to add a -- in all command lines in the documentation (see #3597)

➜  ~ hf jobs run python:3.12 -- python -c 'print("Hello from the cloud!")'
Job started with ID: 693ae3bcc67c9f186cfe2314
View at: https://huggingface.co/jobs/Wauplin/693ae3bcc67c9f186cfe2314
Hello from the cloud!

I think we should stick with this syntax that feels cleaner and explicitly tells that the rest of the command is an argument. WDYT ?

@lhoestq
Copy link
Member Author

lhoestq commented Dec 11, 2025

if we want to stick to the UV and Docker like CLI experience I think we should support commands without having to add -- (like UV and Docker)

(note that using -- still works with this change)

@lhoestq
Copy link
Member Author

lhoestq commented Dec 12, 2025

wdyt ? cc @davanstrien for viz as well

@davanstrien
Copy link
Member

No strong opinion. I also ran into this a few times. Maybe it's still a bit cleaner to rely on -- for very long commands so people don't accidentally pass things in the wrong place, i.e., script args vs. job args?

I found in general, coding agents (at least Claude) seemed to fairly quickly grasp the --.

It could make sense to use -- in the docs, but we could still add this?

@lhoestq
Copy link
Member Author

lhoestq commented Dec 12, 2025

UV docs mention

A -- can be used to separate the command from uv options for clarity, e.g., uv run --python 3.12 -- python

and in their examples they mostly use without -- except when it helps clarifying

uv run python -c "import example"

uv run --with httpx==0.26.0 python -c "import httpx; print(httpx.version)"

uv run --with nuitka==2.6.7 -- nuitka --version

Docker on their side never mention -- in their examples from what I can see, and in stackoverflow threads neither

edit: I added a mention of -- in the docs like UV

Copy link
Contributor

@Wauplin Wauplin left a comment

Choose a reason for hiding this comment

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

Thanks @lhoestq for this thread! Agree with you and @davanstrien that supporting both while only mentioning -- is a correct option. I'll merge this now then :)

@Wauplin Wauplin merged commit aac663f into main Dec 15, 2025
22 of 23 checks passed
@Wauplin Wauplin deleted the allow-unknown-options-in-jobs-typer-cli branch December 15, 2025 14:03
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.

4 participants