feat(run): support -- separator to pass extra args to typed-arg tasks#5569
Merged
ruben-arts merged 9 commits intoprefix-dev:mainfrom Mar 3, 2026
Merged
Conversation
When a task defines typed `args`, all CLI values are matched against
those definitions and any extras caused a `TooManyArguments` error.
This adds support for the standard `--` separator: everything after
`--` is forwarded verbatim to the underlying command, regardless of
the task's `args` definition.
pixi run pytest tests/unit -- -v --tb=short --maxfail=5
For tasks without typed args (FreeFormArgs), `--` is preserved and
passed through unchanged so programs that use `--` themselves
(e.g. `git log -- somefile`) continue to work.
Implementation:
- Add `ArgValues::TypedArgsWithExtra(Vec<TypedArg>, Vec<String>)` variant
to represent typed args combined with extra passthrough args
- Parse `--` separator in `TaskGraph::from_cmd_args` before arg resolution
- Update script generation in `ExecutableTask` to append extra args
- Add four unit tests covering the new behaviour
- Document the feature in the CLI reference and advanced tasks guide
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… task name or arg
Hofer-Julian
approved these changes
Mar 3, 2026
Contributor
Hofer-Julian
left a comment
There was a problem hiding this comment.
The docs weren't completely accurate and I found some small improvements in the code.
Looks great to me, awesome work Ruben!
9538a0a to
08725c6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Before we wouldn't be able to tell things to a task with args anymore, this PR would allow for users to use the
--to tell pixi to split it up and still allow the trailing args like normal. e.g.:pixi run test -- -v --tb=short --maxfail=5The logic is:
If the run command is a pixi task, split of the first
--and use everything behind that as trailing args.If the run command is not a pixi task, forward the
--to the command.Related: #4208
How Has This Been Tested?
Tested it locally.
AI Disclosure
Tools: Claude
Checklist:
schema/model.py.