Skip to content

pixi shell-hook#

About#

Print the pixi environment activation script

Usage#

pixi shell-hook [OPTIONS]

Options#

Config Options#

Update Options#

  • --no-install
    Don't modify the environment, only modify the lock-file
  • --revalidate
    Run the complete environment validation. This will reinstall a broken environment
  • --no-lockfile-update
    Don't update lockfile, implies the no-install as well
  • --frozen
    Install the environment as defined in the lockfile, doesn't update lockfile if it isn't up-to-date with the manifest file
    env: PIXI_FROZEN
  • --locked
    Check if lockfile is up-to-date before installing the environment, aborts when lockfile isn't up-to-date with the manifest file
    env: PIXI_LOCKED
  • --environment (-e) <ENVIRONMENT>
    The environment to activate in the script
  • --json
    Emit the environment variables set by running the activation as JSON
    default: false

Global Options#

Description#

Print the pixi environment activation script.

You can source the script to activate the environment without needing pixi itself.

Examples#

pixi shell-hook
pixi shell-hook --shell bash
pixi shell-hook --shell zsh
pixi shell-hook -s powershell
pixi shell-hook --manifest-path ~/myworkspace/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.