Quick Start
Define tasks in yourpixi.toml:
Task Dependencies
Tasks can depend on other tasks, creating complete pipelines:pixi run start:
- First
configureruns (no dependencies) - Then
buildruns (depends on configure) - Finally
startruns (depends on build)
Shorthand Syntax for Aliases
Create task aliases that run multiple tasks:Cross-Environment Dependencies
Run dependent tasks in different environments:Working Directory
Specify where a task runs usingcwd:
pixi.toml lives).
Default Environment
Set which environment runs a task by default:--environment flag:
Task Arguments
Make tasks reusable with arguments:Argument names cannot contain dashes (
-) - use underscores (_) or camelCase instead.Passing Extra Arguments
Use-- to pass additional flags to the command:
Arguments in Dependencies
Pass arguments to dependent tasks:MiniJinja Templating
Task commands support MiniJinja templating for dynamic values:Pixi Variables
Pixi automatically provides system variables in templates:
Example usage:
Templating only works for tasks defined in your manifest. Use
pixi run --templated for ad-hoc CLI commands.Task Names
Task naming rules:- No spaces allowed
- Must be unique
- Names starting with
_are hidden frompixi task list
Caching
Specifyinputs and outputs to cache task results:
- No packages in the environment have changed
- Input files haven’t changed (compared by fingerprint)
- Output files exist and haven’t been modified
- The command is the same
Template Variables in Inputs/Outputs
Environment Variables
Set environment variables for tasks:Values in
tasks.<name>.env are interpreted by the task shell, so shell expansions like env = { VAR = "$FOO" } work cross-platform.Clean Environment
Run tasks in an isolated environment with minimal variables:Task Runner: deno_task_shell
Pixi usesdeno_task_shell for cross-platform task execution. It’s a limited Bourne shell implementation that works on Windows, macOS, and Linux.
Built-in Commands
cp- Copy filesmv- Move filesrm- Remove files/directories (userm -rffor recursive)mkdir- Make directories (usemkdir -pfor parents)pwd- Print working directorysleep- Delay (e.g.,sleep 1,sleep 0.5,sleep 1m)echo- Display textcat- Concatenate and output filesexit- Exit shellunset- Unset environment variablesxargs- Build arguments from stdin
Syntax Features
Boolean lists:Real-World Example
Here’s a complete example from thecpp-sdl example project: