From d9e23144478d79d8033e0d5542c3fe27d6d1b67a Mon Sep 17 00:00:00 2001 From: Magnetkopf <82427906+Magnetkopf@users.noreply.github.com> Date: Mon, 6 Apr 2026 15:42:51 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Added=20no=20browser=20opening=20op?= =?UTF-8?q?tion=20for=20authenticating=20command=20(#317)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(auth): add no browser mode * chore: merge print statements --- tiddl/cli/commands/auth.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tiddl/cli/commands/auth.py b/tiddl/cli/commands/auth.py index 1bb259e..b1f7aee 100644 --- a/tiddl/cli/commands/auth.py +++ b/tiddl/cli/commands/auth.py @@ -17,7 +17,14 @@ auth_command = typer.Typer( # TODO add context and load auth data from ctx @auth_command.command(help="Login with your Tidal account.") -def login(): +def login( + NO_BROWSER: Annotated[ + bool, + typer.Option( + "--no-browser", "-n", help="Do not open browser." + ), + ] = False, +): loaded_auth_data = load_auth_data() if loaded_auth_data.token: @@ -28,8 +35,10 @@ def login(): device_auth = auth_api.get_device_auth() uri = f"https://{device_auth.verificationUriComplete}" - typer.launch(uri) + if not NO_BROWSER: + typer.launch(uri) + console.print(f"Go to '{uri}' and complete authentication!") auth_end_at = time() + device_auth.expiresIn