Skip to content

Automate browser based workflows with AI

Make quickstart choose the install path (#5926)

Marc Kelechavadb3a30852bd6
diff --git a/pyproject.toml b/pyproject.toml
index 392a53ed0..dafaeac2a 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "skyvern"
-version = "1.0.35"
+version = "1.0.36"
description = ""
authors = [{ name = "Skyvern AI", email = "[email protected]" }]
requires-python = ">=3.11,<3.14"
diff --git a/skyvern/cli/quickstart.py b/skyvern/cli/quickstart.py
index 49080bb44..b516eb8a1 100644
--- a/skyvern/cli/quickstart.py
+++ b/skyvern/cli/quickstart.py
@@ -2,51 +2,201 @@
import asyncio
import subprocess
+import sys
+from enum import Enum
from pathlib import Path
import typer
from rich.panel import Panel
from rich.progress import Progress, SpinnerColumn, TextColumn
-from rich.prompt import Confirm
+from rich.prompt import Confirm, Prompt
from rich.text import Text
from skyvern.analytics import capture_setup_error, capture_setup_event
from skyvern.cli.console import console
+from skyvern.utils.env_paths import resolve_frontend_env_path
quickstart_app = typer.Typer(help="Quickstart command to set up and run Skyvern with one command.")
+class QuickstartPath(str, Enum):
+ CLOUD = "cloud"
+ LOCAL = "local"
+ SERVER = "server"
+
+
def _has_server_quickstart_extra() -> bool:
from skyvern.exceptions import SkyvernExtraNotInstalled, require_server_extra_modules # noqa: PLC0415
try:
- require_server_extra_modules("skyvern quickstart", ("uvicorn",))
+ require_server_extra_modules("skyvern quickstart", ("uvicorn", "fastmcp"))
+ except SkyvernExtraNotInstalled:
+ return False
+ return True
+
+
+def _has_local_quickstart_extra() -> bool:
+ from skyvern.exceptions import SkyvernExtraNotInstalled, require_local_extra_modules # noqa: PLC0415
+
+ try:
+ require_local_extra_modules("skyvern quickstart")
except SkyvernExtraNotInstalled:
return False
return True
-def _print_install_path_guidance() -> None:
- message = """Choose the Skyvern path for what you want to do:
+def _is_interactive_input() -> bool:
+ return sys.stdin.isatty()
+
-Cloud/API SDK
- You already have this with `pip install skyvern`.
- No quickstart is required. Use `Skyvern(api_key=...)` or run `skyvern setup` for cloud MCP.
+def _default_quickstart_path(*, has_local_extra: bool, has_server_extra: bool) -> QuickstartPath:
+ if has_server_extra:
+ return QuickstartPath.SERVER
+ if has_local_extra:
+ return QuickstartPath.LOCAL
+ return QuickstartPath.CLOUD
-Embedded local Python SDK
- Install: pip install "skyvern[local]"
- Then: python -m playwright install chromium
- Use: Skyvern.local(use_in_memory_db=True)
- This path does not require Postgres, Docker, migrations, or `skyvern run server`.
-Self-hosted local server
- Install: pip install "skyvern[server]"
- Then rerun: skyvern quickstart
- This path sets up the local server, database, local API key, MCP, and optional UI.
+_QUICKSTART_PATH_CHOICES = {
+ "1": QuickstartPath.CLOUD,
+ "cloud": QuickstartPath.CLOUD,
+ "api": QuickstartPath.CLOUD,
+ "2": QuickstartPath.LOCAL,
+ "local": QuickstartPath.LOCAL,
+ "embedded": QuickstartPath.LOCAL,
+ "3": QuickstartPath.SERVER,
+ "server": QuickstartPath.SERVER,
+ "self-hosted": QuickstartPath.SERVER,
+ "selfhosted": QuickstartPath.SERVER,
+}
+
+
+def _parse_quickstart_path(value: str) -> QuickstartPath:
+ choice = _QUICKSTART_PATH_CHOICES.get(value.strip().lower())
+ if choice is None:
+ raise typer.BadParameter("Choose one of: cloud/api, local/embedded, server/self-hosted, 1, 2, or 3.")
+ return choice
+
+
+def _validate_install_type(value: str | None) -> str | None:
+ if value is not None:
+ _parse_quickstart_path(value)
+ return value
+
+
+def _print_quickstart_selector(
+ *,
+ default_path: QuickstartPath,
+ has_local_extra: bool,
+ has_server_extra: bool,
+) -> None:
+ local_status = "installed" if has_local_extra else 'requires `pip install "skyvern[local]"`'
+ server_status = "installed" if has_server_extra else 'requires `pip install "skyvern[server]"`'
+ message = f"""Choose how you want to use Skyvern:
+
+1. Cloud/API SDK usage
+ Status: installed with `pip install skyvern`
+
+2. Embedded local Python SDK via skyvern[local]
+ Status: {local_status}
+
+3. Self-hosted local server via skyvern[server]
+ Status: {server_status}
+
+Default: {default_path.value}
"""
console.print(Panel(Text(message), title="Skyvern Quickstart", border_style="cyan"))
+def _select_quickstart_path(
+ install_type: str | None,
+ *,
+ has_local_extra: bool,
+ has_server_extra: bool,
+) -> QuickstartPath:
+ default_path = _default_quickstart_path(has_local_extra=has_local_extra, has_server_extra=has_server_extra)
+ if install_type is not None:
+ return _parse_quickstart_path(install_type)
+ _print_quickstart_selector(
+ default_path=default_path,
+ has_local_extra=has_local_extra,
+ has_server_extra=has_server_extra,
+ )
+ if not _is_interactive_input():
+ return default_path
+
+ default_choice = {
+ QuickstartPath.CLOUD: "1",
+ QuickstartPath.LOCAL: "2",
+ QuickstartPath.SERVER: "3",
+ }[default_path]
+ while True:
+ try:
+ selected = Prompt.ask(
+ "Choose a quickstart path (1/cloud, 2/local, 3/server)",
+ default=default_choice,
+ )
+ except EOFError:
+ return default_path
+ try:
+ return _parse_quickstart_path(selected)
+ except typer.BadParameter as exc:
+ console.print(f"[red]{exc.message}[/red]")
+
+
+def _server_quickstart_flags_requested(
+ *,
+ no_postgres: bool,
+ database_string: str,
+ skip_browser_install: bool,
+ server_only: bool,
+) -> bool:
+ """Return whether the user supplied options for the Python server setup path."""
+ return no_postgres or bool(database_string) or skip_browser_install or server_only
+
+
+def _print_cloud_guidance() -> None:
+ message = """Cloud/API SDK usage
+
+Installed with: pip install skyvern
+Next command: skyvern setup
+
+Python SDK:
+ from skyvern import Skyvern
+ skyvern = Skyvern(api_key="YOUR_API_KEY")
+
+No local browser, Postgres, Docker, migrations, or server startup is required.
+"""
+ console.print(Panel(Text(message), title="Cloud/API SDK", border_style="cyan"))
+
+
+def _print_local_guidance(*, has_local_extra: bool) -> None:
+ install_line = "Installed: skyvern[local]" if has_local_extra else 'Install: pip install "skyvern[local]"'
+ message = f"""Embedded local Python SDK
+
+{install_line}
+Next command: python -m playwright install chromium
+
+Use:
+ Skyvern.local(use_in_memory_db=True)
+
+This path does not require Postgres, Docker, migrations, or `skyvern run server`.
+"""
+ console.print(Panel(Text(message), title="Embedded Local SDK", border_style="cyan"))
+
+
+def _print_server_guidance() -> None:
+ message = """Self-hosted local server
+
+Install: pip install "skyvern[server]"
+Next: python -m skyvern quickstart
+
+This path sets up the local server, database, local API key, and MCP.
+Wheel installs run the backend only; use a source checkout or Docker Compose for the local UI.
+"""
+ console.print(Panel(Text(message), title="Self-Hosted Server", border_style="cyan"))
+
+
def _browser_install_blocks_startup(init_result: object) -> bool:
browser_install = getattr(init_result, "browser_install", None)
return bool(
@@ -103,8 +253,11 @@ def _run_server_quickstart(
console.print("\n[bold blue]Starting Skyvern services...[/bold blue]")
asyncio.run(start_services(server_only=server_only))
else:
+ start_command = (
+ "skyvern run server" if server_only or resolve_frontend_env_path() is None else "skyvern run all"
+ )
console.print(
- "\n[yellow]Skipping service startup. You can start services later with 'skyvern run all'[/yellow]"
+ f"\n[yellow]Skipping service startup. You can start services later with '{start_command}'[/yellow]"
)
except KeyboardInterrupt:
@@ -290,10 +443,7 @@ def run_docker_compose_setup() -> None:
from skyvern.cli.browser import _print_classic_cdp_instructions # noqa: PLC0415
_print_classic_cdp_instructions()
- confirmed = Confirm.ask(
- "Have you enabled remote debugging in Chrome or started the isolated CDP profile?",
- default=False,
- )
+ confirmed = Confirm.ask("Have you enabled remote debugging in Chrome?", default=False)
if confirmed:
from skyvern.cli.llm_setup import update_or_add_env_var
@@ -304,9 +454,8 @@ def run_docker_compose_setup() -> None:
else:
console.print(
"[yellow]No problem - you can configure it later by setting "
- "BROWSER_TYPE=cdp-connect and enabling Chrome remote debugging from "
- "chrome://inspect/#remote-debugging. If Docker cannot reach that listener, "
- "start an isolated Chrome profile with a Docker-reachable debugging address.[/yellow]"
+ "BROWSER_TYPE=cdp-connect and starting Chrome with a Docker-reachable "
+ "remote debugging address.[/yellow]"
)
@@ -324,10 +473,55 @@ def quickstart(
),
server_only: bool = typer.Option(False, "--server-only", help="Only start the server, not the UI"),
docker_compose: bool = typer.Option(False, "--docker-compose", help="Use Docker Compose for full setup"),
+ install_type: str | None = typer.Option(
+ None,
+ "--install-type",
+ callback=_validate_install_type,
+ help="Choose quickstart path: cloud, local, or server.",
+ ),
) -> None:
"""Quickstart command to set up and run Skyvern with one command."""
# Run initialization
console.print(Panel("[bold green]πŸš€ Starting Skyvern Quickstart[/bold green]", border_style="green"))
+ install_type_value = install_type if isinstance(install_type, str) else None
+
+ has_server_extra = _has_server_quickstart_extra()
+ # The server extra is a superset of the local embedded runtime dependencies.
+ has_local_extra = has_server_extra or _has_local_quickstart_extra()
+ server_flags_requested = _server_quickstart_flags_requested(
+ no_postgres=no_postgres,
+ database_string=database_string,
+ skip_browser_install=skip_browser_install,
+ server_only=server_only,
+ )
+ if docker_compose:
+ selected_path = (
+ QuickstartPath.SERVER if install_type_value is None else _parse_quickstart_path(install_type_value)
+ )
+ if selected_path is not QuickstartPath.SERVER:
+ console.print(
+ Panel(
+ "[bold red]Conflicting quickstart options.[/bold red]\n"
+ "`--docker-compose` starts the self-hosted server stack. "
+ "Use `--install-type server` or omit `--install-type`.",
+ border_style="red",
+ )
+ )
+ raise typer.Exit(1)
+ elif install_type_value is None and server_flags_requested:
+ selected_path = QuickstartPath.SERVER
+ else:
+ selected_path = _select_quickstart_path(
+ install_type_value,
+ has_local_extra=has_local_extra,
+ has_server_extra=has_server_extra,
+ )
+ if selected_path is QuickstartPath.CLOUD:
+ _print_cloud_guidance()
+ raise typer.Exit(0)
+ if selected_path is QuickstartPath.LOCAL:
+ _print_local_guidance(has_local_extra=has_local_extra)
+ raise typer.Exit(0)
# Check if Docker Compose option was explicitly requested or offer choice
docker_compose_available = check_docker_compose_file()
@@ -357,7 +551,7 @@ def quickstart(
return
# If Docker Compose file exists, offer the choice
- if docker_compose_available and check_docker() and not database_string:
+ if docker_compose_available and check_docker() and not server_flags_requested:
console.print("\n[bold blue]Setup Method[/bold blue]")
console.print("Docker Compose file detected. Choose your setup method:\n")
console.print(" [cyan]1.[/cyan] [green]Docker Compose (Recommended)[/green] - Full containerized setup")
@@ -372,8 +566,8 @@ def quickstart(
run_docker_compose_setup()
return
- if not _has_server_quickstart_extra():
- _print_install_path_guidance()
+ if not has_server_extra:
+ _print_server_guidance()
raise typer.Exit(0)
_run_server_quickstart(
diff --git a/skyvern/cli/utils.py b/skyvern/cli/utils.py
index 00167b642..9e62f17d7 100644
--- a/skyvern/cli/utils.py
+++ b/skyvern/cli/utils.py
@@ -5,11 +5,12 @@ import sys
import time
import typer
+from rich.panel import Panel
from rich.progress import Progress, SpinnerColumn, TextColumn
from skyvern.analytics import capture_setup_error, capture_setup_event
from skyvern.cli.console import console
-from skyvern.utils.env_paths import resolve_backend_env_path
+from skyvern.utils.env_paths import resolve_backend_env_path, resolve_frontend_env_path
def wait_for_docker_services(ui_port: int = 8080, api_port: int = 8000, timeout: int = 120) -> bool:
@@ -46,8 +47,22 @@ async def start_services(server_only: bool = False) -> None:
Args:
server_only: If True, only start the server, not the UI.
"""
- capture_setup_event("services-start", extra_data={"server_only": server_only})
try:
+ frontend_env_path = None if server_only else resolve_frontend_env_path()
+ if not server_only and frontend_env_path is None:
+ server_only = True
+ console.print(
+ Panel(
+ "[yellow]No Skyvern frontend runtime was found in this install.[/yellow]\n\n"
+ "Starting the backend API server only. Wheel installs do not include the UI app; "
+ "use a source checkout or Docker Compose when you need the local UI.",
+ title="Backend-only install",
+ border_style="yellow",
+ )
+ )
+
+ capture_setup_event("services-start", extra_data={"server_only": server_only})
+
# Start server in the background
server_process = await asyncio.create_subprocess_exec(
sys.executable, "-m", "skyvern.cli.commands", "run", "server"
@@ -62,7 +77,10 @@ async def start_services(server_only: bool = False) -> None:
capture_setup_event("services-running", success=True, extra_data={"server_only": server_only})
console.print("\nπŸŽ‰ [bold green]Skyvern is now running![/bold green]")
- console.print("🌐 [bold]Access the UI at:[/bold] [cyan]http://localhost:8080[/cyan]")
+ if server_only:
+ console.print("πŸ”Œ [bold]API server:[/bold] [cyan]http://localhost:8000[/cyan]")
+ else:
+ console.print("🌐 [bold]Access the UI at:[/bold] [cyan]http://localhost:8080[/cyan]")
console.print(f"πŸ”‘ [bold]Your API key is in {resolve_backend_env_path()} as SKYVERN_API_KEY[/bold]")
# Wait for processes to complete (they won't unless killed)
diff --git a/tests/unit/test_quickstart_command.py b/tests/unit/test_quickstart_command.py
index 75744ae94..a90672a6c 100644
--- a/tests/unit/test_quickstart_command.py
+++ b/tests/unit/test_quickstart_command.py
@@ -1,5 +1,8 @@
from __future__ import annotations
+from pathlib import Path
+
+import pytest
from typer.testing import CliRunner
import skyvern.cli.quickstart as quickstart_module
@@ -7,25 +10,235 @@ import skyvern.cli.quickstart as quickstart_module
def test_quickstart_without_server_extra_prints_install_paths(monkeypatch) -> None:
monkeypatch.setattr(quickstart_module, "check_docker_compose_file", lambda: False)
+ monkeypatch.setattr(quickstart_module, "_has_local_quickstart_extra", lambda: False)
monkeypatch.setattr(quickstart_module, "_has_server_quickstart_extra", lambda: False)
+ monkeypatch.setattr(quickstart_module, "_is_interactive_input", lambda: False)
result = CliRunner().invoke(quickstart_module.quickstart_app, [])
assert result.exit_code == 0
- assert "Cloud/API SDK" in result.output
+ assert "Cloud/API SDK usage" in result.output
+ assert "Embedded local Python SDK via skyvern[local]" in result.output
+ assert "Self-hosted local server via skyvern[server]" in result.output
+ assert "Next command: skyvern setup" in result.output
+ assert "Skyvern(api_key=" in result.output
assert 'pip install "skyvern[local]"' in result.output
- assert "Skyvern.local(use_in_memory_db=True)" in result.output
assert 'pip install "skyvern[server]"' in result.output
assert "Postgres" in result.output
assert "Missing Dependency" not in result.output
assert "Missing:" not in result.output
+def test_quickstart_with_local_extra_prints_embedded_guidance(monkeypatch) -> None:
+ monkeypatch.setattr(quickstart_module, "check_docker_compose_file", lambda: False)
+ monkeypatch.setattr(quickstart_module, "_has_local_quickstart_extra", lambda: True)
+ monkeypatch.setattr(quickstart_module, "_has_server_quickstart_extra", lambda: False)
+ monkeypatch.setattr(quickstart_module, "_is_interactive_input", lambda: False)
+
+ result = CliRunner().invoke(quickstart_module.quickstart_app, [])
+
+ assert result.exit_code == 0
+ assert "Embedded local Python SDK via skyvern[local]" in result.output
+ assert "Installed: skyvern[local]" in result.output
+ assert "Next command: python -m playwright install chromium" in result.output
+ assert "Skyvern.local(use_in_memory_db=True)" in result.output
+ assert "This path does not require Postgres" in result.output
+ assert "Missing Dependency" not in result.output
+ assert "Missing:" not in result.output
+
+
+def test_quickstart_explicit_local_choice_without_local_extra_prints_install_steps(monkeypatch) -> None:
+ monkeypatch.setattr(quickstart_module, "check_docker_compose_file", lambda: False)
+ monkeypatch.setattr(quickstart_module, "_has_local_quickstart_extra", lambda: False)
+ monkeypatch.setattr(quickstart_module, "_has_server_quickstart_extra", lambda: False)
+ monkeypatch.setattr(quickstart_module, "_is_interactive_input", lambda: False)
+
+ result = CliRunner().invoke(quickstart_module.quickstart_app, ["--install-type", "local"])
+
+ assert result.exit_code == 0
+ assert "Choose how you want to use Skyvern" not in result.output
+ assert 'Install: pip install "skyvern[local]"' in result.output
+ assert "Next command: python -m playwright install chromium" in result.output
+ assert "Skyvern.local(use_in_memory_db=True)" in result.output
+
+
+def test_quickstart_server_flags_select_server_path_without_server_extra(monkeypatch) -> None:
+ monkeypatch.setattr(quickstart_module, "check_docker_compose_file", lambda: False)
+ monkeypatch.setattr(quickstart_module, "_has_local_quickstart_extra", lambda: True)
+ monkeypatch.setattr(quickstart_module, "_has_server_quickstart_extra", lambda: False)
+ monkeypatch.setattr(quickstart_module, "_is_interactive_input", lambda: False)
+
+ result = CliRunner().invoke(
+ quickstart_module.quickstart_app,
+ ["--database-string", "postgresql+psycopg://user/db"],
+ )
+
+ assert result.exit_code == 0
+ assert "Embedded local Python SDK" not in result.output
+ assert "Cloud/API SDK usage" not in result.output
+ assert 'Install: pip install "skyvern[server]"' in result.output
+ assert "Next: python -m skyvern quickstart" in result.output
+
+
+def test_quickstart_explicit_install_type_overrides_server_flags(monkeypatch) -> None:
+ monkeypatch.setattr(quickstart_module, "check_docker_compose_file", lambda: False)
+ monkeypatch.setattr(quickstart_module, "_has_local_quickstart_extra", lambda: True)
+ monkeypatch.setattr(quickstart_module, "_has_server_quickstart_extra", lambda: False)
+ monkeypatch.setattr(quickstart_module, "_is_interactive_input", lambda: False)
+
+ result = CliRunner().invoke(quickstart_module.quickstart_app, ["--install-type", "local", "--server-only"])
+
+ assert result.exit_code == 0
+ assert "Embedded local Python SDK" in result.output
+ assert 'Install: pip install "skyvern[server]"' not in result.output
+
+
+def test_quickstart_server_extra_probe_rejects_local_with_incidental_uvicorn(monkeypatch) -> None:
+ monkeypatch.setattr(
+ "skyvern.exceptions.find_spec",
+ lambda module_name: None if module_name == "fastmcp" else object(),
+ )
+
+ assert quickstart_module._has_server_quickstart_extra() is False
+
+
+def test_quickstart_interactive_server_choice_without_server_extra_prints_install_steps(monkeypatch) -> None:
+ monkeypatch.setattr(quickstart_module, "check_docker_compose_file", lambda: False)
+ monkeypatch.setattr(quickstart_module, "_has_local_quickstart_extra", lambda: False)
+ monkeypatch.setattr(quickstart_module, "_has_server_quickstart_extra", lambda: False)
+ monkeypatch.setattr(quickstart_module, "_is_interactive_input", lambda: True)
+
+ result = CliRunner().invoke(quickstart_module.quickstart_app, [], input="3\n")
+
+ assert result.exit_code == 0
+ assert "Choose a quickstart path" in result.output
+ assert 'Install: pip install "skyvern[server]"' in result.output
+ assert "Next: python -m skyvern quickstart" in result.output
+ assert "local server, database, local API key, and MCP" in result.output
+ assert "Wheel installs run the backend only" in result.output
+
+
+def test_quickstart_interactive_choice_accepts_alias(monkeypatch) -> None:
+ monkeypatch.setattr(quickstart_module, "check_docker_compose_file", lambda: False)
+ monkeypatch.setattr(quickstart_module, "_has_local_quickstart_extra", lambda: False)
+ monkeypatch.setattr(quickstart_module, "_has_server_quickstart_extra", lambda: False)
+ monkeypatch.setattr(quickstart_module, "_is_interactive_input", lambda: True)
+
+ result = CliRunner().invoke(quickstart_module.quickstart_app, [], input="local\n")
+
+ assert result.exit_code == 0
+ assert 'Install: pip install "skyvern[local]"' in result.output
+ assert "Choose a quickstart path" in result.output
+
+
+def test_quickstart_interactive_choice_reprompts_invalid_alias(monkeypatch) -> None:
+ monkeypatch.setattr(quickstart_module, "check_docker_compose_file", lambda: False)
+ monkeypatch.setattr(quickstart_module, "_has_local_quickstart_extra", lambda: False)
+ monkeypatch.setattr(quickstart_module, "_has_server_quickstart_extra", lambda: False)
+ monkeypatch.setattr(quickstart_module, "_is_interactive_input", lambda: True)
+
+ result = CliRunner().invoke(quickstart_module.quickstart_app, [], input="wat\nserver\n")
+
+ assert result.exit_code == 0
+ assert "Choose one of: cloud/api, local/embedded, server/self-hosted, 1, 2, or 3." in result.output
+ assert "Please select a valid option:" not in result.output
+ assert 'Install: pip install "skyvern[server]"' in result.output
+
+
+def test_quickstart_interactive_eof_falls_back_to_default(monkeypatch) -> None:
+ monkeypatch.setattr(quickstart_module, "check_docker_compose_file", lambda: False)
+ monkeypatch.setattr(quickstart_module, "_has_local_quickstart_extra", lambda: True)
+ monkeypatch.setattr(quickstart_module, "_has_server_quickstart_extra", lambda: False)
+ monkeypatch.setattr(quickstart_module, "_is_interactive_input", lambda: True)
+
+ def raise_eof(*_args, **_kwargs) -> str:
+ raise EOFError
+
+ monkeypatch.setattr(quickstart_module.Prompt, "ask", raise_eof)
+
+ result = CliRunner().invoke(quickstart_module.quickstart_app, [])
+
+ assert result.exit_code == 0
+ assert "Installed: skyvern[local]" in result.output
+ assert "Skyvern.local(use_in_memory_db=True)" in result.output
+
+
+def test_quickstart_server_flags_skip_docker_compose_offer_without_server_extra(monkeypatch) -> None:
+ calls = []
+
+ monkeypatch.setattr(quickstart_module, "check_docker", lambda: True)
+ monkeypatch.setattr(quickstart_module, "check_docker_compose_file", lambda: True)
+ monkeypatch.setattr(quickstart_module, "_has_local_quickstart_extra", lambda: False)
+ monkeypatch.setattr(quickstart_module, "_has_server_quickstart_extra", lambda: False)
+ monkeypatch.setattr(quickstart_module, "_is_interactive_input", lambda: False)
+ monkeypatch.setattr(quickstart_module, "run_docker_compose_setup", lambda: calls.append("docker"))
+
+ result = CliRunner().invoke(quickstart_module.quickstart_app, ["--server-only"])
+
+ assert result.exit_code == 0
+ assert "Docker Compose file detected" not in result.output
+ assert 'Install: pip install "skyvern[server]"' in result.output
+ assert calls == []
+
+
+def test_quickstart_server_choice_can_use_docker_compose_without_server_extra(monkeypatch) -> None:
+ calls = []
+
+ monkeypatch.setattr(quickstart_module, "check_docker", lambda: True)
+ monkeypatch.setattr(quickstart_module, "check_docker_compose_file", lambda: True)
+ monkeypatch.setattr(quickstart_module, "_has_local_quickstart_extra", lambda: False)
+ monkeypatch.setattr(quickstart_module, "_has_server_quickstart_extra", lambda: False)
+ monkeypatch.setattr(quickstart_module, "_is_interactive_input", lambda: True)
+ monkeypatch.setattr(quickstart_module, "run_docker_compose_setup", lambda: calls.append("docker"))
+
+ result = CliRunner().invoke(quickstart_module.quickstart_app, [], input="3\ny\n")
+
+ assert result.exit_code == 0
+ assert "Docker Compose file detected" in result.output
+ assert calls == ["docker"]
+ assert 'Install: pip install "skyvern[server]"' not in result.output
+
+
+def test_quickstart_docker_compose_rejects_conflicting_install_type(monkeypatch) -> None:
+ calls = []
+
+ monkeypatch.setattr(quickstart_module, "check_docker", lambda: True)
+ monkeypatch.setattr(quickstart_module, "check_docker_compose_file", lambda: True)
+ monkeypatch.setattr(quickstart_module, "_has_local_quickstart_extra", lambda: True)
+ monkeypatch.setattr(quickstart_module, "_has_server_quickstart_extra", lambda: True)
+ monkeypatch.setattr(quickstart_module, "run_docker_compose_setup", lambda: calls.append("docker"))
+
+ result = CliRunner().invoke(quickstart_module.quickstart_app, ["--docker-compose", "--install-type", "cloud"])
+
+ assert result.exit_code == 1
+ assert "Conflicting quickstart options" in result.output
+ assert "--docker-compose` starts the self-hosted server stack" in result.output
+ assert calls == []
+
+
+def test_quickstart_invalid_install_type_fails_before_welcome_banner(monkeypatch) -> None:
+ monkeypatch.setattr(
+ quickstart_module,
+ "_has_server_quickstart_extra",
+ lambda: (_ for _ in ()).throw(AssertionError("should not enter command body")),
+ )
+
+ result = CliRunner().invoke(quickstart_module.quickstart_app, ["--docker-compose", "--install-type", "wat"])
+
+ assert result.exit_code == 2
+ assert "Starting Skyvern Quickstart" not in result.output
+ assert "Choose one of:" in result.output
+ assert "local/embedded" in result.output
+ assert "server/self-hosted" in result.output
+
+
def test_quickstart_with_server_extra_preserves_existing_flow(monkeypatch) -> None:
calls = []
monkeypatch.setattr(quickstart_module, "check_docker_compose_file", lambda: False)
+ monkeypatch.setattr(quickstart_module, "_has_local_quickstart_extra", lambda: True)
monkeypatch.setattr(quickstart_module, "_has_server_quickstart_extra", lambda: True)
+ monkeypatch.setattr(quickstart_module, "_is_interactive_input", lambda: False)
monkeypatch.setattr(
quickstart_module,
"_run_server_quickstart",
@@ -52,3 +265,47 @@ def test_quickstart_with_server_extra_preserves_existing_flow(monkeypatch) -> No
"server_only": True,
}
]
+
+
+def test_quickstart_docker_compose_bypasses_server_extra_guard(monkeypatch) -> None:
+ calls = []
+
+ monkeypatch.setattr(quickstart_module, "check_docker", lambda: True)
+ monkeypatch.setattr(quickstart_module, "check_docker_compose_file", lambda: True)
+ monkeypatch.setattr(quickstart_module, "_has_local_quickstart_extra", lambda: False)
+ monkeypatch.setattr(quickstart_module, "_has_server_quickstart_extra", lambda: False)
+ monkeypatch.setattr(quickstart_module, "run_docker_compose_setup", lambda: calls.append("docker"))
+
+ result = CliRunner().invoke(quickstart_module.quickstart_app, ["--docker-compose"])
+
+ assert result.exit_code == 0
+ assert calls == ["docker"]
+ assert 'pip install "skyvern[server]"' not in result.output
+
+
+async def test_start_services_without_frontend_runtime_starts_backend_only(monkeypatch) -> None:
+ import skyvern.cli.utils as utils
+
+ commands = []
+
+ class FakeProcess:
+ async def wait(self) -> int:
+ return 0
+
+ async def fake_create_subprocess_exec(*args):
+ commands.append(args)
+ return FakeProcess()
+
+ async def fake_sleep(_seconds: float) -> None:
+ return None
+
+ monkeypatch.setattr(utils, "resolve_frontend_env_path", lambda: None)
+ monkeypatch.setattr(utils, "resolve_backend_env_path", lambda: Path(".env"))
+ monkeypatch.setattr(utils.asyncio, "create_subprocess_exec", fake_create_subprocess_exec)
+ monkeypatch.setattr(utils.asyncio, "sleep", fake_sleep)
+ monkeypatch.setattr(utils, "capture_setup_event", lambda *args, **kwargs: None)
+
+ await utils.start_services()
+
+ assert commands == [(utils.sys.executable, "-m", "skyvern.cli.commands", "run", "server")]
diff --git a/uv.lock b/uv.lock
index 7817bc342..b3a8e4a09 100644
--- a/uv.lock
+++ b/uv.lock
@@ -5499,7 +5499,7 @@ wheels = [
[[package]]
name = "skyvern"
-version = "1.0.35"
+version = "1.0.36"
source = { editable = "." }
dependencies = [
{ name = "cachetools" },