Skip to content

Conversation

@zmitchell
Copy link
Member

No description provided.

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Dec 15, 2025
@github-actions
Copy link

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated, but i thought we had fixed the trailing newline

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, chonker is still on 1.7.5

## 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still not sure if "offline use" is really the primary differentiator.
"Offline" is not qualified enough, ie. anything requiring resolution naturally still requires you to be "online".
Its also kind of what you'd expect assuming consistent behaviour between Floxhub envs and local envs.
Being able to do stuff offline or air-gapped is also a pretty specific usecase focusing on which feels somewhat narrow.

Suggested change
This allows you to use FloxHub environments offline if a cached copy exists.
This means changes to the environment can be tested locally without affecting other users of the environment.
It also allows you to activate FloxHub environments without an active connection to FloxHub.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are aiming to allow people to use Flox offline (plane, train, etc when no wifi etc is available), right? I thought this was highlighting why you would want a local copy...? Perhaps not all our (relevant) commands though have been updated to work when offline?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the primary differentiator is

I no longer have to do a fetch from FloxHub for every command that uses a -r flag because I can make use of a copy of the environment that already exists on my machine.

One use for that is working offline. Another use is testing out local changes.

I would put money on opinions and use cases for this feature being (in order):

  • I don't care what's happening behind the scenes, but flox activate -r is much faster now.
  • If I'm on a plane or the subway I can flox activate -r without internet access.
  • Let me test out some local changes before pushing.

Comment on lines +53 to +54
- A cached copy transparently managed by Flox
- Fetch this manually via `flox pull --reference <owner>/<name>`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion nonblocking: I think we should add that we do an implicit pull for any command that uses --reference

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that a pull that moves the local copy forward?


## Getting a FloxHub environment

Once you've pushed an environment to FloxHub, you can then use the [`flox pull`][flox-pull] command to fetch a copy of the environment to your machine.
Copy link
Contributor

@robinbrantley robinbrantley Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once you've pushed an environment to FloxHub, you can then use the [flox pull][flox-pull] command to fetch a copy of the environment to your machine.

As you have just described pushing it to FloxHub, it doesn't make much sense to pull it right back to the same place. Perhaps you could say

Once you've pushed an environment to FloxHub, you or others can then use the [flox pull][flox-pull] command to fetch (or update) a copy of the environment to your/their machine.

Or something more to emphasise different people, different machines...?

Also, do we want to start using the flox pull -r instead of just flox pull or do we plan to do that later? I know both will work now but in the future when you do flox init -r, flox pull should error and recommend flox pull -r, right? And what would happen now for those who didn't create the env but pulled it to their machine without having the directory? Wouldn't it error as flox pull currently assumes flox pull -d behaviour?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, do we want to start using the flox pull -r instead of just flox pull or do we plan to do that later?

I'm just referring to generic flox pull command here, not a specific usage of it. I don't understand having a timeline attached to that.

in the future when you do flox init -r, flox pull should error and recommend flox pull -r, right?

I haven't heard anything about that being an error, and I don't think it should be an error. To me, flox init -r creates an upstream copy on FloxHub and a local copy. At that point it's like any other FloxHub environment, so I don't see why pulling it into a directory (which is what flox pull <env> does) would be an error.

And what would happen now for those who didn't create the env but pulled it to their machine without having the directory?

I'm not sure what this is asking. What do you mean "without having the directory"?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I understand it:

when you do a flox pull -r to get an env from floxhub you don't have on your machine yet, no directory is needed and the manifest, etc is magically / transparently managed by Flox (the user doesn't need to worry or know where the .flox stuff in located locally).

when you do a flox pull which I understand is the same as flox pull -d, the manifest, etc is located in the .flox folder in the pre-defined/pre-created directory. But if they haven't created that directory, and they run flox pull will this then error? Otherwise how does flox pull know where to put/find the .flox stuff?


<!-- markdownlint-disable MD007 -->
- A cached copy transparently managed by Flox
- Fetch this manually via `flox pull --reference <owner>/<name>`
Copy link
Contributor

@robinbrantley robinbrantley Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--reference

can we also include the -r option here?

- 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/--directory` flag
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we explicitly note the default assumption here when -d isn't included?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what you're asking. There's bullets for both the default case (current directory) and the specific directory case (-d).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am saying doesn't flox pull <owner>/<name> assume flox pull / -d
(ie if the -d flag isn't given it is assuming the current directory by default)

- Specify a different directory with the `-d/--directory` flag
<!-- markdownlint-enable MD007 -->

This cached copy is created and managed by the Flox CLI.
Copy link
Contributor

@robinbrantley robinbrantley Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which copy are we now referring to? you note 2 copies above but then start giving more info on the "cache" one (undefined) so it isn't obviously clear.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two options above:

  • Cached copy
  • Materialized copy

So when I say "This cached copy" I'm referring to the first of the two options, which says "cached copy".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, this wasn't clear to me and it isn't clear to me how that relates to the local vs upstream just defined immediately before this. I just think the definition and transition needs to be improved for a user to follow. And it isn't clear to me which copy the last sentence in this section pertains to - both the cached and the materialised copies?

This cached copy is created and managed by the Flox CLI.
Additionally, the Flox CLI will automatically fetch updates from FloxHub (without automatically applying them) so that the locally cached copy of the environment has up to date knowledge of the upstream state.

The upstream state of the environment can be fetched manually via the `flox pull (-r | --reference) <owner>/<name>` command.
Copy link
Contributor

@robinbrantley robinbrantley Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like we are interweaving info for the 2 versions which is confusing.
And I don't know which the "cached" copy is and not previously defined. "Upstream" and "local" were...

Side note - this also makes me ask why we aren't warning re updates for both?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "cached copy" is defined above in the bulleted section.

I'm not sure what this means: "this also makes me ask why we aren't warning re updates for both?"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for both a) floxhub managed envs and b) project envs.
The way it is written is that this only applies to the cached copy.


## Operations on FloxHub environments

CLI commands that interact with FloxHub environments will primarily operate on the cached copy of the environment.
Copy link
Contributor

@robinbrantley robinbrantley Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again the term "cached" - I am assuming as I read this you are meaning the "local" copy? But does it matter if a directory-based version or if a managed floxhub version? Sorry, I am now getting really confused with the terms and types and therefore which command(s) apply. For now I am assuming you are only referring here to the local copy of the managed (floxhub) type of env.

Generation: 2
Timestamp: 2025-12-15 21:04:27 UTC

Remote:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is "remote" the correct word to use here? I would think "FloxHub" would be clearer? Or "source of truth" ;-)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, "remote" isn't the correct word anymore. @mkenigs

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To stop using this environment, type 'exit'
```

The `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):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps add "to synchronise the 2 copies" in this sentence?


- 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

Copy link
Contributor

@robinbrantley robinbrantley Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so revisiting after a full pas through. It seems we have 2 types of copies (upstream vs local) but we also have 2 different use cases (one transparently managed by Flox and no directory is needed, and one created and controlled in a directory via .flox or github, etc). I am thinking these 2 types should also have terms defined here that can then easily be referenced below. Or does the type created and controlled in a directory not fall under the "FloxHub env" type and therefore it is the next section that needs more clarity as we are starting to mix and match?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't really have an external name for a FloxHub environment that has been pulled into a directory. I agree that we should have a name for it since it's a thing that exists. I'd rather not call it out until we know how to talk about it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Internally we refer to these as "managed" environments, but I did a pass over the documentation yesterday and we haven't used it anywhere in the documentation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't really have an external name for a FloxHub environment that has been pulled into a directory. I agree that we should have a name for it since it's a thing that exists. I'd rather not call it out until we know how to talk about it.

yeah, so far though isn't being referred to as a materialised copy in this doc?


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`][gen-hist].
Again, the `--upstream` flag will show you the history as understood by the upstream copy.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

love this.
My only thought though is what happens if I pulled the env into a directory as per the 2nd option under "getting a floxhub env"? Does all this in this section still work as described?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is how to think about it:

When pulled into a directory, flox install, etc (no -r) act as if you had passed -r

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand that comment unfortunately (sorry!) and so I don't understand if the generations and history commands would still work on not.


In order to see the list of packages in the local copy of a FloxHub environment you use the [`flox list -r`][flox-list] command.
Add the `--upstream` flag to see the packages in the upstream copy of the FloxHub environment.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same thought as for the "Generations" section.


Activating a FloxHub environment is done via the [`flox activate -r`][flox-activate] 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`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before running flox activate or flox activate -r? Will both work so it doesn't matter?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before running flox activate -r. Fixed.

Some of the distinctions betweeen when to use `-r` vs `-d` have changed
@github-actions
Copy link

@github-actions
Copy link

@zmitchell zmitchell enabled auto-merge (rebase) December 16, 2025 23:36
@zmitchell zmitchell disabled auto-merge December 16, 2025 23:59
@github-actions
Copy link

@zmitchell zmitchell merged commit 5641265 into main Dec 17, 2025
3 of 5 checks passed
@zmitchell zmitchell deleted the push-pyxstmokpvnr branch December 17, 2025 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants