docs/integration/extensions/introduction.md
Pixi allows you to extend its functionality with various extensions.
When executing e.g. pixi diff, Pixi will search for the executable pixi-diff in your PATH and in your pixi global directories.
Then it will execute it by passing any additional arguments to it.
Pixi extensions are standalone executables that follow a simple naming convention: they must be named pixi-{command} where {command} is the name of the subcommand you want to add. When you run pixi {command}, Pixi will automatically discover and execute the corresponding pixi-{command} executable.
For example:
pixi diff → looks for pixi-diff executablepixi pack → looks for pixi-pack executablepixi deploy → looks for pixi-deploy executablePixi discovers extensions by searching for pixi-* executables in the following locations, in order:
Pixi searches all directories in your PATH environment variable for executables with the pixi- prefix.
pixi global DirectoriesPixi also searches in directories managed by pixi global, which allows for organized extension management without cluttering your system PATH.
When you run pixi --list, all discovered extensions are automatically listed alongside all built-in commands, making the commands easily discoverable.
pixi global (Recommended)The easiest way to install Pixi extensions is using pixi global install:
# Install a single extension
pixi global install pixi-pack
# Install multiple extensions at once
pixi global install pixi-pack pixi-diff
This approach has several advantages:
pixi global list and pixi global remove to manage extensionspixi --list with all the built-in commands, just like how Cargo handles itYou can also install extensions manually by placing the executable in any directory in your PATH:
# Download or build the extension
curl -L https://github.com/user/pixi-myext/releases/download/v1.0.0/pixi-myext -o pixi-myext
chmod +x pixi-myext
mv pixi-myext ~/.local/bin/
Choose a descriptive name: Your extension should be named pixi-{command} where {command} clearly describes its functionality.
Create the executable: Extensions can be written in any language (Rust, Python, shell scripts, etc.) as long as they produce an executable binary.
Handle arguments: Extensions receive all arguments passed after the command name.
#!/usr/bin/env python3
import sys
def main():
name = sys.argv[1] if len(sys.argv) > 1 else "World"
print(f"Hello, {name}!")
if __name__ == "__main__":
main()
Save this as pixi-hello, make it executable (chmod +x pixi-hello), and place it in your PATH.
Usage: pixi hello Alice outputs Hello, Alice!
clap (Rust) or argparse (Python) provide consistent behavior--help: Users expect this standard flagPixi includes intelligent command suggestions powered by string similarity. If you mistype a command name, Pixi will suggest the closest match from both built-in commands and available extensions:
$ pixi pck
error: unrecognized subcommand 'pck`
tip: a similar subcommand exists: 'pack'
This works for both built-in commands and any extensions you have installed, making extension discovery seamless.
pixi --list to see all available extensions