cli.host¶
otto host — run commands, transfer files, and log in to lab hosts.
Commands are synthesised dynamically from @cli_exposed methods on the
resolved host’s class — see otto.cli.expose.
- otto.cli.host.main(ctx: ~typer.models.Context, host_id: ~typing.Annotated[str, <typer.models.ArgumentInfo object at 0x73017978e440>] = '', hop: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x73017978f2e0>] = '', term: ~types.Annotated[str | None, <typer.models.OptionInfo object at 0x73017978f460>] | None = None, transfer: ~types.Annotated[str | None, <typer.models.OptionInfo object at 0x73017978f640>] | None = None, list_hosts: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x73017978f6d0>] = False) None¶
Record the host request; the resolved host is built lazily by the leaf verb.
The host can no longer be built here: the lab loads lazily in the leaf-invoke
command_preamble(), which runs after this group callback. So this callback only stashes the raw inputs onctx.meta; the verb’s_cmdcallsresolve_cli_host()once the lab is ready. Output-dir creation and the reservation gate likewise moved to the preamble (per-verb output dir keyed off each verb’s__cli_output_dir__marker), so a--helpon a verb builds nothing.
- otto.cli.host.resolve_cli_host(ctx: Context) RemoteHost¶
Build the host the
otto hostcallback recorded (lab is ready by now).Reproduces the construction the callback used to do inline: resolve the host by ID, validate/attach a
--hop, and apply--term/--transferoverride-copies. An already-resolvedctx.objis honoured as a fast path.