yera.cli.commands.dev

Dev commands: run a dev server.

Symbols

def dev — Run a local app development environment.

dev

dev(
    directory: Annotated[str | None, Parameter(help='Root directory for app discovery. Falls back to [tool.yera] apps_dir in pyproject.toml, then cwd.')] = None,
    port: Annotated[int, Parameter(help='Bind port.')] = 8991,
    host: Annotated[str, Parameter(help='Bind address (not a URL).')] = '127.0.0.1',
    hub: Annotated[str | None, Parameter(help='Hub name override to deploy.')] = None,
    log_events: Annotated[bool, Parameter(help='Stream raw events to stdout.')] = False,
    browser: Annotated[bool, Parameter(help='Open the dev UI in a browser on startup.')] = True,
    dev_ui: Annotated[bool, Parameter(help='Enable the experimental dev UI.')] = False,
    ctx: Annotated[AppContext, Parameter(parse=False, show=False)],
) → None

Run a local app development environment.

Discovers all apps under --directory, starts the Yera dev server, and opens the UI in a browser. The server runs until interrupted (Ctrl-C).

app discovery walks the directory tree downward from --directory (default: cwd), collecting every decorated app it finds. At least one app must be present or the command exits with an error.

Parameters

directory
type: Annotated[str | None, Parameter(help='Root directory for app discovery. Falls back to [tool.yera] apps_dir in pyproject.toml, then cwd.')] = None

Root directory for app discovery. Resolution order: this flag, then [tool.yera] apps_dir in pyproject.toml (resolved relative to the project root), then the current working directory.

port
type: Annotated[int, Parameter(help='Bind port.')] = 8991

Port to bind the dev server on.

host
type: Annotated[str, Parameter(help='Bind address (not a URL).')] = '127.0.0.1'

Address to bind the dev server on (not a URL — just the hostname or IP, e.g. 127.0.0.1 or 0.0.0.0).

hub
type: Annotated[str | None, Parameter(help='Hub name override to deploy.')] = None

Hub name override used for deploy-from-UI. Resolution order: this flag, then pyproject.toml [tool.yera] hub, then yera.toml [hubs] default.

log_events
type: Annotated[bool, Parameter(help='Stream raw events to stdout.')] = False

Stream raw output events to stdout as they arrive from the app.

browser
type: Annotated[bool, Parameter(help='Open the dev UI in a browser on startup.')] = True

Open the dev UI in the default browser on startup. Pass --no-browser to suppress.

dev_ui
type: Annotated[bool, Parameter(help='Enable the experimental dev UI.')] = False

Enable the experimental dev UI. When set, the server expects a separately running UI dev server at http://localhost:3000 instead of serving the bundled UI itself. Useful when iterating on the UI alongside app code.