Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.

[Exploration] docs: auto-activation concept page and cross-links#456

Draft
djsauble wants to merge 24 commits into
mainfrom
docs/auto-activation
Draft

[Exploration] docs: auto-activation concept page and cross-links#456
djsauble wants to merge 24 commits into
mainfrom
docs/auto-activation

Conversation

@djsauble
Copy link
Copy Markdown
Contributor

@djsauble djsauble commented Mar 27, 2026

Summary

Adds documentation for the direnv support project (https://linear.app/floxdotdev/project/direnv-support-328f1799fe33):

  • New concept page (docs/concepts/auto-activation.md) covering:
    • Enabling auto-activation with shell RC file setup (bash, zsh, fish, tcsh) — two paths: with default environment (flox activate) and without (flox hook), plus a 3-command comparison table
    • How the shell hook lifecycle works (discovery, eligibility check, activation, deactivation)
    • Auto-activation preference— flox allow / flox deny commands, interactive prompt for unregistered environments, single preference record per env
    • Global auto_activate config option ("prompt" / "never") supporting phased rollout
    • Nested environments (outermost-first ordering)
    • Deactivation behavior (layer peeling)
    • Interaction with manual activation
    • Comparison table describing differences between manual (subshell) and auto-activation

Do not merge

This PR should not be merged until we've implemented the auto-activation feature. There's a prototype at flox/flox#4117 but the goal isn't to merge this directly.

Add documentation for the auto-activation feature (flox/flox#4117):

- New concept page explaining auto-activation lifecycle, trust model,
  nested environments, deactivation, and hook state variables
- Add note admonition and section in activation concept page
- Add note admonition in default environment tutorial
- Add auto-activation to mkdocs nav

Man pages for `flox allow`, `flox revoke`, and `flox deactivate` will
be generated from CLI source once the feature ships. Edits to the
`flox activate` and `flox` man pages must happen in flox/flox.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Mar 27, 2026
@djsauble djsauble self-assigned this Mar 27, 2026
djsauble and others added 3 commits March 26, 2026 19:32
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add a "Comparison with manual activation" section with a table
covering trigger, activation mode, services, trust, deactivation,
multiple environments, hook.on-activate, and error handling
differences.

Clarify that auto-activation starts all manifest services
automatically (unlike flox activate which requires --start-services).

Add admonitions for activation mode limitation and hook.on-activate
subprocess isolation behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Correct three inaccuracies identified during code review:
- Hook installation applies to all eval-mode invocations, not just bare `flox activate`
- Subshell exclusion applies to all subshell activations, not just `-d`/`-r`
- Default environment section now explains the old `-r` pattern still works and gets auto-activation for free, and clarifies `eval "$(flox activate)"` doesn't fetch from FloxHub

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@djsauble djsauble changed the title docs: auto-activation concept page and cross-links [Exploration] docs: auto-activation concept page and cross-links Mar 27, 2026
Comment thread docs/concepts/auto-activation.md Outdated
Comment thread docs/concepts/auto-activation.md Outdated
Comment thread docs/concepts/auto-activation.md Outdated
Comment thread docs/concepts/auto-activation.md Outdated
Comment thread docs/concepts/auto-activation.md Outdated
Comment thread docs/concepts/auto-activation.md Outdated
Comment thread docs/concepts/auto-activation.md Outdated
Comment thread docs/concepts/auto-activation.md
Comment thread docs/concepts/activation.md
Comment thread docs/concepts/auto-activation.md Outdated
Comment thread docs/concepts/activation.md
djsauble and others added 7 commits March 31, 2026 14:18
Co-authored-by: Matthew Kenigsberg <matthew@floxdev.com>
Co-authored-by: Matthew Kenigsberg <matthew@floxdev.com>
Co-authored-by: Matthew Kenigsberg <matthew@floxdev.com>
Co-authored-by: Matthew Kenigsberg <matthew@floxdev.com>
Co-authored-by: Matthew Kenigsberg <matthew@floxdev.com>
Co-authored-by: Matthew Kenigsberg <matthew@floxdev.com>
- Document 3-command model: eval "$(flox activate)", flox activate, eval "$(flox hook)"
- Update trust model to latest-decision-wins (timestamp-based)
- Update services to use manifest config option instead of auto-start
- Unify deactivation around flox deactivate, clarify innermost-only constraint
- Remove hook.on-activate isolated subprocess note (profile scripts run consistently)
- Update comparison table (add Deactivation row, remove hook.on-activate/Services rows)
- Add "Why auto-activation instead of direnv?" section to activation.md

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment thread docs/concepts/activation.md Outdated
Comment thread docs/concepts/auto-activation.md
Comment thread docs/concepts/auto-activation.md Outdated
Comment thread docs/concepts/auto-activation.md Outdated
Comment thread docs/concepts/auto-activation.md Outdated
Comment thread docs/concepts/auto-activation.md Outdated
Comment thread docs/concepts/auto-activation.md Outdated
Comment thread docs/concepts/auto-activation.md Outdated
Comment thread docs/concepts/auto-activation.md Outdated
@djsauble djsauble requested a review from mkenigs April 2, 2026 17:39
Comment thread docs/concepts/auto-activation.md Outdated
Comment thread docs/concepts/auto-activation.md Outdated
Comment thread docs/concepts/auto-activation.md Outdated
Comment thread docs/concepts/auto-activation.md Outdated
Comment thread docs/concepts/auto-activation.md Outdated
Comment thread docs/concepts/auto-activation.md Outdated
Comment thread docs/concepts/auto-activation.md Outdated
Comment thread docs/concepts/auto-activation.md Outdated
djsauble and others added 6 commits April 2, 2026 15:21
Co-authored-by: Matthew Kenigsberg <matthew@floxdev.com>
Co-authored-by: Matthew Kenigsberg <matthew@floxdev.com>
Co-authored-by: Matthew Kenigsberg <matthew@floxdev.com>
Co-authored-by: Matthew Kenigsberg <matthew@floxdev.com>
- Rename flox enable/disable to flox allow/deny (mirrors direnv)
- Remove hallucinated trust/security content; simplify to single
  eligibility check (whether auto-activation is allowed)
- Cut "always" from auto_activate config; default to "never"
- Use flox activate -D for default environment examples
- Move command descriptions above comparison table; use
  in-place/subshell terminology
- Remove redundant "Relationship to default environment" section
- Add auto-activation preference storage path
- Note that "never" config disables hook installation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment thread docs/concepts/auto-activation.md
Comment thread docs/concepts/auto-activation.md Outdated
Comment thread docs/concepts/auto-activation.md Outdated
Comment thread docs/concepts/auto-activation.md Outdated
Comment thread docs/concepts/auto-activation.md Outdated
Comment thread docs/concepts/auto-activation.md Outdated
Comment thread docs/concepts/auto-activation.md
Comment thread docs/concepts/auto-activation.md Outdated
Co-authored-by: Daniel Sauble <daniel@flox.dev>
@djsauble djsauble requested a review from mkenigs April 3, 2026 19:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants