Skip to main content
Interact with tasks in the workspace. Tasks are commands that can be run with pixi run.

Usage

Subcommands

add

Add a new task to the workspace.
Alias: 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=value
string
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.
Aliases: 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.
Alias: 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.
Aliases: 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 in pixi.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:
Running pixi run build will execute: install-depstestbuild
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:
Run with: pixi run greet World
Task commands can use template variables like {{ pixi.platform }} when run with --templated.

Best Practices

  1. Use descriptive names: Choose clear, meaningful task names
  2. Add descriptions: Help others understand what each task does
  3. Leverage dependencies: Chain tasks together with depends-on
  4. Keep tasks simple: Break complex operations into multiple tasks
  5. Use environment variables: Make tasks configurable with env vars