Usage
Description
Thepixi completion command generates shell completion scripts that provide tab-completion for pixi commands, options, and arguments. The completion script includes smart completions for:
- Task names when using
pixi run - Environment names for
--environmentflag - Package names for various commands
Options
The shell to generate completions for.Supported shells:
bash- Bourne Again SHellzsh- Z Shellfish- Friendly Interactive SHellpowershell- PowerShellelvish- Elvish shellnushell- Nushell
Installation
Bash
Add to your~/.bashrc:
Zsh
Add to your~/.zshrc:
$fpath:
fpath before compinit:
Fish
Install to Fish completions directory:PowerShell
Add to your PowerShell profile:Nushell
Add to your Nushell config:config.nu:
Elvish
Add to your~/.elvish/rc.elv:
Features
Command Completion
Tab-complete pixi commands:Task Completion
Tab-complete task names when usingpixi run:
Environment Completion
Tab-complete environment names:Option Completion
Tab-complete command options:Examples
Generate bash completions
Install bash completions
Install zsh completions
Install fish completions
Troubleshooting
Completions not working
Completions not working
-
Make sure you’ve sourced your shell config after installation:
-
For zsh, ensure the completion directory is in your
$fpathbefore compinit -
Check that the completion script was generated correctly:
Task completion not showing tasks
Task completion not showing tasks
Task completion requires:
- Being inside a pixi workspace
- Having a valid
pixi.tomlwith tasks defined - The workspace being initialized (
pixi install)
Zsh: command not found: compdef
Zsh: command not found: compdef
Make sure you have compinit loaded in your
.zshrc:Implementation Details
The completion script provides intelligent context-aware completions:- Dynamic task completion: Reads tasks from
pixi.tomlin real-time - Environment completion: Lists available environments from the workspace
- Platform completion: Suggests valid platform identifiers
- Path completion: Automatically completes file paths where appropriate