NAME
flox-init - initialize a Flox environmentSYNOPSIS
DESCRIPTION
Create a new empty environment in the current directory or on FloxHub. The name of the environment will be the basename of the current directory ordefault if the current directory is $HOME. The --name
flag can be used to name a specific environment.
By default, the environment will be created in the current directory.
Flox will add a directory $PWD/.flox containing all relevant
environment metadata. Flox stores a random identifier in the env_id
field of .flox/env.json to group metrics from commands that use the
same local environment. The field is committed with the rest of .flox
so the identifier stays with the environment when it is cloned. Flox
always creates the identifier, but submits it only when metrics
collection is enabled. Environments created by older Flox versions store
the identifier in a separate .flox/telemetry_id file instead, which is
still honored. The --dir flag can be used to create an environment in
another location.
If an environment already exists in the current directory, or the path
specified using --dir exists, an error is returned.
init will try to detect languages being used in the containing
directory, and it will prompt with suggestions for packages or
activation scripts to be added to the environment. These suggestions can
be taken without prompting by passing --auto-setup. The suggestions
can be accepted but then edited using flox edit. Currently,
suggestions are made for Python and Node.js.
With --reference Flox will create a FloxHub environment which can
subsequently be used by other commands using the --reference flag.
When creating FloxHub environments Flox will not run any setup hooks
based on the current directory.
OPTIONS
Common Init Options
--bareSet up the environment with the emptiest possible manifest.
Options to initialize a local environment
-n <name>, --name <name>What to name the new environment (default: current directory).
-d <path>, --dir <path>Directory to create the environment in (default: current directory).
--auto-setupApply Flox recommendations for the environment based on what languages are being used in the containing directory.
--no-auto-setupDon’t auto-detect language support for a project or make suggestions.
Options to initialize an environment on FloxHub
-r <owner>/<name>, --reference <owner>/<name>The environment reference for the FloxHub Environment to be created. User needs write access to
<owner>, and an environment with the same
<name> must not already exist.
General Options
-h, --helpPrints help information. The following options can be passed when running any
flox subcommand
but must be specified before the subcommand.
-v, --verboseIncrease logging verbosity. Invoke multiple times for increasing detail.
-q, --quietSilence logs except for errors.
SEE ALSO
flox-activate,
flox-install