Skip to content

Conversation

@Incharajayaram
Copy link

Description

This PR unifies the output format of pixi run (when called without arguments) and pixi task list commands to provide a consistent user experience.

Before:
When running pixi run without arguments, users would see a simple list:

Available tasks:
        build-linux
        build-osx
        cran

After:
Now pixi run shows the same detailed output as pixi task list:

Tasks that can run on this machine:
-----------------------------------
build-linux, build-osx, cran, cran-v0, lint, pypi, pypi-v0

Task         Description
build-linux  build for Linux inside a docker container
build-osx    build directly on a MacOS host machine
cran         generate a v1 (rattler-build) recipe for a CRAN package name with `grayskull`

Changes Made:

  • Modified the command_not_found() function in crates/pixi_cli/src/run.rs to use the print_tasks() function, which provides detailed task information including descriptions
  • This function is called both when pixi run is executed without arguments and when a task is not found (exit code 127)

Fixes #5276

How Has This Been Tested?

Tested by running the following commands in a workspace with defined tasks:

# Build the project
cargo build -p pixi

# Test unified output
./target/release/pixi run

# Compare with task list (should now match)
./target/release/pixi task list

Both commands now display the same formatted output with task names and descriptions.

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.

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.

@baszalmstra
Copy link
Contributor

This was already implemented in #5318, although not yet merged, this implementation was there first, so I'll first check if we can merge that.

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.

Unify pixi task list and pixi run outputs

2 participants