pixi run.
Usage
Subcommands
add
Add a new task to the workspace.pixi task a
Arguments
Task name.
One or more commands to execute.
Options
Tasks that this task depends on. Multiple dependencies can be specified.
The platform for which the task should be added.
The feature for which the task should be added.
The working directory relative to the root of the workspace.
Environment variables to set. Use multiple times for multiple variables.Example:
--env KEY=valueAdd a default environment for the task.
A description of the task.
Isolate the task from the shell environment, only using the pixi environment.
Arguments to pass to the task. Can be specified multiple times.
Examples
remove
Remove a task from the workspace.pixi task rm
Arguments
Task name(s) to remove. Multiple task names can be specified.
Options
The platform for which the task should be removed.
The feature for which the task should be removed.
Examples
alias
Create an alias for other tasks.pixi task @
Arguments
The alias name.
Tasks that this alias depends on (the tasks to execute).
Options
The platform for which the alias should be added.
The description of the alias task.
Examples
list
List all tasks in the workspace.pixi task ls, pixi task l
Options
Show tasks available for this machine per environment.
The environment for which tasks should be listed. If not specified, the default environment is used.
Output the list of tasks as JSON instead of a tree.
Examples
Task Configuration
Tasks can be configured with various options inpixi.toml:
Task Types
Plain Tasks
Simple command strings:Complex Tasks
Tasks with additional configuration:Alias Tasks
Tasks that run other tasks:Task Execution Order
When a task has dependencies, pixi executes them in topological order:pixi run build will execute: install-deps → test → build
Use
pixi run --skip-deps to skip running task dependencies.Platform-Specific Tasks
You can define tasks that only run on specific platforms:Task Arguments
Tasks can accept arguments:pixi run greet World
Best Practices
- Use descriptive names: Choose clear, meaningful task names
- Add descriptions: Help others understand what each task does
- Leverage dependencies: Chain tasks together with
depends-on - Keep tasks simple: Break complex operations into multiple tasks
- Use environment variables: Make tasks configurable with env vars