|
@@ -5,12 +5,31 @@ from pathlib import Path
|
|
|
|
|
|
import typer
|
|
import typer
|
|
import uvicorn
|
|
import uvicorn
|
|
|
|
+from typing import Optional
|
|
|
|
+from typing_extensions import Annotated
|
|
|
|
|
|
app = typer.Typer()
|
|
app = typer.Typer()
|
|
|
|
|
|
KEY_FILE = Path.cwd() / ".webui_secret_key"
|
|
KEY_FILE = Path.cwd() / ".webui_secret_key"
|
|
|
|
|
|
|
|
|
|
|
|
+def version_callback(value: bool):
|
|
|
|
+ if value:
|
|
|
|
+ from open_webui.env import VERSION
|
|
|
|
+
|
|
|
|
+ typer.echo(f"Open WebUI version: {VERSION}")
|
|
|
|
+ raise typer.Exit()
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+@app.command()
|
|
|
|
+def main(
|
|
|
|
+ version: Annotated[
|
|
|
|
+ Optional[bool], typer.Option("--version", callback=version_callback)
|
|
|
|
+ ] = None,
|
|
|
|
+):
|
|
|
|
+ pass
|
|
|
|
+
|
|
|
|
+
|
|
@app.command()
|
|
@app.command()
|
|
def serve(
|
|
def serve(
|
|
host: str = "0.0.0.0",
|
|
host: str = "0.0.0.0",
|