From 7ef7246361ee9ebbbc3c586c2f11230ad97eeaea Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Fri, 18 Jul 2025 10:57:00 -0400 Subject: [PATCH] Add GUI command --- src/seedpass/cli.py | 8 ++++++++ src/tests/test_typer_cli.py | 16 ++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/seedpass/cli.py b/src/seedpass/cli.py index 81b1628..1a6c80a 100644 --- a/src/seedpass/cli.py +++ b/src/seedpass/cli.py @@ -682,5 +682,13 @@ def api_stop(ctx: typer.Context, host: str = "127.0.0.1", port: int = 8000) -> N typer.echo(f"Failed to stop server: {exc}") +@app.command() +def gui() -> None: + """Launch the BeeWare GUI.""" + from seedpass_gui.app import main + + main() + + if __name__ == "__main__": app() diff --git a/src/tests/test_typer_cli.py b/src/tests/test_typer_cli.py index b0b2479..e8e6725 100644 --- a/src/tests/test_typer_cli.py +++ b/src/tests/test_typer_cli.py @@ -532,3 +532,19 @@ def test_tui_forward_fingerprint(monkeypatch): result = runner.invoke(app, ["--fingerprint", "abc"]) assert result.exit_code == 0 assert called.get("fp") == "abc" + + +def test_gui_command(monkeypatch): + called = {} + + def fake_main(): + called["called"] = True + + monkeypatch.setitem( + sys.modules, + "seedpass_gui.app", + SimpleNamespace(main=fake_main), + ) + result = runner.invoke(app, ["gui"]) + assert result.exit_code == 0 + assert called.get("called") is True