Skip to content

main

main()

Main entry point for the CLI application.

Source code in cli/__main__.py
26
27
28
29
30
31
32
33
def main():
    """
    Main entry point for the CLI application.
    """
    register_commands(cli_app)
    cli_app(prog_name="hestia-cli")

    sys.exit()

register_commands(app)

Registers the available commands in the CLI application.

Parameters:

Name Type Description Default
app typer.Typer

The Typer application to register the commands with.

required
Source code in cli/__main__.py
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
def register_commands(app: typer.Typer):
    """
    Registers the available commands in the CLI application.
    :param app: The Typer application to register the commands with.
    """
    modules = [
        db,
        docs,
        server,
    ]

    for m in modules:
        commands = getattr(m, "commands", [])
        for cmd in commands:
            app.command()(cmd)