Skip to main content
Generate shell completion scripts.

Usage

Description

The pixi 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 --environment flag
  • Package names for various commands

Options

enum
required
The shell to generate completions for.Supported shells:
  • bash - Bourne Again SHell
  • zsh - Z Shell
  • fish - Friendly Interactive SHell
  • powershell - PowerShell
  • elvish - Elvish shell
  • nushell - Nushell

Installation

Bash

Add to your ~/.bashrc:
Or install system-wide:

Zsh

Add to your ~/.zshrc:
Or install to a directory in your $fpath:
Make sure the completion directory is in your fpath before compinit:

Fish

Install to Fish completions directory:

PowerShell

Add to your PowerShell profile:
To find your profile location:

Nushell

Add to your Nushell config:
Then source it in your config.nu:

Elvish

Add to your ~/.elvish/rc.elv:

Features

Command Completion

Tab-complete pixi commands:

Task Completion

Tab-complete task names when using pixi 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

  1. Make sure you’ve sourced your shell config after installation:
  2. For zsh, ensure the completion directory is in your $fpath before compinit
  3. Check that the completion script was generated correctly:
Task completion requires:
  • Being inside a pixi workspace
  • Having a valid pixi.toml with tasks defined
  • The workspace being initialized (pixi install)
Try:
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.toml in real-time
  • Environment completion: Lists available environments from the workspace
  • Platform completion: Suggests valid platform identifiers
  • Path completion: Automatically completes file paths where appropriate
  • pixi run - Benefits from task name completion
  • pixi task - Task completion shows these tasks