Skip to content

Run the full activation lifecycle in 'hermit env --activate' - #601

Open
joahg wants to merge 1 commit into
cashapp:masterfrom
joahg:joah/env-activate-lifecycle
Open

Run the full activation lifecycle in 'hermit env --activate'#601
joahg wants to merge 1 commit into
cashapp:masterfrom
joahg:joah/env-activate-lifecycle

Conversation

@joahg

@joahg joahg commented Aug 5, 2026

Copy link
Copy Markdown

Context: #597 — composing agent-skills-style content packages from existing Hermit primitives.

hermit activate installs install-on-activate packages and runs on activate triggers before emitting environment variables, but hermit env --activate — used by the shell hooks in activate.tmpl.sh/activate.tmpl.fish when the environment changes, and commonly by CI via eval $(hermit env --activate) — only computed and applied the envar operations. The two activation paths could therefore drift: packages and triggers were skipped entirely on the env --activate path.

This extracts the shared lifecycle into Env.Activate and uses it from both paths. Trigger messages are printed to stderr on the env --activate path since stdout is reserved for shell commands.

Tested with go test ./... and golangci-lint run.

'hermit activate' installs install-on-activate packages and runs
'on activate' triggers before emitting environment variables, but
'hermit env --activate' - used by the shell hooks in
activate.tmpl.sh/activate.tmpl.fish when the environment changes, and
commonly by CI via 'eval $(hermit env --activate)' - only computed and
applied the envar operations. The two activation paths could therefore
drift: packages and triggers were skipped entirely on the env --activate
path.

Extract the shared lifecycle into Env.Activate and use it from both
paths. Trigger messages are printed to stderr on the env --activate path
since stdout is reserved for shell commands.

Buzz-Message: buzz://message?channel=573ff355-6c19-422d-b425-112853d0ec7e&id=16f5b666c0976829a1985868753407c7b20b393d89f99a8b39106be9fe6a1514
Amp-Thread-ID: https://ampcode.com/threads/T-019fce27-e59e-727c-b6d3-cdeeba894a4e
Co-authored-by: Amp <amp@ampcode.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant