diff --git a/hermes_cli/gateway.py b/hermes_cli/gateway.py index dc988fa40f2..f85573634af 100644 --- a/hermes_cli/gateway.py +++ b/hermes_cli/gateway.py @@ -12,6 +12,14 @@ import shlex import shutil import signal import subprocess + +# Ensure /bin and /usr/bin are on PATH so launchctl/systemctl are discoverable +# when running under UV's bundled Python which ships a minimal PATH. +_sys_dirs = {"/bin", "/usr/bin", "/usr/sbin", "/sbin"} +_path_dirs = set(os.environ.get("PATH", "").split(os.pathsep)) +_missing = _sys_dirs - _path_dirs +if _missing: + os.environ["PATH"] = os.environ.get("PATH", "") + os.pathsep + os.pathsep.join(sorted(_missing)) import sys import textwrap import time