From 7ce183c78707aa63bc5782dfb875af99395f9431 Mon Sep 17 00:00:00 2001 From: Prakash Maheshwaran <73785492+Prakashmaheshwaran@users.noreply.github.com> Date: Wed, 2 Jul 2025 13:10:26 -0400 Subject: [PATCH] Add CLI stop all command (#2777) --- skyvern/cli/stop_commands.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/skyvern/cli/stop_commands.py b/skyvern/cli/stop_commands.py index d58198ef..87df0c41 100644 --- a/skyvern/cli/stop_commands.py +++ b/skyvern/cli/stop_commands.py @@ -63,6 +63,29 @@ def kill_pids(pids: List[int], service_name: str) -> bool: return killed_any +@stop_app.command(name="all") +def stop_all() -> None: + """Stop all Skyvern services running on ports 8000, 8080, and 9090.""" + console.print(Panel("[bold red]Stopping All Skyvern Services...[/bold red]", border_style="red")) + + # Stop processes on port 8000 (API server) + pids_8000 = get_pids_on_port(8000) + killed_8000 = kill_pids(pids_8000, "Skyvern API server (port 8000)") + + # Stop processes on port 8080 (UI server) + pids_8080 = get_pids_on_port(8080) + killed_8080 = kill_pids(pids_8080, "Skyvern UI server (port 8080)") + + # Stop processes on port 9090 (UI server) + pids_9090 = get_pids_on_port(9090) + killed_9090 = kill_pids(pids_9090, "Skyvern UI server (port 9090)") + + if killed_8000 or killed_8080 or killed_9090: + console.print("[green]🛑 All Skyvern services stopped successfully.[/green]") + else: + console.print("[yellow]No Skyvern services found running on ports 8000, 8080, or 9090.[/yellow]") + + @stop_app.command(name="ui") def stop_ui() -> None: """Stop the Skyvern UI servers running on ports 8080 and 9090."""