CLI
Global options#
--verbose (-v|vv|vvv)
Increase the verbosity of the output messages, the -v|vv|vvv increases the level of verbosity respectively.--help (-h)
Shows help information, use-h
to get the short version of the help.--version (-V)
: shows the version of pixi that is used.--quiet (-q)
: Decreases the amount of output.--color <COLOR>
: Whether the log needs to be colored [env:PIXI_COLOR=
] [default:auto
] [possible values:always
,never
,auto
]. Pixi also honors theFORCE_COLOR
andNO_COLOR
environment variables. They both take precedence over--color
andPIXI_COLOR
.--no-progress
: Disables the progress bar.[env:PIXI_NO_PROGRESS
] [default:false
]
init
#
This command is used to create a new project.
It initializes a pixi.toml
file and also prepares a .gitignore
to prevent the environment from being added to git
.
It also supports the pyproject.toml
file, if you have a pyproject.toml
file in the directory where you run pixi init
, it appends the pixi data to the pyproject.toml
instead of a new pixi.toml
file.
Arguments#
[PATH]
: Where to place the project (defaults to current path) [default:.
]
Options#
--channel <CHANNEL> (-c)
: specify a channel that the project uses. Defaults toconda-forge
. (Allowed to be used more than once)--platform <PLATFORM> (-p)
: specify a platform that the project supports. (Allowed to be used more than once)--import <ENV_FILE> (-i)
: Import an existing conda environment file, e.g.environment.yml
.--pyproject
: Create apyproject.toml
manifest, rather than apixi.toml
manifest. Recommended for a python project.
Importing an environment.yml
When importing an environment, the pixi.toml
will be created with the dependencies from the environment file.
The pixi.lock
will be created when you install the environment.
We don't support git+
urls as dependencies for pip packages and for the defaults
channel we use main
, r
and msys2
as the default channels.
pixi init myproject
pixi init ~/myproject
pixi init # Initializes directly in the current directory.
pixi init --channel conda-forge --channel bioconda myproject
pixi init --platform osx-64 --platform linux-64 myproject
pixi init --import environment.yml
add
#
Adds dependencies to the manifest file. It will only add if the package with its version constraint is able to work with rest of the dependencies in the project. More info on multi-platform configuration.
If the project manifest is a pyproject.toml
, adding a pypi dependency will add it to the native pyproject project.dependencies
array, or to the native project.optional-dependencies
table if a feature is specified:
- pixi add --pypi boto3
would add boto3
to the project.dependencies
array
- pixi add --pypi boto3 --feature aws
would add boto3
to the project.dependencies.aws
array
These dependencies will be read by pixi as if they had been added to the pixi pypi-dependencies
tables of the default or a named feature.
Arguments#
<SPECS>
: The package(s) to add, space separated. The version constraint is optional.
Options#
--manifest-path <MANIFEST_PATH>
: the path to manifest file, by default it searches for one in the parent directories.--host
: Specifies a host dependency, important for building a package.--build
: Specifies a build dependency, important for building a package.--pypi
: Specifies a PyPI dependency, not a conda package. Parses dependencies as PEP508 requirements, supporting extras and versions. See configuration for details.--no-install
: Don't install the package to the environment, only add the package to the lock-file.--no-lockfile-update
: Don't update the lock-file, implies the--no-install
flag.--platform <PLATFORM> (-p)
: The platform for which the dependency should be added. (Allowed to be used more than once)--feature <FEATURE> (-f)
: The feature for which the dependency should be added.
pixi add numpy
pixi add numpy pandas "pytorch>=1.8"
pixi add "numpy>=1.22,<1.24"
pixi add --manifest-path ~/myproject/pixi.toml numpy
pixi add --host "python>=3.9.0"
pixi add --build cmake
pixi add --pypi requests[security]
pixi add --pypi "boltons @ https://files.pythonhosted.org/packages/46/35/e50d4a115f93e2a3fbf52438435bb2efcf14c11d4fcd6bdcd77a6fc399c9/boltons-24.0.0-py3-none-any.whl"
pixi add --pypi "exchangelib @ git+https://github.com/ecederstrand/exchangelib"
pixi add --pypi "project @ file:///absolute/path/to/project"
pixi add --platform osx-64 --build clang
pixi add --no-install numpy
pixi add --no-lockfile-update numpy
pixi add --feature featurex numpy
Tip
If you want to use a non default pinning strategy, you can set it using pixi's configuration.
The default issemver
which will pin the dependencies to the latest major version or minor for v0
versions.
install
#
Installs an environment based on the manifest file.
If there is no pixi.lock
file or it is not up-to-date with the manifest file, it will (re-)generate the lock file.
pixi install
only installs one environment at a time, if you have multiple environments you can select the right one with the --environment
flag.
If you don't provide an environment, the default
environment will be installed.
Running pixi install
is not required before running other commands.
As all commands interacting with the environment will first run the install
command if the environment is not ready, to make sure you always run in a correct state.
E.g. pixi run
, pixi shell
, pixi shell-hook
, pixi add
, pixi remove
to name a few.
Options#
--manifest-path <MANIFEST_PATH>
: the path to manifest file, by default it searches for one in the parent directories.--frozen
: install the environment as defined in the lock file, doesn't updatepixi.lock
if it isn't up-to-date with manifest file. It can also be controlled by thePIXI_FROZEN
environment variable (example:PIXI_FROZEN=true
).--locked
: only install if thepixi.lock
is up-to-date with the manifest file1. It can also be controlled by thePIXI_LOCKED
environment variable (example:PIXI_LOCKED=true
). Conflicts with--frozen
.--environment <ENVIRONMENT> (-e)
: The environment to install, if none are provided the default environment will be used.
pixi install
pixi install --manifest-path ~/myproject/pixi.toml
pixi install --frozen
pixi install --locked
pixi install --environment lint
pixi install -e lint
To reinitialize the lock file in your project, you can remove the existing pixi.lock
file and run pixi install
.
This process will regenerate the lock file based on the dependencies defined in your manifest file:
This action ensures that your project's dependencies are reset and updated according to the current specifications in manifest file.
In a future version of pixi
, we will introduce the pixi update
command, see #73.
This command will allow you to update the lock file directly, without manually deleting the pixi.lock
file, making the dependency management process even smoother.
update
#
The update
command checks if there are newer versions of the dependencies and updates the pixi.lock
file and environments accordingly.
It will only update the lock file if the dependencies in the manifest file are still compatible with the new versions.
Arguments#
[PACKAGES]...
The packages to update, space separated. If no packages are provided, all packages will be updated.
Options#
--manifest-path <MANIFEST_PATH>
: the path to manifest file, by default it searches for one in the parent directories.--environment <ENVIRONMENT> (-e)
: The environment to install, if none are provided all the environments are updated.--platform <PLATFORM> (-p)
: The platform for which the dependencies should be updated.--dry-run (-n)
: Only show the changes that would be made, without actually updating the lock file or environment.--no-install
: Don't install the (solve) environment needed for solving pypi-dependencies.--json
: Output the changes in json format.
pixi update numpy
pixi update numpy pandas
pixi update --manifest-path ~/myproject/pixi.toml numpy
pixi update --environment lint python
pixi update -e lint -e schema -e docs pre-commit
pixi update --platform osx-arm64 mlx
pixi update -p linux-64 -p osx-64 numpy
pixi update --dry-run
pixi update --no-install boto3
run
#
The run
commands first checks if the environment is ready to use.
When you didn't run pixi install
the run command will do that for you.
The custom tasks defined in the manifest file are also available through the run command.
You cannot run pixi run source setup.bash
as source
is not available in the deno_task_shell
commandos and not an executable.
Arguments#
[TASK]...
The task you want to run in the projects environment, this can also be a normal command. And all arguments after the task will be passed to the task.
Options#
--manifest-path <MANIFEST_PATH>
: the path to manifest file, by default it searches for one in the parent directories.--frozen
: install the environment as defined in the lock file, doesn't updatepixi.lock
if it isn't up-to-date with manifest file. It can also be controlled by thePIXI_FROZEN
environment variable (example:PIXI_FROZEN=true
).--locked
: only install if thepixi.lock
is up-to-date with the manifest file1. It can also be controlled by thePIXI_LOCKED
environment variable (example:PIXI_LOCKED=true
). Conflicts with--frozen
.--environment <ENVIRONMENT> (-e)
: The environment to run the task in, if none are provided the default environment will be used or a selector will be given to select the right environment.--clean-env
: Run the task in a clean environment, this will remove all environment variables of the shell environment except for the ones pixi sets. THIS DOESN't WORK ONWindows
.pixi run python pixi run cowpy "Hey pixi user" pixi run --manifest-path ~/myproject/pixi.toml python pixi run --frozen python pixi run --locked python # If you have specified a custom task in the pixi.toml you can run it with run as well pixi run build # Extra arguments will be passed to the tasks command. pixi run task argument1 argument2 # If you have multiple environments you can select the right one with the --environment flag. pixi run --environment cuda python # THIS DOESN'T WORK ON WINDOWS # If you want to run a command in a clean environment you can use the --clean-env flag. # The PATH should only contain the pixi environment here. pixi run --clean-env "echo \$PATH"
Info
In pixi
the deno_task_shell
is the underlying runner of the run command.
Checkout their documentation for the syntax and available commands.
This is done so that the run commands can be run across all platforms.
Cross environment tasks
If you're using the depends-on
feature of the tasks
, the tasks will be run in the order you specified them.
The depends-on
can be used cross environment, e.g. you have this pixi.toml
:
pixi.toml
[tasks]
start = { cmd = "python start.py", depends-on = ["build"] }
[feature.build.tasks]
build = "cargo build"
[feature.build.dependencies]
rust = ">=1.74"
[environments]
build = ["build"]
Then you're able to run the build
from the build
environment and start
from the default environment.
By only calling:
exec
#
Runs a command in a temporary environment disconnected from any project. This can be useful to quickly test out a certain package or version.
Temporary environments are cached. If the same command is run again, the same environment will be reused.
Cleaning temporary environments
Currently, temporary environments can only be cleaned up manually.
Environments for pixi exec
are stored under cached-envs-v0/
in the cache directory.
Run pixi info
to find the cache directory.
Arguments#
<COMMAND>
: The command to run.
Options:#
--spec <SPECS> (-s)
: Matchspecs of packages to install. If this is not provided, the package is guessed from the command.--channel <CHANNELS> (-c)
: The channel to install the packages from. If not specified the default channel is used.--force-reinstall
If specified a new environment is always created even if one already exists.
pixi exec python
# Add a constraint to the python version
pixi exec -s python=3.9 python
# Run ipython and include the py-rattler package in the environment
pixi exec -s ipython -s py-rattler ipython
# Force reinstall to recreate the environment and get the latest package versions
pixi exec --force-reinstall -s ipython -s py-rattler ipython
remove
#
Removes dependencies from the manifest file.
If the project manifest is a pyproject.toml
, removing a pypi dependency with the --pypi
flag will remove it from either
- the native pyproject project.dependencies
array or the native project.optional-dependencies
table (if a feature is specified)
- pixi pypi-dependencies
tables of the default or a named feature (if a feature is specified)
Arguments#
<DEPS>...
: List of dependencies you wish to remove from the project.
Options#
--manifest-path <MANIFEST_PATH>
: the path to manifest file, by default it searches for one in the parent directories.--host
: Specifies a host dependency, important for building a package.--build
: Specifies a build dependency, important for building a package.--pypi
: Specifies a PyPI dependency, not a conda package.--platform <PLATFORM> (-p)
: The platform from which the dependency should be removed.--feature <FEATURE> (-f)
: The feature from which the dependency should be removed.--no-install
: Don't install the environment, only remove the package from the lock-file and manifest.
pixi remove numpy
pixi remove numpy pandas pytorch
pixi remove --manifest-path ~/myproject/pixi.toml numpy
pixi remove --host python
pixi remove --build cmake
pixi remove --pypi requests
pixi remove --platform osx-64 --build clang
pixi remove --feature featurex clang
pixi remove --feature featurex --platform osx-64 clang
pixi remove --feature featurex --platform osx-64 --build clang
pixi remove --no-install numpy
task
#
If you want to make a shorthand for a specific command you can add a task for it.
Options#
--manifest-path <MANIFEST_PATH>
: the path to manifest file, by default it searches for one in the parent directories.
task add
#
Add a task to the manifest file, use --depends-on
to add tasks you want to run before this task, e.g. build before an execute task.
Arguments#
<NAME>
: The name of the task.<COMMAND>
: The command to run. This can be more than one word.
Info
If you are using $
for env variables they will be resolved before adding them to the task.
If you want to use $
in the task you need to escape it with a \
, e.g. echo \$HOME
.
Options#
--platform <PLATFORM> (-p)
: the platform for which this task should be added.--feature <FEATURE> (-f)
: the feature for which the task is added, if non provided the default tasks will be added.--depends-on <DEPENDS_ON>
: the task it depends on to be run before the one your adding.--cwd <CWD>
: the working directory for the task relative to the root of the project.--env <ENV>
: the environment variables askey=value
pairs for the task, can be used multiple times, e.g.--env "VAR1=VALUE1" --env "VAR2=VALUE2"
.--description <DESCRIPTION>
: a description of the task.
pixi task add cow cowpy "Hello User"
pixi task add tls ls --cwd tests
pixi task add test cargo t --depends-on build
pixi task add build-osx "METAL=1 cargo build" --platform osx-64
pixi task add train python train.py --feature cuda
pixi task add publish-pypi "hatch publish --yes --repo main" --feature build --env HATCH_CONFIG=config/hatch.toml --description "Publish the package to pypi"
This adds the following to the manifest file:
[tasks]
cow = "cowpy \"Hello User\""
tls = { cmd = "ls", cwd = "tests" }
test = { cmd = "cargo t", depends-on = ["build"] }
[target.osx-64.tasks]
build-osx = "METAL=1 cargo build"
[feature.cuda.tasks]
train = "python train.py"
[feature.build.tasks]
publish-pypi = { cmd = "hatch publish --yes --repo main", env = { HATCH_CONFIG = "config/hatch.toml" }, description = "Publish the package to pypi" }
Which you can then run with the run
command:
task remove
#
Remove the task from the manifest file
Arguments#
<NAMES>
: The names of the tasks, space separated.
Options#
--platform <PLATFORM> (-p)
: the platform for which this task is removed.--feature <FEATURE> (-f)
: the feature for which the task is removed.
task alias
#
Create an alias for a task.
Arguments#
<ALIAS>
: The alias name<DEPENDS_ON>
: The names of the tasks you want to execute on this alias, order counts, first one runs first.
Options#
--platform <PLATFORM> (-p)
: the platform for which this alias is created.
pixi task alias test-all test-py test-cpp test-rust
pixi task alias --platform linux-64 test test-linux
pixi task alias moo cow
task list
#
List all tasks in the project.
Options#
--environment
(-e
): the environment's tasks list, if non is provided the default tasks will be listed.--summary
(-s
): list the tasks per environment.
list
#
List project's packages. Highlighted packages are explicit dependencies.
Options#
--platform <PLATFORM> (-p)
: The platform to list packages for. Defaults to the current platform--json
: Whether to output in json format.--json-pretty
: Whether to output in pretty json format--sort-by <SORT_BY>
: Sorting strategy [default: name] [possible values: size, name, type]--explicit (-x)
: Only list the packages that are explicitly added to the manifest file.--manifest-path <MANIFEST_PATH>
: The path to manifest file, by default it searches for one in the parent directories.--environment (-e)
: The environment's packages to list, if non is provided the default environment's packages will be listed.--frozen
: install the environment as defined in the lock file, doesn't updatepixi.lock
if it isn't up-to-date with manifest file. It can also be controlled by thePIXI_FROZEN
environment variable (example:PIXI_FROZEN=true
).--locked
: Only install if thepixi.lock
is up-to-date with the manifest file1. It can also be controlled by thePIXI_LOCKED
environment variable (example:PIXI_LOCKED=true
). Conflicts with--frozen
.--no-install
: Don't install the environment for pypi solving, only update the lock-file if it can solve without installing. (Implied by--frozen
and--locked
)
pixi list
pixi list --json-pretty
pixi list --explicit
pixi list --sort-by size
pixi list --platform win-64
pixi list --environment cuda
pixi list --frozen
pixi list --locked
pixi list --no-install
Output will look like this, where python
will be green as it is the package that was explicitly added to the manifest file:
➜ pixi list
Package Version Build Size Kind Source
_libgcc_mutex 0.1 conda_forge 2.5 KiB conda _libgcc_mutex-0.1-conda_forge.tar.bz2
_openmp_mutex 4.5 2_gnu 23.1 KiB conda _openmp_mutex-4.5-2_gnu.tar.bz2
bzip2 1.0.8 hd590300_5 248.3 KiB conda bzip2-1.0.8-hd590300_5.conda
ca-certificates 2023.11.17 hbcca054_0 150.5 KiB conda ca-certificates-2023.11.17-hbcca054_0.conda
ld_impl_linux-64 2.40 h41732ed_0 688.2 KiB conda ld_impl_linux-64-2.40-h41732ed_0.conda
libexpat 2.5.0 hcb278e6_1 76.2 KiB conda libexpat-2.5.0-hcb278e6_1.conda
libffi 3.4.2 h7f98852_5 56.9 KiB conda libffi-3.4.2-h7f98852_5.tar.bz2
libgcc-ng 13.2.0 h807b86a_4 755.7 KiB conda libgcc-ng-13.2.0-h807b86a_4.conda
libgomp 13.2.0 h807b86a_4 412.2 KiB conda libgomp-13.2.0-h807b86a_4.conda
libnsl 2.0.1 hd590300_0 32.6 KiB conda libnsl-2.0.1-hd590300_0.conda
libsqlite 3.44.2 h2797004_0 826 KiB conda libsqlite-3.44.2-h2797004_0.conda
libuuid 2.38.1 h0b41bf4_0 32.8 KiB conda libuuid-2.38.1-h0b41bf4_0.conda
libxcrypt 4.4.36 hd590300_1 98 KiB conda libxcrypt-4.4.36-hd590300_1.conda
libzlib 1.2.13 hd590300_5 60.1 KiB conda libzlib-1.2.13-hd590300_5.conda
ncurses 6.4 h59595ed_2 863.7 KiB conda ncurses-6.4-h59595ed_2.conda
openssl 3.2.0 hd590300_1 2.7 MiB conda openssl-3.2.0-hd590300_1.conda
python 3.12.1 hab00c5b_1_cpython 30.8 MiB conda python-3.12.1-hab00c5b_1_cpython.conda
readline 8.2 h8228510_1 274.9 KiB conda readline-8.2-h8228510_1.conda
tk 8.6.13 noxft_h4845f30_101 3.2 MiB conda tk-8.6.13-noxft_h4845f30_101.conda
tzdata 2023d h0c530f3_0 116.8 KiB conda tzdata-2023d-h0c530f3_0.conda
xz 5.2.6 h166bdaf_0 408.6 KiB conda xz-5.2.6-h166bdaf_0.tar.bz2
tree
#
Display the project's packages in a tree. Highlighted packages are those specified in the manifest.
The package tree can also be inverted (-i
), to see which packages require a specific dependencies.
Arguments#
REGEX
optional regex of which dependencies to filter the tree to, or which dependencies to start with when inverting the tree.
Options#
--invert (-i)
: Invert the dependency tree, that is given aREGEX
pattern that matches some packages, show all the packages that depend on those.--platform <PLATFORM> (-p)
: The platform to list packages for. Defaults to the current platform--manifest-path <MANIFEST_PATH>
: The path to manifest file, by default it searches for one in the parent directories.--environment (-e)
: The environment's packages to list, if non is provided the default environment's packages will be listed.--frozen
: install the environment as defined in the lock file, doesn't updatepixi.lock
if it isn't up-to-date with manifest file. It can also be controlled by thePIXI_FROZEN
environment variable (example:PIXI_FROZEN=true
).--locked
: Only install if thepixi.lock
is up-to-date with the manifest file1. It can also be controlled by thePIXI_LOCKED
environment variable (example:PIXI_LOCKED=true
). Conflicts with--frozen
.--no-install
: Don't install the environment for pypi solving, only update the lock-file if it can solve without installing. (Implied by--frozen
and--locked
)
pixi tree
pixi tree pre-commit
pixi tree -i yaml
pixi tree --environment docs
pixi tree --platform win-64
Warning
Use -v
to show which pypi
packages are not yet parsed correctly. The extras
and markers
parsing is still under development.
Output will look like this, where direct packages in the manifest file will be green.
Once a package has been displayed once, the tree won't continue to recurse through its dependencies (compare the first time python
appears, vs the rest), and it will instead be marked with a star (*)
.
Version numbers are colored by the package type, yellow for Conda packages and blue for PyPI.
➜ pixi tree
├── pre-commit v3.3.3
│ ├── cfgv v3.3.1
│ │ └── python v3.12.2
│ │ ├── bzip2 v1.0.8
│ │ ├── libexpat v2.6.2
│ │ ├── libffi v3.4.2
│ │ ├── libsqlite v3.45.2
│ │ │ └── libzlib v1.2.13
│ │ ├── libzlib v1.2.13 (*)
│ │ ├── ncurses v6.4.20240210
│ │ ├── openssl v3.2.1
│ │ ├── readline v8.2
│ │ │ └── ncurses v6.4.20240210 (*)
│ │ ├── tk v8.6.13
│ │ │ └── libzlib v1.2.13 (*)
│ │ └── xz v5.2.6
│ ├── identify v2.5.35
│ │ └── python v3.12.2 (*)
...
└── tbump v6.9.0
...
└── tomlkit v0.12.4
└── python v3.12.2 (*)
A regex pattern can be specified to filter the tree to just those that show a specific direct, or transitive dependency:
➜ pixi tree pre-commit
└── pre-commit v3.3.3
├── virtualenv v20.25.1
│ ├── filelock v3.13.1
│ │ └── python v3.12.2
│ │ ├── libexpat v2.6.2
│ │ ├── readline v8.2
│ │ │ └── ncurses v6.4.20240210
│ │ ├── libsqlite v3.45.2
│ │ │ └── libzlib v1.2.13
│ │ ├── bzip2 v1.0.8
│ │ ├── libzlib v1.2.13 (*)
│ │ ├── libffi v3.4.2
│ │ ├── tk v8.6.13
│ │ │ └── libzlib v1.2.13 (*)
│ │ ├── xz v5.2.6
│ │ ├── ncurses v6.4.20240210 (*)
│ │ └── openssl v3.2.1
│ ├── platformdirs v4.2.0
│ │ └── python v3.12.2 (*)
│ ├── distlib v0.3.8
│ │ └── python v3.12.2 (*)
│ └── python v3.12.2 (*)
├── pyyaml v6.0.1
...
Additionally, the tree can be inverted, and it can show which packages depend on a regex pattern.
The packages specified in the manifest will also be highlighted (in this case cffconvert
and pre-commit
would be).
➜ pixi tree -i yaml
ruamel.yaml v0.18.6
├── pykwalify v1.8.0
│ └── cffconvert v2.0.0
└── cffconvert v2.0.0
pyyaml v6.0.1
└── pre-commit v3.3.3
ruamel.yaml.clib v0.2.8
└── ruamel.yaml v0.18.6
├── pykwalify v1.8.0
│ └── cffconvert v2.0.0
└── cffconvert v2.0.0
yaml v0.2.5
└── pyyaml v6.0.1
└── pre-commit v3.3.3
shell
#
This command starts a new shell in the project's environment.
To exit the pixi shell, simply run exit
.
Options#
--change-ps1 <true or false>
: When set to false, the(pixi)
prefix in the shell prompt is removed (default:true
). The default behavior can be configured globally.--manifest-path <MANIFEST_PATH>
: the path to manifest file, by default it searches for one in the parent directories.--frozen
: install the environment as defined in the lock file, doesn't updatepixi.lock
if it isn't up-to-date with manifest file. It can also be controlled by thePIXI_FROZEN
environment variable (example:PIXI_FROZEN=true
).--locked
: only install if thepixi.lock
is up-to-date with the manifest file1. It can also be controlled by thePIXI_LOCKED
environment variable (example:PIXI_LOCKED=true
). Conflicts with--frozen
.--environment <ENVIRONMENT> (-e)
: The environment to activate the shell in, if none are provided the default environment will be used or a selector will be given to select the right environment.
pixi shell
exit
pixi shell --manifest-path ~/myproject/pixi.toml
exit
pixi shell --frozen
exit
pixi shell --locked
exit
pixi shell --environment cuda
exit
shell-hook
#
This command prints the activation script of an environment.
Options#
--shell <SHELL> (-s)
: The shell for which the activation script should be printed. Defaults to the current shell. Currently supported variants: [bash
,zsh
,xonsh
,cmd
,powershell
,fish
,nushell
]--manifest-path
: the path to manifest file, by default it searches for one in the parent directories.--frozen
: install the environment as defined in the lock file, doesn't updatepixi.lock
if it isn't up-to-date with manifest file. It can also be controlled by thePIXI_FROZEN
environment variable (example:PIXI_FROZEN=true
).--locked
: only install if thepixi.lock
is up-to-date with the manifest file1. It can also be controlled by thePIXI_LOCKED
environment variable (example:PIXI_LOCKED=true
). Conflicts with--frozen
.--environment <ENVIRONMENT> (-e)
: The environment to activate, if none are provided the default environment will be used or a selector will be given to select the right environment.--json
: Print all environment variables that are exported by running the activation script as JSON. When specifying this option,--shell
is ignored.
pixi shell-hook
pixi shell-hook --shell bash
pixi shell-hook --shell zsh
pixi shell-hook -s powershell
pixi shell-hook --manifest-path ~/myproject/pixi.toml
pixi shell-hook --frozen
pixi shell-hook --locked
pixi shell-hook --environment cuda
pixi shell-hook --json
Example use-case, when you want to get rid of the pixi
executable in a Docker container.
pixi shell-hook --shell bash > /etc/profile.d/pixi.sh
rm ~/.pixi/bin/pixi # Now the environment will be activated without the need for the pixi executable.
search
#
Search a package, output will list the latest version of the package.
Arguments#
<PACKAGE>
: Name of package to search, it's possible to use wildcards (*
).
Options#
--manifest-path <MANIFEST_PATH>
: the path to manifest file, by default it searches for one in the parent directories.--channel <CHANNEL> (-c)
: specify a channel that the project uses. Defaults toconda-forge
. (Allowed to be used more than once)--limit <LIMIT> (-l)
: optionally limit the number of search results--platform <PLATFORM> (-p)
: specify a platform that you want to search for. (default: current platform)
pixi search pixi
pixi search --limit 30 "py*"
# search in a different channel and for a specific platform
pixi search -c robostack --platform linux-64 "plotjuggler*"
self-update
#
Update pixi to the latest version or a specific version. If the pixi binary is not found in the default location (e.g.
~/.pixi/bin/pixi
), pixi won't update to prevent breaking the current installation (Homebrew, etc.). The behaviour can be
overridden with the --force
flag
Options#
--version <VERSION>
: The desired version (to downgrade or upgrade to). Update to the latest version if not specified.--force
: Force the update even if the pixi binary is not found in the default location.
info
#
Shows helpful information about the pixi installation, cache directories, disk usage, and more. More information here.
Options#
--manifest-path <MANIFEST_PATH>
: the path to manifest file, by default it searches for one in the parent directories.--extended
: extend the information with more slow queries to the system, like directory sizes.--json
: Get a machine-readable version of the information as output.
clean
#
Clean the parts of your system which are touched by pixi.
Defaults to cleaning the environments and task cache.
Use the cache
subcommand to clean the cache
Options#
--manifest-path <MANIFEST_PATH>
: the path to manifest file, by default it searches for one in the parent directories.--environment <ENVIRONMENT> (-e)
: The environment to clean, if none are provided all environments will be removed.
clean cache
#
Clean the pixi cache on your system.
Options#
--pypi
: Clean the pypi cache.--conda
: Clean the conda cache.--yes
: Skip the confirmation prompt.
pixi clean cache # clean all pixi caches
pixi clean cache --pypi # clean only the pypi cache
pixi clean cache --conda # clean only the conda cache
pixi clean cache --yes # skip the confirmation prompt
upload
#
Upload a package to a prefix.dev channel
Arguments#
<HOST>
: The host + channel to upload to.<PACKAGE_FILE>
: The package file to upload.
auth
#
This command is used to authenticate the user's access to remote hosts such as prefix.dev
or anaconda.org
for private channels.
auth login
#
Store authentication information for given host.
Tip
The host is real hostname not a channel.
Arguments#
<HOST>
: The host to authenticate with.
Options#
--token <TOKEN>
: The token to use for authentication with prefix.dev.--username <USERNAME>
: The username to use for basic HTTP authentication--password <PASSWORD>
: The password to use for basic HTTP authentication.--conda-token <CONDA_TOKEN>
: The token to use onanaconda.org
/quetz
authentication.
pixi auth login repo.prefix.dev --token pfx_JQEV-m_2bdz-D8NSyRSaAndHANx0qHjq7f2iD
pixi auth login anaconda.org --conda-token ABCDEFGHIJKLMNOP
pixi auth login https://myquetz.server --username john --password xxxxxx
auth logout
#
Remove authentication information for a given host.
Arguments#
<HOST>
: The host to authenticate with.
config
#
Use this command to manage the configuration.
Options#
--system (-s)
: Specify management scope to system configuration.--global (-g)
: Specify management scope to global configuration.--local (-l)
: Specify management scope to local configuration.
Checkout the pixi configuration for more information about the locations.
config edit
#
Edit the configuration file in the default editor.
config list
#
List the configuration
Arguments#
[KEY]
: The key to list the value of. (all if not provided)
Options#
--json
: Output the configuration in JSON format.
pixi config list default-channels
pixi config list --json
pixi config list --system
pixi config list -g
config prepend
#
Prepend a value to a list configuration key.
Arguments#
<KEY>
: The key to prepend the value to.<VALUE>
: The value to prepend.
config append
#
Append a value to a list configuration key.
Arguments#
<KEY>
: The key to append the value to.<VALUE>
: The value to append.
config set
#
Set a configuration key to a value.
Arguments#
<KEY>
: The key to set the value of.[VALUE]
: The value to set. (if not provided, the key will be removed)
pixi config set default-channels '["conda-forge", "bioconda"]'
pixi config set --global mirrors '{"https://conda.anaconda.org/": ["https://prefix.dev/conda-forge"]}'
pixi config set repodata-config.disable-zstd true --system
pixi config set --global detached-environments "/opt/pixi/envs"
pixi config set detached-environments false
config unset
#
Unset a configuration key.
Arguments#
<KEY>
: The key to unset.
pixi config unset default-channels
pixi config unset --global mirrors
pixi config unset repodata-config.disable-zstd --system
global
#
Global is the main entry point for the part of pixi that executes on the global(system) level.
Tip
Binaries and environments installed globally are stored in ~/.pixi
by default, this can be changed by setting the PIXI_HOME
environment
variable.
global install
#
This command installs package(s) into its own environment and adds the binary to PATH
, allowing you to access it anywhere on your system without activating the environment.
Arguments#
1.<PACKAGE>
: The package(s) to install, this can also be a version constraint.
Options#
--channel <CHANNEL> (-c)
: specify a channel that the project uses. Defaults toconda-forge
. (Allowed to be used more than once)
pixi global install ruff
# multiple packages can be installed at once
pixi global install starship rattler-build
# specify the channel(s)
pixi global install --channel conda-forge --channel bioconda trackplot
# Or in a more concise form
pixi global install -c conda-forge -c bioconda trackplot
# Support full conda matchspec
pixi global install python=3.9.*
pixi global install "python [version='3.11.0', build_number=1]"
pixi global install "python [version='3.11.0', build=he550d4f_1_cpython]"
pixi global install python=3.11.0=h10a6764_1_cpython
After using global install, you can use the package you installed anywhere on your system.
global list
#
This command shows the current installed global environments including what binaries come with it. A global installed package/environment can possibly contain multiple binaries and they will be listed out in the command output. Here is an example of a few installed packages:
> pixi global list
Global install location: /home/hanabi/.pixi
├── bat 0.24.0
| └─ exec: bat
├── conda-smithy 3.31.1
| └─ exec: feedstocks, conda-smithy
├── rattler-build 0.13.0
| └─ exec: rattler-build
├── ripgrep 14.1.0
| └─ exec: rg
└── uv 0.1.17
└─ exec: uv
global upgrade
#
This command upgrades a globally installed package (to the latest version by default).
Arguments#
<PACKAGE>
: The package to upgrade.
Options#
--channel <CHANNEL> (-c)
: specify a channel that the project uses. Defaults toconda-forge
. Note the channel the package was installed from will be always used for upgrade. (Allowed to be used more than once)
pixi global upgrade ruff
pixi global upgrade --channel conda-forge --channel bioconda trackplot
# Or in a more concise form
pixi global upgrade -c conda-forge -c bioconda trackplot
# Conda matchspec is supported
# You can specify the version to upgrade to when you don't want the latest version
# or you can even use it to downgrade a globally installed package
pixi global upgrade python=3.10
global upgrade-all
#
This command upgrades all globally installed packages to their latest version.
Options#
--channel <CHANNEL> (-c)
: specify a channel that the project uses. Defaults toconda-forge
. Note the channel the package was installed from will be always used for upgrade. (Allowed to be used more than once)
pixi global upgrade-all
pixi global upgrade-all --channel conda-forge --channel bioconda
# Or in a more concise form
pixi global upgrade-all -c conda-forge -c bioconda trackplot
global remove
#
Removes a package previously installed into a globally accessible location via
pixi global install
Use pixi global info
to find out what the package name is that belongs to the tool you want to remove.
Arguments#
<PACKAGE>
: The package(s) to remove.
pixi global remove pre-commit
# multiple packages can be removed at once
pixi global remove pre-commit starship
project
#
This subcommand allows you to modify the project configuration through the command line interface.
Options#
--manifest-path <MANIFEST_PATH>
: the path to manifest file, by default it searches for one in the parent directories.
project channel add
#
Add channels to the channel list in the project configuration. When you add channels, the channels are tested for existence, added to the lock file and the environment is reinstalled.
Arguments#
<CHANNEL>
: The channels to add, name or URL.
Options#
--no-install
: do not update the environment, only add changed packages to the lock-file.--feature <FEATURE> (-f)
: The feature for which the channel is added.
pixi project channel add robostack
pixi project channel add bioconda conda-forge robostack
pixi project channel add file:///home/user/local_channel
pixi project channel add https://repo.prefix.dev/conda-forge
pixi project channel add --no-install robostack
pixi project channel add --feature cuda nvidia
project channel list
#
List the channels in the manifest file
Options#
urls
: show the urls of the channels instead of the names.
$ pixi project channel list
Environment: default
- conda-forge
$ pixi project channel list --urls
Environment: default
- https://conda.anaconda.org/conda-forge/
project channel remove
#
List the channels in the manifest file
Arguments#
<CHANNEL>...
: The channels to remove, name(s) or URL(s).
Options#
--no-install
: do not update the environment, only add changed packages to the lock-file.--feature <FEATURE> (-f)
: The feature for which the channel is removed.
pixi project channel remove conda-forge
pixi project channel remove https://conda.anaconda.org/conda-forge/
pixi project channel remove --no-install conda-forge
pixi project channel remove --feature cuda nvidia
project description get
#
Get the project description.
project description set
#
Set the project description.
Arguments#
<DESCRIPTION>
: The description to set.
project environment add
#
Add an environment to the manifest file.
Arguments#
<NAME>
: The name of the environment to add.
Options#
-f, --feature <FEATURES>
: Features to add to the environment.--solve-group <SOLVE_GROUP>
: The solve-group to add the environment to.--no-default-feature
: Don't include the default feature in the environment.--force
: Update the manifest even if the environment already exists.
pixi project environment add env1 --feature feature1 --feature feature2
pixi project environment add env2 -f feature1 --solve-group test
pixi project environment add env3 -f feature1 --no-default-feature
pixi project environment add env3 -f feature1 --force
project environment remove
#
Remove an environment from the manifest file.
Arguments#
<NAME>
: The name of the environment to remove.
project environment list
#
List the environments in the manifest file.
project platform add
#
Adds a platform(s) to the manifest file and updates the lock file.
Arguments#
<PLATFORM>...
: The platforms to add.
Options#
--no-install
: do not update the environment, only add changed packages to the lock-file.--feature <FEATURE> (-f)
: The feature for which the platform will be added.
project platform list
#
List the platforms in the manifest file.
project platform remove
#
Remove platform(s) from the manifest file and updates the lock file.
Arguments#
<PLATFORM>...
: The platforms to remove.
Options#
--no-install
: do not update the environment, only add changed packages to the lock-file.--feature <FEATURE> (-f)
: The feature for which the platform will be removed.
project version get
#
Get the project version.
project version set
#
Set the project version.
Arguments#
<VERSION>
: The version to set.
project version {major|minor|patch}
#
Bump the project version to {MAJOR|MINOR|PATCH}.
-
An up-to-date lock file means that the dependencies in the lock file are allowed by the dependencies in the manifest file. For example
- a manifest with
python = ">= 3.11"
is up-to-date with aname: python, version: 3.11.0
in thepixi.lock
. - a manifest with
python = ">= 3.12"
is not up-to-date with aname: python, version: 3.11.0
in thepixi.lock
.
Being up-to-date does not mean that the lock file holds the latest version available on the channel for the given dependency. ↩↩↩↩↩↩
- a manifest with