Skip to content

feat(tasks): support aliases in pixi.toml task definitions - #6605

Open
Aditya7880900936 wants to merge 3 commits into
prefix-dev:mainfrom
Aditya7880900936:feat-6504-task-alias-key
Open

feat(tasks): support aliases in pixi.toml task definitions#6605
Aditya7880900936 wants to merge 3 commits into
prefix-dev:mainfrom
Aditya7880900936:feat-6504-task-alias-key

Conversation

@Aditya7880900936

@Aditya7880900936 Aditya7880900936 commented Jul 14, 2026

Copy link
Copy Markdown

Summary

Closes #6504

This PR adds support for defining task aliases directly in pixi.toml.

Instead of creating a separate alias task:

[tasks]
docker-start = { cmd = "docker compose up --build -d" }
ds = [{ task = "docker-start" }]

users can now write:

[tasks]
docker-start = { cmd = "docker compose up --build -d", alias = "ds" }

The alias can be used anywhere a task name is accepted:

pixi run ds

while pixi task list continues to display only the original task, avoiding additional alias entries.

Implementation

  • Added an optional alias field to executable task definitions.
  • Extended TOML parsing and serialization to support the new key.
  • Updated task resolution to fall back to matching task aliases when an exact task name is not found.
  • Added parser coverage and updated snapshots for the new alias key.

Validation

  • cargo check
  • cargo test -p pixi_manifest
  • cargo test -p pixi_core
  • Manual verification:
    • pixi run ds
    • pixi task list

@hunger

hunger commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution, but I think you are missing a few bits and pieces still:

pixi run -e something ds does not seem to work for me.

You also seem to be missing error handling: What e.g. happens when you reuse a task name as another tasks alias?

it would be wonderful if you could add tests that trigger the above error conditions and then proceed to fix the issues. That will also build up test coverage and help catch more errors.

@Aditya7880900936

This comment was marked as low quality.

Aditya7880900936 added 3 commits July 17, 2026 02:39
Signed-off-by: Aditya7880900936 <adityasanskarsrivastav788@gmail.com>
Signed-off-by: Aditya7880900936 <adityasanskarsrivastav788@gmail.com>
Signed-off-by: Aditya7880900936 <adityasanskarsrivastav788@gmail.com>

hunger commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Sorry, I was on vacation… I'll take another look ASAP.

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.

alias key in pixi.toml task definition

2 participants