cli.main¶
Top-level otto CLI: callback, subcommand dispatch, and eager option handlers.
- otto.cli.main.version_callback(version: bool) None¶
Print the otto version string and exit when
--versionis passed.
- otto.cli.main.clear_autocomplete_cache_callback(value: bool) None¶
Delete the shell-completion cache file and exit when the flag is set.
- otto.cli.main.list_labs_callback(value: bool) None¶
Print all available lab names (one panel per repo) and exit when the flag is set.
- otto.cli.main.log_level_callback(value: str) str¶
Normalise the
--log-levelvalue to upper-case before Typer stores it.
- otto.cli.main.main(ctx: ~typer.models.Context, labs: ~types.Annotated[list[str] | None, <typer.models.OptionInfo object at 0x7c9c939187c0>] | None = None, xdir: ~pathlib.Annotated[~pathlib.Path, <typer.models.OptionInfo object at 0x7c9c93919e10>] = PosixPath('.'), debug: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7c9c9391ab00>] = False, log_days: ~typing.Annotated[int, <typer.models.OptionInfo object at 0x7c9c93918b20>] = 30, log_level: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7c9c9391ba00>] = 'INFO', rich_log_file: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7c9c93919840>] = False, show_time: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7c9c93919210>] = False, lab_depth: ~typing.Annotated[int, <typer.models.OptionInfo object at 0x7c9c93918040>] = 3, list_labs: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7c9c93918070>] = False, show_lab: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7c9c93919d80>] = False, list_hosts: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7c9c93918850>] = False, dry_run: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7c9c93919180>] = False, version: ~types.Annotated[bool | None, <typer.models.OptionInfo object at 0x7c9c93919bd0>] | None = None, clear_autocomplete_cache: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7c9c93918d90>] = False, as_user: ~types.Annotated[str | None, <typer.models.OptionInfo object at 0x7c9c9391b580>] | None = None, skip_reservation_check: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7c9c939194e0>] = False) None¶
Load the lab, initialise logging, check reservations, and install the runtime context.
This is the Typer root callback executed before every
ottosubcommand. Lab-free subcommands (e.g.otto schema) skip the lab/reservation bootstrap; all others require--laband build anOttoContext.