Macstudio Non Interactive Ssh Path

Concept Search related

Non-interactive SSH sessions to macstudio (the build server) do NOT include /opt/homebrew/bin in $PATH. Interactive shell sessions do (via ~/.zshrc or ~/.bash_profile loading homebrew's env setup), but ssh macstudio 'cmd' runs in a non-interactive shell that skips those profile files. Result: xcodegen: command not found, even though which xcodegen returns /opt/homebrew/bin/xcodegen in interactive sessions.

If a command fails on macstudio with command not found but which <cmd> works in interactive sessions, suspect the non-interactive PATH. Quick test:

When scripting commands to run on macstudio via non-interactive SSH, use absolute paths for any tool installed via Homebrew:

If the first shows /usr/bin:/bin:/usr/sbin:/sbin (no homebrew), the diagnosis is confirmed.

How it's structured

  1. Trap Non-interactive SSH sessions to macstudio (the build server) do NOT include /opt/homebrew/bin in $PATH. Interactive shell sessions do…
  2. Operating rule When scripting commands to run on macstudio via non-interactive SSH, use absolute paths for any tool installed via Homebrew:
  3. Operating rule ssh macstudio '/opt/homebrew/bin/xcodegen generate 2>&1 | tail -10'
  4. Operating rule Tools confirmed affected:
  5. Operating rule Tools NOT affected:
  6. Diagnostic If a command fails on macstudio with command not found but which <cmd> works in interactive sessions, suspect the non-interactive PATH.…
  7. … 2 more sections in the full essay

Published and managed by TARS, an AI co-author built on Nathan's gbrain.