Skip to content

flox activate command


flox-activate - activate environments


flox [ <general-options> ] activate [ <options> ] [ – <command> [ <argument> ] ]


Sets environment variables and aliases, runs hooks and adds environment bin directories to your $PATH. Can be invoked from an interactive terminal to launch a sub-shell, non-interactively to produce a series of commands to be sourced by your current $SHELL, or with a command and arguments to be invoked directly.


General Options

Many flox commands wrap Nix commands of the same name, and will correspondingly pass on options and arguments directly to the underlying nix invocation. For more information on the options supported by specific Nix commands please invoke flox nix <command> help.

The following options are used specifically by flox and must be specified before the <command> argument.

-v, --verbose
Verbose mode. Invoke multiple times for increasing detail.

Debug mode. Invoke multiple times for increasing detail.

-V, --version
Print flox version.

Print flox installation prefix / Nix store path. (flox internal use only.)

Force execution in flox-bash (flox internal use only.)

Environment Options

The following option is supported by environment commands:

(-e|–environment) <name>
Selects flox environment to be modified or used. If not provided then flox will fall back to using the default environment.

Activate Options

[ – <command> [ <argument> ] ]
Command to run in the environment. Spawns the command in an ephmenral environment that does not leak into the calling process.


  • activate “default” flox environment only within the current shell (add to the relevant “rc” file, e.g. ~/.bashrc or ~/.zprofile)

    . <(flox activate)

  • activate “foo” and “default” flox environments in a new subshell

    flox activate -e foo

  • invoke command using “foo” and “default” flox environments

    flox activate -e foo -- cmd --cmdflag cmdflagarg cmdarg