From 316291c98856a3f850512095a1e893cf7bca4277 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 25 Jan 2026 13:03:46 +0000 Subject: [PATCH 1/3] feat: add press enter to open browser experience in auth login - Add confirm prompt asking user to press enter to open browser - Auto-open verification URL when user confirms - Style the verification URL as a link using theme.colors.links() --- src/cli/commands/auth/login.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/cli/commands/auth/login.ts b/src/cli/commands/auth/login.ts index cae9edaa..f1fc0494 100644 --- a/src/cli/commands/auth/login.ts +++ b/src/cli/commands/auth/login.ts @@ -1,6 +1,7 @@ import { Command } from "commander"; -import { log } from "@clack/prompts"; +import { log, confirm, isCancel } from "@clack/prompts"; import pWaitFor from "p-wait-for"; +import open from "open"; import { writeAuth, generateDeviceCode, @@ -30,9 +31,19 @@ async function generateAndDisplayDeviceCode(): Promise { log.info( `Verification code: ${theme.styles.bold(deviceCodeResponse.userCode)}` + - `\nPlease confirm this code at: ${deviceCodeResponse.verificationUri}` + `\nPlease confirm this code at: ${theme.colors.links(deviceCodeResponse.verificationUri)}` ); + const shouldOpen = await confirm({ + message: "Press enter to open the browser", + active: "Open", + inactive: "Skip", + }); + + if (!isCancel(shouldOpen) && shouldOpen) { + await open(deviceCodeResponse.verificationUri); + } + return deviceCodeResponse; } From 3ed38c9502c3f5aaed0f06bbc36b626f8b33ded7 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 25 Jan 2026 13:07:58 +0000 Subject: [PATCH 2/3] feat: simplify auth login to press enter experience Replace confirm dialog (Open/Skip) with simple "Press Enter to open in browser..." prompt using readline for a cleaner UX. --- src/cli/commands/auth/login.ts | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/cli/commands/auth/login.ts b/src/cli/commands/auth/login.ts index f1fc0494..e9b1e5fc 100644 --- a/src/cli/commands/auth/login.ts +++ b/src/cli/commands/auth/login.ts @@ -1,7 +1,8 @@ import { Command } from "commander"; -import { log, confirm, isCancel } from "@clack/prompts"; +import { log } from "@clack/prompts"; import pWaitFor from "p-wait-for"; import open from "open"; +import * as readline from "readline"; import { writeAuth, generateDeviceCode, @@ -34,15 +35,19 @@ async function generateAndDisplayDeviceCode(): Promise { `\nPlease confirm this code at: ${theme.colors.links(deviceCodeResponse.verificationUri)}` ); - const shouldOpen = await confirm({ - message: "Press enter to open the browser", - active: "Open", - inactive: "Skip", + const rl = readline.createInterface({ + input: process.stdin, + output: process.stdout, }); - if (!isCancel(shouldOpen) && shouldOpen) { - await open(deviceCodeResponse.verificationUri); - } + await new Promise((resolve) => { + rl.question("Press Enter to open in browser...", () => { + rl.close(); + resolve(); + }); + }); + + await open(deviceCodeResponse.verificationUri); return deviceCodeResponse; } From 18a9b6deba1d0300b25443a5bfc1742431e7c79a Mon Sep 17 00:00:00 2001 From: "claude[bot]" <41898282+claude[bot]@users.noreply.github.com> Date: Mon, 26 Jan 2026 12:35:32 +0000 Subject: [PATCH 3/3] refactor: remove readline, auto-open browser in TTY environments - Remove readline dependency from auth login flow - Auto-open verification URL in browser without prompting - Add TTY check to only open browser in interactive terminals - Simplify UX by removing unnecessary prompt Co-authored-by: Kfir Stri --- src/cli/commands/auth/login.ts | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/cli/commands/auth/login.ts b/src/cli/commands/auth/login.ts index e9b1e5fc..a92e4a30 100644 --- a/src/cli/commands/auth/login.ts +++ b/src/cli/commands/auth/login.ts @@ -2,7 +2,6 @@ import { Command } from "commander"; import { log } from "@clack/prompts"; import pWaitFor from "p-wait-for"; import open from "open"; -import * as readline from "readline"; import { writeAuth, generateDeviceCode, @@ -35,19 +34,10 @@ async function generateAndDisplayDeviceCode(): Promise { `\nPlease confirm this code at: ${theme.colors.links(deviceCodeResponse.verificationUri)}` ); - const rl = readline.createInterface({ - input: process.stdin, - output: process.stdout, - }); - - await new Promise((resolve) => { - rl.question("Press Enter to open in browser...", () => { - rl.close(); - resolve(); - }); - }); - - await open(deviceCodeResponse.verificationUri); + // Auto-open browser in TTY environments + if (process.stdout.isTTY) { + await open(deviceCodeResponse.verificationUri); + } return deviceCodeResponse; }