You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🤖 feat: add MUX_ env vars to all bash spawns (#935)
Set MUX_PROJECT_PATH, MUX_RUNTIME, and MUX_WORKSPACE_NAME environment
variables in both init hooks and bash tool executions for parity.
## Changes
- Add `getMuxEnv()` function to centralize env var creation
- Add `muxEnv` field to `ToolConfiguration`, used by bash tool
- Refactor `runInitHook` to receive muxEnv from caller (no duplication)
- Add tests for muxEnv injection in bash tool
## Environment Variables
| Variable | Description |
|----------|-------------|
| `MUX_PROJECT_PATH` | Path to the original project/git repo |
| `MUX_RUNTIME` | Runtime type: `local`, `worktree`, or `ssh` |
| `MUX_WORKSPACE_NAME` | Name of the workspace (branch name) |
_Generated with `mux`_
Copy file name to clipboardExpand all lines: docs/init-hooks.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,13 +32,14 @@ The init script runs in the workspace directory with the workspace's environment
32
32
33
33
## Environment Variables
34
34
35
-
Init hooks receive the following environment variables:
35
+
Init hooks receive the following environment variables (also available in all agent bash tool executions):
36
36
37
37
-`MUX_PROJECT_PATH` - Absolute path to the project root on the **local machine**
38
38
- Always refers to your local project path, even on SSH workspaces
39
39
- Useful for logging, debugging, or runtime-specific logic
40
-
-`MUX_RUNTIME` - Runtime type: `"local"` or `"ssh"`
40
+
-`MUX_RUNTIME` - Runtime type: `"local"`, `"worktree"`, or `"ssh"`
41
41
- Use this to detect whether the hook is running locally or remotely
42
+
-`MUX_WORKSPACE_NAME` - Name of the workspace (typically the branch name)
42
43
43
44
**Note for SSH workspaces:** Since the project is synced to the remote machine, files exist in both locations. The init hook runs in the workspace directory (`$PWD`), so use relative paths to reference project files:
0 commit comments