Basic usage of Pixi#
Pixi can do alot of things, but it is designed to be simple to use. Let's go through the basic usage of Pixi.
Managing workspaces or projects#
pixi init
- create a new Pixi manifest in the current directorypixi add
- add a dependency to your manifestpixi remove
- remove a dependency from your manifestpixi update
- update dependencies in your manifestpixi upgrade
- upgrade the dependencies in your manifest to the latest versions, even if you pinned them to a specific versionpixi lock
- create or update the lockfile for your manifestpixi info
- show information about your workspacepixi run
- run a task defined in your manifest or any command in the current environmentpixi shell
- start a shell in the current environmentpixi list
- list all dependencies in the current environmentpixi tree
- show a tree of dependencies in the current environmentpixi clean
- remove the environment from your machine
Managing global installations#
Pixi can manage global installations of tools and environments. It installs the environments in a central location, so you can use them from anywhere.
pixi global install
- install a package into it's own environment in the global space.pixi global uninstall
- uninstall an environment from the global space.pixi global add
- add a package to an existing globally installed environment.pixi global sync
- sync the globally installed environments with the global manifest, describing all the environments you want to install.pixi global edit
- edit the global manifest.pixi global update
- update the global environmentspixi global list
- list all the installed environments
More information: Global Tools
Running one-off commands#
Pixi can run one-off commands in a specific environment.
pixi exec
- run a command in a temporary environment.pixi exec --spec
- run a command in a temporary environment, with a specific specification.
For example:
> pixi exec python -VV
Python 3.13.5 | packaged by conda-forge | (main, Jun 16 2025, 08:24:05) [Clang 18.1.8 ]
> pixi exec --spec "python=3.12" python -VV
Python 3.12.11 | packaged by conda-forge | (main, Jun 4 2025, 14:38:53) [Clang 18.1.8 ]
Multiple environments#
Pixi workspaces allow you to manage multiple environments. An environment is build out of one or multiple features.
pixi add --feature
- add a package to a featurepixi task add --feature
- add a task to a specific featurepixi workspace environment add
- add an environment to the workspacepixi run --environment
- run a command in a specific environmentpixi shell --environment
- activate a specific environmentpixi list --environment
- list the dependencies in a specific environment
More information: Multiple environments
Tasks#
Pixi can run cross-platform tasks using it's built-in task runner. This can be a predefined task or any normal executable.
pixi run
- Run a task or commandpixi task add
- Add a new task to the manifest
Tasks can have other tasks as dependencies. Here is an example of a more complex task usecase
[tasks]
build = "make build"
# using the toml table view
[tasks.test]
cmd = "pytest"
depends-on = ["build"]
Multi platform support#
Pixi supports multiple platforms out of the box. You can specify which platforms your workspace supports and Pixi will ensure that the dependencies are compatible with those platforms.
pixi add --platform
- add a package only to a specific platformpixi workspace platform add
- add a platform to the workspace that you want to support with your project
More information: Multi platform support
Utilities#
Pixi comes with a set of utilities to help you debug or manage your setup.
pixi info
- Show information about the current workspace, and the global setup.pixi config
- Show or edit the Pixi configuration.pixi tree
- Show a tree of dependencies in the current environment.pixi list
- List all dependencies in the current environment.pixi clean
- Remove the project environments from your machine.pixi help
- Show help for Pixi commands.pixi help <subcommand>
- Show help for a specific Pixi command.pixi auth
- Manage authentication for conda channels.pixi search
- Search for packages in the configured channels.pixi completion
- Generate shell completion scripts for Pixi commands.
Going further#
There is still much more that Pixi has to offer. Check out the topics on the sidebar on the left to learn more.
And don't forget to join our Discord to join our community of Pixi enthusiasts!