LinuxCommandLibrary

pixi-config

Configure the pixi environment and settings

TLDR

Edit the configuration file

$ pixi config edit
copy

List all configurations
$ pixi config list
copy

Prepend a value to a list configuration key
$ pixi config prepend [key] [value]
copy

Append a value to a list configuration key
$ pixi config append [key] [value]
copy

Set a configuration key to a value
$ pixi config set [key] [value]
copy

Unset a configuration key
$ pixi config unset [key]
copy

SYNOPSIS

pixi config
pixi config get <key>
pixi config set <key> <value>
pixi config unset <key>
pixi config list
pixi config edit

PARAMETERS

get <key>
    Retrieves the value associated with a specified configuration key. Can be combined with --global or --local to specify the scope.

set <key> <value>
    Assigns a new value to a given configuration key. If the key doesn't exist, it's created. Can be combined with --global or --local.

unset <key>
    Removes a specified configuration key and its value. Can be combined with --global or --local.

list
    Displays all current active configuration key-value pairs, showing values from both global and local settings and their precedence.

edit
    Opens the relevant configuration file (either the global ~/.pixi/config.toml or the local project's .pixi/config.toml) in the default text editor for manual modification.

--global
    (Applicable to get, set, unset) Directs the command to operate specifically on the global configuration file, typically located at ~/.pixi/config.toml.

--local
    (Applicable to get, set, unset) Directs the command to operate specifically on the local project's configuration file, typically found at .pixi/config.toml within the project root.

DESCRIPTION

The pixi config command is a powerful subcommand of the pixi dependency manager, designed to manage various configuration settings for pixi projects and the global environment. It allows users to inspect, modify, and list key-value pairs that influence pixi's behavior, such as proxy settings, preferred package sources, and other environmental variables. Configuration can be applied globally, affecting all pixi operations on the system, or locally within a specific project directory, overriding global settings for that particular project. This granularity ensures flexibility and reproducibility across different development workflows. It acts as a central hub for tailoring pixi to specific needs without modifying project files directly.

CAVEATS

The command pixi-config is not a standalone executable. It is a subcommand of the pixi tool, correctly invoked as pixi config. Users should be aware of this distinction when using the command. Additionally, local project configurations always take precedence over global settings, and caution should be exercised when modifying sensitive information stored in plain text configuration files.

CONFIGURATION FILES

Pixi stores its configuration in TOML format. The global configuration is typically located at ~/.pixi/config.toml (or a path specified by the PIXI_HOME environment variable). Project-specific configurations are found at .pixi/config.toml within the root directory of a pixi project (or specified by PIXI_PROJECT_ROOT). These files contain key-value pairs that define pixi's behavior, including package channels, proxy settings, and solver preferences.

CONFIGURATION PRECEDENCE

When pixi resolves configuration settings for a given operation, values defined in the local project's .pixi/config.toml file always take precedence over identical keys defined in the global ~/.pixi/config.toml file. This allows project-specific overrides without affecting other pixi environments or projects on the system, ensuring tailored behavior for individual development contexts.

HISTORY

Pixi is a relatively modern and actively developed project, gaining significant attention since 2023 as a robust dependency and environment manager. The config subcommand has been an integral part of Pixi's core functionality from its early stages, providing essential capabilities for users to customize their environment, manage package channels, and handle proxy settings without manual file editing. Its design reflects best practices from similar configuration management patterns seen in established tools like Git and npm, emphasizing user control and flexibility.

SEE ALSO

pixi(1), git-config(1), npm-config(1), conda-config(1)

Copied to clipboard