Skip to content

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>]

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(1) 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.

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.

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.

SEE ALSO

flox-push(1), flox-pull(1), flox-activate(1)