Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(devex): expose hogli on PATH in non-interactive flox shells (#79705)

Georges-Antoine Assi70ab6f610f6e
diff --git a/.flox/env/on-activate.sh b/.flox/env/on-activate.sh
index b8f2828c867d..e88fadbc1e1d 100755
--- a/.flox/env/on-activate.sh
+++ b/.flox/env/on-activate.sh
@@ -224,6 +224,12 @@ export GOMODCACHE="$GOPATH/pkg/mod"
# can't expand $FLOX_ENV_CACHE). Used below for uv sync + the hogli symlink.
export UV_PROJECT_ENVIRONMENT="$FLOX_ENV_CACHE/venv"
+# In `flox activate -- <cmd>` mode, Flox does not source [profile], so the uv venv
+# is not on PATH. Add it here so non-interactive commands can find hogli and
+# Python tooling.
+if [[ "$_interactive" != true ]] && [[ ":$PATH:" != *":$UV_PROJECT_ENVIRONMENT/bin:"* ]]; then
+ export PATH="$UV_PROJECT_ENVIRONMENT/bin:$PATH"
+fi
# ── Direnv first-time setup (interactive only) ─────────────────────
if [[ "$_interactive" == true ]] && ! command -v direnv >/dev/null 2>&1 && [[ ! -f "$FLOX_ENV_CACHE/.hush-direnv" ]]; then
read -p "$(echo -e "${C_BOLD}direnv${C_RESET} recommended for auto-activation. Set up now? (Y/n) ")" -n 1 -r