pixi run.
Usage
Subcommands
add
Add a new task to the workspace.pixi task a
Arguments
string
required
Task name.
string
required
One or more commands to execute.
Options
string
Tasks that this task depends on. Multiple dependencies can be specified.
string
The platform for which the task should be added.
string
The feature for which the task should be added.
path
The working directory relative to the root of the workspace.
key=value
Environment variables to set. Use multiple times for multiple variables.Example:
--env KEY=valuestring
Add a default environment for the task.
string
A description of the task.
boolean
Isolate the task from the shell environment, only using the pixi environment.
string
Arguments to pass to the task. Can be specified multiple times.
Examples
remove
Remove a task from the workspace.pixi task rm
Arguments
string
required
Task name(s) to remove. Multiple task names can be specified.
Options
string
The platform for which the task should be removed.
string
The feature for which the task should be removed.
Examples
alias
Create an alias for other tasks.pixi task @
Arguments
string
required
The alias name.
string
required
Tasks that this alias depends on (the tasks to execute).
Options
string
The platform for which the alias should be added.
string
The description of the alias task.
Examples
list
List all tasks in the workspace.pixi task ls, pixi task l
Options
boolean
Show tasks available for this machine per environment.
string
The environment for which tasks should be listed. If not specified, the default environment is used.
boolean
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