saturnin._scripts.cli

Saturnin CLI manager.

 When invoked without additional parameters, it’s activated in console mode. This mode runs REPL that provides advanced functionality like command and parameter completion, interactive help and persistent command history. The command set available in this mode may differ from command set available in direct mode (see below).

When saturnin is invoked with additional parameters, it executes specified command and exists. Some commands (typically those required to run only once or not very often like initialize or create home) are available only in this direct mode.

Globals

saturnin._scripts.cli.REPL_INTRO

REPL introductory markdown text

saturnin._scripts.cli.REPL_HELP

REPL help text

saturnin._scripts.cli.command_groups: List[Tuple[str, str]]

Standard command groups List of (command name, short help) tuples

Functions

saturnin._scripts.cli.main()[source]

Main entry point for Saturnin CLI manager.

saturnin._scripts.cli.find_group(in_app: Typer, name: str) Typer[source]

Returns sub-command group in command group.

Parameters:
  • in_app (Typer) – Typer instance to be searched.

  • name (str) – Command name.

Return type:

Typer

Returns: Typer instance for command.

saturnin._scripts.cli.add_command(app: Typer, name: str, cmd: Callable, *, help: str | None = None, panel: str | None = None) None[source]

Add command into main Typer application.

Parameters:
  • app (Typer) – Typer instance under which the command should be placed.

  • name (str) – Command name. Can use dot notation to create a sub-command.

  • cmd (Callable) – Callable to be registered as Typer command.

  • help (str | None) – Optional help for command.

  • pabel – Rich panel where command should be listed in help.

  • panel (str | None) –

Return type:

None

saturnin._scripts.cli.cli_loop(*, restart: bool) bool[source]

Main CLI loop via Typer.

Parameters:

restart (bool) – True when CLI was restarted.

Returns:

True if CLI restart is required (to reload commands etc.). False means “normal” end.

Return type:

bool