Skip to main content
The pixi global add command adds dependencies to an existing global environment and updates the global manifest.

Usage

Arguments

string
required
Package specification to add to the global environment. Can be:
  • Package name: python
  • Version constraint: python=3.11.*
  • MatchSpec: python>=3.11,<3.12
Multiple packages can be specified.

Options

Environment Selection

string
required
Specifies the environment that dependencies should be added to.Short flag: -eThe environment must already exist. Use pixi global install to create new environments.
If the environment doesn’t exist, you’ll receive an error:Environment xyz doesn't exist. You can create a new environment with 'pixi global install'.

Expose Executables

string
Add one or more mappings describing which executables are exposed.Format: exposed_name=executable_name or just executable_name (which becomes executable_name=executable_name).Can be specified multiple times.

Behavior

Adding Dependencies

When you add dependencies to a global environment:
  1. Dependencies are added to the global manifest
  2. The environment is synced (packages are installed)
  3. Executables are exposed based on --expose flags
  4. Completions are updated (on Unix systems)

Package Installation

The command installs or upgrades packages:
  • New packages: Installed with their dependencies
  • Existing packages: Upgraded to meet the new specification
  • Dependencies: Automatically resolved and installed

Executable Exposure

Exposed executables are made available system-wide:
  • On Unix: Symlinked to ~/.pixi/bin/
  • On Windows: Added to PATH through shims

Examples

Add Single Package

Adds numpy to the python311 environment.

Add Multiple Packages

Adds multiple data science packages at once.

Add with Version Constraint

Adds packages with specific version constraints.

Add and Expose Executables

Adds Python and exposes it as both python3.11 and python3.

Add with Simple Exposure

Exposes pytest using its default name.

Add Multiple Packages with Exposure

Adds pytest and pytest-cov, exposing only the pytest executable.

Common Use Cases

Add Tools to Existing Environment

Upgrade Package Version

This updates the constraint and upgrades the package if needed.

Add Package with Multiple Exposed Names

Exposes Python under multiple aliases.

Error Handling

Environment Doesn’t Exist

Error: Environment xyz doesn't exist Solution: Create the environment first:

Package Not Found

Error: package 'numpyy' not found Solution: Check package name:

Version Conflict

Error: cannot satisfy version constraint Solution: Adjust version constraints or check compatibility:

Reversion on Error

If the add operation fails, pixi automatically reverts the environment to its previous state.

State Changes Reported

After a successful add, pixi reports:
  • Packages added with versions
  • Executables exposed
  • Completions updated
Example output:

global add vs global install

  • pixi global install: Creates a new environment or reinstalls existing one
  • pixi global add: Adds dependencies to an existing environment

global add vs add

  • pixi add: Adds dependencies to workspace project
  • pixi global add: Adds dependencies to global environment (user-level)

Global Manifest Location

The global manifest is stored at:
  • Unix: ~/.pixi/manifests/pixi-global.toml
  • Windows: %USERPROFILE%\.pixi\manifests\pixi-global.toml

Config Options

boolean
Disable TLS certificate verification.
string
Path to authentication file.

See Also