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 on ctx.meta; the verb’s _cmd calls resolve_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 --help on a verb builds nothing.

otto.cli.host.resolve_cli_host(ctx: Context) RemoteHost

Build the host the otto host callback 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 / --transfer override-copies. An already-resolved ctx.obj is honoured as a fast path.