enrich local logger (#2605)

This commit is contained in:
Shuchang Zheng
2025-06-05 07:01:46 -07:00
committed by GitHub
parent ee0302171e
commit 71bba769ef
5 changed files with 46 additions and 58 deletions

View File

@@ -8,7 +8,6 @@ __all__ = [
"tasks_app",
"docs_app",
"status_app",
"stop_app",
"init_app",
]
@@ -17,6 +16,5 @@ from .docs import docs_app
from .quickstart import quickstart_app
from .run_commands import run_app
from .status import status_app
from .stop_commands import stop_app
from .tasks import tasks_app
from .workflow import workflow_app

View File

@@ -6,7 +6,6 @@ from .init_command import init, init_browser
from .quickstart import quickstart_app
from .run_commands import run_app
from .status import status_app
from .stop_commands import stop_app
from .tasks import tasks_app
from .workflow import workflow_app
@@ -24,7 +23,6 @@ cli_app.add_typer(workflow_app, name="workflow", help="Workflow management comma
cli_app.add_typer(tasks_app, name="tasks", help="Task management commands.")
cli_app.add_typer(docs_app, name="docs", help="Open Skyvern documentation.")
cli_app.add_typer(status_app, name="status", help="Check if Skyvern services are running.")
cli_app.add_typer(stop_app, name="stop", help="Stop Skyvern services like the API server.")
init_app = typer.Typer(
invoke_without_command=True,
help="Interactively configure Skyvern and its dependencies.",

View File

@@ -1,31 +0,0 @@
import typer
from rich.panel import Panel
from rich.prompt import Confirm
from skyvern.config import settings
from .console import console
from .run_commands import get_pids_on_port, kill_pids
stop_app = typer.Typer(help="Stop Skyvern services like the API server.")
@stop_app.command(name="server")
def stop_server(
force: bool = typer.Option(False, "--force", "-f", help="Force kill without confirmation"),
) -> None:
"""Stop the Skyvern API server running on the configured port."""
port = settings.PORT
console.print(f"[bold green]Checking for process on port {port}...[/bold green]")
pids = get_pids_on_port(port)
if not pids:
console.print(f"[yellow]No process found running on port {port}.[/yellow]")
return
if not force:
prompt = f"Process{'es' if len(pids) > 1 else ''} running on port {port}. Kill them?"
confirm = Confirm.ask(prompt)
if not confirm:
console.print("[yellow]Server not stopped.[/yellow]")
return
kill_pids(pids)
console.print(Panel(f"Stopped server on port {port}", border_style="red"))