prefect.cli.server

Command line interface for working with the Prefect API and server.

Functions

generate_welcome_blurb

generate_welcome_blurb(base_url: str, ui_enabled: bool) -> str

prestart_check

prestart_check(base_url: str) -> None

Check if PREFECT_API_URL is set in the current profile. If not, prompt the user to set it.

Args:

  • base_url: The base URL the server will be running on

start

start(host: str = SettingsOption(PREFECT_SERVER_API_HOST), port: int = SettingsOption(PREFECT_SERVER_API_PORT), keep_alive_timeout: int = SettingsOption(PREFECT_SERVER_API_KEEPALIVE_TIMEOUT), log_level: str = SettingsOption(PREFECT_SERVER_LOGGING_LEVEL), scheduler: bool = SettingsOption(PREFECT_API_SERVICES_SCHEDULER_ENABLED), analytics: bool = SettingsOption(PREFECT_SERVER_ANALYTICS_ENABLED, '--analytics-on/--analytics-off'), late_runs: bool = SettingsOption(PREFECT_API_SERVICES_LATE_RUNS_ENABLED), ui: bool = SettingsOption(PREFECT_UI_ENABLED), no_services: bool = typer.Option(False, '--no-services', help='Only run the webserver API and UI'), background: bool = typer.Option(False, '--background', '-b', help='Run the server in the background'))

Start a Prefect server instance

run_manager_process

run_manager_process()

This is an internal entrypoint used by prefect server services start --background. Users do not call this directly.

We do everything in sync so that the child won’t exit until the user kills it.

list_services

list_services()

List all available services and their status.

start_services

start_services(background: bool = typer.Option(False, '--background', '-b', help='Run the services in the background'))

Start all enabled Prefect services in one process.