From 172314b86bbc37c9ae85b6c4fa9486421761b84a Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Fri, 11 Jul 2025 12:26:04 -0400 Subject: [PATCH] Make seedpass command launch TUI by default --- src/seedpass/cli.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/seedpass/cli.py b/src/seedpass/cli.py index e2639f1..afe1f7b 100644 --- a/src/seedpass/cli.py +++ b/src/seedpass/cli.py @@ -9,7 +9,12 @@ from password_manager.entry_types import EntryType import uvicorn from . import api as api_module -app = typer.Typer(help="SeedPass command line interface") +import importlib + +app = typer.Typer( + help="SeedPass command line interface", + invoke_without_command=True, +) # Global option shared across all commands fingerprint_option = typer.Option( @@ -47,10 +52,16 @@ def _get_pm(ctx: typer.Context) -> PasswordManager: return pm -@app.callback() +@app.callback(invoke_without_command=True) def main(ctx: typer.Context, fingerprint: Optional[str] = fingerprint_option) -> None: - """SeedPass CLI entry point.""" + """SeedPass CLI entry point. + + When called without a subcommand this launches the interactive TUI. + """ ctx.obj = {"fingerprint": fingerprint} + if ctx.invoked_subcommand is None: + tui = importlib.import_module("main") + raise typer.Exit(tui.main()) @entry_app.command("list")