A FloxHub environment allows you to centrally manage a Flox environment, tracking changes made to it and allowing the environment to be reused in multiple contexts.Documentation Index
Fetch the complete documentation index at: https://flox-robinbrantley-containers.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Background
When you create an environment for your project, you often do so via theflox init command, which creates a .flox directory that you can check into source control.
Terminology
We call an environment that has been pushed to FloxHub a “FloxHub environment”. One of the primary benefits of FloxHub environments is that they can be reused in different contexts, by different people, on different machines. This means you frequently have multiple copies of the environment:- The copy that lives on FloxHub, which is the source of truth
- The copy that exists locally for a given user on a given machine
Getting a FloxHub environment
Once you’ve pushed an environment to FloxHub, you can then use theflox pull command to fetch a copy of the environment to your machine.
A FloxHub environment can exist on your machine in two different forms:
- A cached copy transparently managed by Flox
- Fetch this manually via
flox pull --reference <owner>/<name>
- Fetch this manually via
- Materialized into a user-specified directory
- Created via
flox pull <owner>/<name> - Placed into the current directory by default
- Specify a different directory with the
-d/--directoryflag
- Created via
flox pull (-r | --reference) <owner>/<name> command.
Operations on FloxHub environments
CLI commands that interact with FloxHub environments will primarily operate on the cached copy of the environment. This allows you to use FloxHub environments offline if a cached copy exists. As an example, installing a package viaflox install -r will operate on the local copy, creating a new generation of the local copy.
The Flox CLI indicates when an operation has been performed on the local copy (note the (local) text in the example below).
flox activate command succeeds, but the message indicates that you need to run either a flox pull or flox push command (flox push in this case since you have local changes) to synchronize the two copies:
flox push command syncs local changes to the upstream copy on FloxHub:
Getting information from upstream
Generations
Both the local and upstream FloxHub environments track their state over time via generations. For an in-depth explanation of generations, see the Generations concept page. In order to view the list of generations as understood by the local copy, you use theflox generations list command.
To see the list of generations as understood by the upstream copy, you add the --upstream flag.
In order to view the history of generations (which displays how the “live” generation has evolved over time, any rollbacks that occurred, etc), you use flox generations history.
Again, the --upstream flag will show you the history as understood by the upstream copy.
Packages
In order to see the list of packages in the local copy of a FloxHub environment you use theflox list -r command.
Add the --upstream flag to see the packages in the upstream copy of the FloxHub environment.
Activating a FloxHub environment
Activating a FloxHub environment is done via theflox activate -r command.
This will activate the current state of the local copy of the FloxHub environment, which may not be up to date with the upstream copy.
To activate the environment as it exists upstream, run flox pull -r <owner>/<name> before running flox activate -r.