Skip to content

Conversation

@kajal-jotwani
Copy link

@kajal-jotwani kajal-jotwani commented Jan 9, 2026

Description

Adds a --executable (-x) flag to pixi run to allow running executables even when a task with the same name exists.

Fixes #5128

How Has This Been Tested?

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.

Tools: {e.g., Claude, Codex, GitHub Copilot, ChatGPT, etc.}

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added sufficient tests to cover my changes.
  • I have verified that changes that would impact the JSON schema have been made in schema/model.py.

.or(Some(Platform::current())),
);
let task_graph = TaskGraph::from_cmd_args(&project, &search_env, args.task, false)
let task_graph = TaskGraph::from_cmd_args(&project, &search_env, args.task, false, false)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a bit of an anti-pattern. If we have multiple booleans as arguments it becomes hard to distinguish what the false indicates. Instead its good practice to introduce an enum. E.g. PreferExecutable with variants like Always, Never, IfNoTask or something along those lines.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the suggestion! I've updated the implementation to use a PreferExecutable enum with Never and Always variants instead of bool. I didn't include an IfNoTask variant since that behavior is already the default when using PreferExecutable::Never the code naturally falls back to executing the command when no matching task is found.

@kajal-jotwani kajal-jotwani force-pushed the feat/run-executable-flag branch from e036167 to 93a8394 Compare January 16, 2026 20:20
@kajal-jotwani kajal-jotwani force-pushed the feat/run-executable-flag branch from 93a8394 to b267802 Compare January 16, 2026 20:31
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.

For pixi run to use executable instead of task with --executable

2 participants