Pixi Global#
With pixi global, users can manage globally installed tools in a way that makes them available from any directory.
This means that the Pixi environment will be placed in a global location, and the tools will be exposed to the system PATH, allowing you to run them from the command line.
Some packages, especially those with graphical user interfaces, will also add start menu entries.
Basic Usage#
Running the following command installs rattler-build on your system.
What's great about pixi global is that, by default, it isolates each package in its own environment, exposing only the necessary entry points.
This means you don't have to worry about removing a package and accidentally breaking seemingly unrelated packages.
This behavior is quite similar to that of pipx.
However, there are times when you may want multiple dependencies in the same environment.
For instance, while ipython is really useful on its own, it becomes much more useful when numpy and matplotlib are available when using it.
Let's execute the following command:
numpy exposes executables, but since it's added via --with it's executables are not being exposed.
Importing numpy and matplotlib now works as expected.
At some point, you might want to install multiple versions of the same package on your system.
Since they will be all available on the system PATH, they need to be exposed under different names.
Let's check out the following command:
By specifying --expose we specified that we want to expose the executable python under the name py3.
The package python has more executables, but since we specified --exposed they are not auto-exposed.
You can run py3 to start the python interpreter.
Shell Completions#
When you work in a terminal, you are using a shell and shells can process completions of command line tools.
The process works like this: you type "git -" in your terminal and press <TAB>.
Then, your shell will present you all the flags git offers.
However, that only works if you have the completions installed for the tool in question.
If the tool you installed via pixi global contains completions they will be automatically installed.
At the moment, only Linux and macOS are supported.
First install a tool with pixi global:
The completions can be found under $PIXI_HOME/completions.
You can then load the completions in the startup script of your shell:
Note
Completions of packages are installed as long as their binaries are exposed under the same name: e.g. exposed = { git = "git" }.