Textualize/trogon

Possible with Typer app not in a decorator?

vegarsti opened this issue · 3 comments

This is quite possibly a stupid question, but is there a way to wrap this in a Trogon TUI? I instantiate my typer.Typer app like this, as shown in that project's README

app = typer.Typer()

Is there a way to wrap that in a Trogon TUI?

I have the same problem.

davep commented

Yes! Thank you so much!

...
from trogon import Trogon
from typer.main import get_group
...

app = typer.Typer()


@app.command()
def tui(ctx: typer.Context):
    Trogon(get_group(app), click_context=ctx).run()