flox edit
command
NAME
flox-edit - edit the declarative environment configuration
SYNOPSIS
flox [<general options>] edit
[-d=<path> | -r=<owner/name>]
[[-f=<file>] | -n=<name> | --sync | --reset]
DESCRIPTION
Transactionally edit the environment manifest.
By default invokes an editor with a copy of the local manifest for the
user to interactively edit. The editor is found by querying $EDITOR
,
$VISUAL
, and then by looking for common editors in $PATH
. The
manifest of an environment on FloxHub or in a different directory can be
edited via the -r
or -d
flags respectively. See
manifest.toml(5)
for more details on the
manifest format.
Once the editor is closed the environment is built in order to validate
the edit. If the build fails you are given a change to continue editing
the manifest, and if you decline, the edit is discarded. This
transactional editing prevents an edit from leaving the environment in a
broken state. One exception is the -n
flag, which renames a local
environment but does not rebuild it.
The environment can be edited non-interactively via the -f
flag, which
replaces the contents of the manifest with those of the provided file.
Sync the local manifest with the current generation.
When using environments that were pushed to or pulled from FloxHub,
changes to the local manifest in .flox/env/manifest.toml
will block
the use of the environment commands
flox {install, uninstall, edit, upgrade}
. In this case, a new
generation has to be created from the local manifest first or the
changes discarded. Run flox edit --reset
to discard local changes and
reset to the current latest generation, or flox edit --sync
to create
a new generation.
OPTIONS
Edit Options
-f
, --file
Replace environment manifest with that in <file>
. If <file>
is -
,
reads from stdin.
-n
, --name
Rename the environment to <name>
. Only works for local environments.
-s
, --sync
Create a new generation from the current local environment (Only
available for managed environments)
-r
, --reset
Reset the environment to the current generation (Only available for
managed environments)
Environment Options
If no environment is specified for an environment command, the environment in the current directory or the active environment that was last activated is used.
-d
, --dir
Path containing a .flox/ directory.
-r
, --remote
A remote environment on FloxHub, specified in the form <owner>/<name>
.
General Options
-h
, --help
Prints help information.
The following options can be passed when running any flox
subcommand
but must be specified before the subcommand.
-v
, --verbose
Increase logging verbosity. Invoke multiple times for increasing detail.
-q
, --quiet
Silence logs except for errors.
ENVIRONMENT VARIABLES
$EDITOR
, $VISUAL
Override the default editor used for editing environment manifests and
commit messages.