From b7821b6dc1b67524ce993faaf63057b6a6b0bb22 Mon Sep 17 00:00:00 2001 From: teknium1 Date: Tue, 3 Mar 2026 19:30:05 -0800 Subject: [PATCH] enhance: improve gateway setup messaging and service installation prompts Updated the gateway setup function to provide clearer messaging regarding the installation status of the gateway service. Added prompts for installing the service as a background process on supported platforms (Linux and macOS) and clarified next steps for users. Improved user experience by offering options to start the service immediately or run it in the foreground. --- hermes_cli/gateway.py | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/hermes_cli/gateway.py b/hermes_cli/gateway.py index 0f32e49a..8dbbd479 100644 --- a/hermes_cli/gateway.py +++ b/hermes_cli/gateway.py @@ -589,8 +589,8 @@ def gateway_setup(): except subprocess.CalledProcessError as e: print_error(f" Failed to start: {e}") else: - print_info("Gateway service is not installed.") - print_info("You can install it after configuring platforms: hermes gateway install") + print_info("Gateway service is not installed yet.") + print_info("You'll be offered to install it after configuring platforms.") # ── Platform configuration loop ── while True: @@ -651,9 +651,33 @@ def gateway_setup(): print_error(f" Start failed: {e}") else: print() - print_info("Next steps:") - print_info(" hermes gateway Run in foreground") - print_info(" hermes gateway install Install as background service") + if is_linux() or is_macos(): + platform_name = "systemd" if is_linux() else "launchd" + if prompt_yes_no(f" Install the gateway as a {platform_name} service? (runs in background, starts on boot)", True): + try: + force = False + if is_linux(): + systemd_install(force) + else: + launchd_install(force) + print() + if prompt_yes_no(" Start the service now?", True): + try: + if is_linux(): + systemd_start() + else: + launchd_start() + except subprocess.CalledProcessError as e: + print_error(f" Start failed: {e}") + except subprocess.CalledProcessError as e: + print_error(f" Install failed: {e}") + print_info(" You can try manually: hermes gateway install") + else: + print_info(" You can install later: hermes gateway install") + print_info(" Or run in foreground: hermes gateway") + else: + print_info(" Service install not supported on this platform.") + print_info(" Run in foreground: hermes gateway") else: print() print_info("No platforms configured. Run 'hermes gateway setup' when ready.")