diff --git a/learn_sql_model/cli/app.py b/learn_sql_model/cli/app.py index e2edbd6..a367ab5 100644 --- a/learn_sql_model/cli/app.py +++ b/learn_sql_model/cli/app.py @@ -1,7 +1,8 @@ +from trogon import Trogon import typer +from typer.main import get_group from learn_sql_model.cli.api import api_app -from learn_sql_model.cli.common import verbose_callback from learn_sql_model.cli.config import config_app from learn_sql_model.cli.hero import hero_app from learn_sql_model.cli.model import model_app @@ -37,21 +38,9 @@ def version_callback(value: bool) -> None: raise typer.Exit() -@app.callback() -def main( - version: bool = typer.Option( - None, - "--version", - callback=version_callback, - is_eager=True, - ), - verbose: bool = typer.Option( - False, - callback=verbose_callback, - help="show the log messages", - ), -) -> None: - return +@app.command() +def tui(ctx: typer.Context) -> None: + Trogon(get_group(app), click_context=ctx).run() if __name__ == "__main__": diff --git a/pyproject.toml b/pyproject.toml index c630615..50750bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,6 +25,7 @@ classifiers = [ ] dependencies = [ "anyconfig", + "trogon", "fastapi", "httpx", "passlib[bcrypt]",