← 返回命令列表

Linux command

pixi 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Initialize new project

pixi init [project_name]

Add dependency

pixi add [numpy]

Add dev dependency

pixi add --dev [pytest]

Run a task

pixi run [test]

Install dependencies

pixi install

Activate shell

pixi shell

Create global tool installation

pixi global install [ruff]

Show project info

pixi info

Search for packages

pixi search [numpy]

说明

pixi is a fast, cross-platform package manager built on the conda ecosystem. It manages Python and native dependencies together, providing reproducible environments from a single lockfile. Projects use pixi.toml for configuration, similar to Cargo.toml. Dependencies from conda-forge, PyPI, and custom channels can be mixed. The lockfile (pixi.lock) pins exact versions for reproducibility. Multi-platform support generates separate lockfiles per platform, enabling the same project to work on Linux, macOS, and Windows without manual intervention. Tasks defined in pixi.toml provide npm-like scripting. Commands like test, build, and lint are configured once and run with pixi run. Task dependencies chain commands together. Global installations (pixi global install) work like pipx, creating isolated environments for CLI tools. This keeps development tools separate from project dependencies.

参数

init _name_
Initialize new project with pixi.toml.
add _packages_
Add dependencies to project.
remove _packages_
Remove dependencies.
install
Install all dependencies.
run _task_
Run a project task.
shell
Activate environment shell.
task _subcommand_
Manage project tasks.
project _subcommand_
Manage project configuration.
global _subcommand_
Manage global tool installations.
update
Update dependencies.
list
List project dependencies.
tree
Show dependency tree.
info
Show project information.
search _query_
Search for packages in configured channels.
clean
Remove the environment and cache.
--dev, -d
Operate on dev dependencies.
--platform _PLATFORM_
Target platform.
--feature _FEATURE_
Target feature.
--manifest-path _PATH_
Path to pixi.toml.
--frozen
Use existing lockfile without updates.
--locked
Require lockfile to be up to date.

FAQ

What is the pixi command used for?

pixi is a fast, cross-platform package manager built on the conda ecosystem. It manages Python and native dependencies together, providing reproducible environments from a single lockfile. Projects use pixi.toml for configuration, similar to Cargo.toml. Dependencies from conda-forge, PyPI, and custom channels can be mixed. The lockfile (pixi.lock) pins exact versions for reproducibility. Multi-platform support generates separate lockfiles per platform, enabling the same project to work on Linux, macOS, and Windows without manual intervention. Tasks defined in pixi.toml provide npm-like scripting. Commands like test, build, and lint are configured once and run with pixi run. Task dependencies chain commands together. Global installations (pixi global install) work like pipx, creating isolated environments for CLI tools. This keeps development tools separate from project dependencies.

How do I run a basic pixi example?

Run `pixi init [project_name]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does init _name_ do in pixi?

Initialize new project with pixi.toml.