cli

Internal CLI exposed to Python.

Index

Classes

ExtContext

External command context

ExternalCommand

An external CLI command that may be invoked by the command line argument parser.

Interactive

Options for the interactive command.

Functions

main

Entry point to internal Syside CLI. Returns exit code on completion.


󰊕 Functions

main(args: Sequence[str], interactive: Callable[[syside.cli.Interactive], int] | None = None, external: Sequence[syside.cli.ExternalCommand] = ()) int

Entry point to internal Syside CLI. Returns exit code on completion.

args must either be <syside> args... or <python> -m <syside> args..., i.e. they must be the same as called from the command line, e.g. sys.argv.

The interactive argument is used to provide Python implementation for the interactive command.

Raises anything interactive or external may raise if executed.

The server command will use underlying native stdin and stdout streams directly, any modifications to sys.stdout and sys.stdin will not be propagated.

Warning

Multiple threads running server command simultaneously are not supported as it overrides global exit and error hooks. If multiple servers are needed, run them in separate processes.