File size: 542 Bytes
4817bcc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import os
import sys
import typer

cli = typer.Typer()

@cli.command()
def launch_ui(port: int = typer.Option(8080, "--port", "-p")) -> None:
    """Start a graphical UI server for the opyrator.

    The UI is auto-generated from the input- and output-schema of the given function.
    """
    # Add the current working directory to the sys path
    # This is required to resolve the opyrator path
    sys.path.append(os.getcwd())

    from mkgui.base.ui.streamlit_ui import launch_ui
    launch_ui(port)

if __name__ == "__main__":
    cli()