Usage
Options
Sets the shell for which to generate the activation script.Options:
bash, zsh, xonsh, cmd, powershell, fish, nushellIf not specified, pixi will auto-detect the shell from the parent process or environment.The path to the
pixi.toml or pyproject.toml file.Install the environment as defined in the lockfile, without updating it.
Check if the lockfile is up-to-date before installing the environment. Errors if the lockfile is out-of-date.
The environment to activate in the script.
Emit the environment variables set by running the activation as JSON.This option is mutually exclusive with
--shell.Don’t install the environment, only generate the activation script.
Include prompt modification in the activation script (can be configured in the global config).
Examples
Print activation script for current shell
Print activation script for a specific shell
Source the activation script
Get environment variables as JSON
Activate environment in a specific shell
Use Cases
CI/CD Integration
Activate pixi environments in CI without keeping pixi in the PATH:Custom Shell Integration
Integrate pixi activation into your shell’s RC file:Docker Containers
Activate environments in Docker without keeping the pixi binary:Environment Variable Inspection
Inspect what environment variables pixi sets:Supported Shells
The command generates activation scripts for:- bash - Bourne Again Shell
- zsh - Z Shell
- fish - Friendly Interactive Shell
- xonsh - Python-powered shell
- powershell - PowerShell (Windows/Unix)
- cmd - Windows Command Prompt
- nushell - A new type of shell
If
--shell is not specified, pixi will attempt to detect your shell from the parent process or environment variables.JSON Output Format
When using--json, the output contains:
- Parsing in scripts
- IDE integrations
- Debugging environment setups
Differences from pixi shell
pixi shell-hookprints the activation scriptpixi shellexecutes an interactive shell- Both activate the same environment
shell-hookis useful for integration scenarios where you need the raw activation commands