Skip to content

Studio Code: Display login URL to improve experience in remote and headless environments - #3900

Merged
sejas merged 4 commits into
trunkfrom
stu-1858-improve-first-run-auth-headless
Jun 22, 2026
Merged

Studio Code: Display login URL to improve experience in remote and headless environments#3900
sejas merged 4 commits into
trunkfrom
stu-1858-improve-first-run-auth-headless

Conversation

@sejas

@sejas sejas commented Jun 19, 2026

Copy link
Copy Markdown
Member

Related issues

How AI was used in this PR

AI assisted with implementation and tests.

Proposed Changes

The CLI auth login flow previously only printed the WordPress.com authorization URL when the browser failed to launch — and buried it inside an error message. On remote VMs and headless/SSH sessions there is no local browser at all, so users were told to "complete authentication in your browser" with no usable link, leaving them stuck.

Now the login flow:

  • Always prints the authorization URL explicitly, as a clean copyable line, whether or not a browser opens — so users on any machine can open it on another device and paste back the token.
  • Downgrades a failed browser launch from a scary error to a friendly warning that points at the printed URL.

Testing Instructions

  • npm run cli:build
  • node apps/cli/dist/cli/main.mjs auth login observe the URL is also printed.
  • node apps/cli/dist/cli/main.mjs code , and run /login
  • observe the URL is also printed.
Before After
Screenshot 2026-06-19 at 18 10 15 Screenshot 2026-06-19 at 18 27 48
Screenshot 2026-06-19 at 19 07 08  Screenshot 2026-06-19 at 19 04 53

Pre-merge Checklist

  • Tests pass (npm test -- apps/cli/commands/auth/tests/login.test.ts)
  • Lint clean (npx eslint)
  • Manual verification of the live token exchange on a remote VM
@sejas sejas self-assigned this Jun 19, 2026
@sejas
sejas marked this pull request as ready for review June 19, 2026 17:08
…fort browser open

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sejas sejas changed the title fix: improve CLI first-run auth for remote and headless environments Jun 19, 2026
@sejas sejas changed the title Display login URL to improve experience in remote and headless environments Jun 19, 2026
@sejas
sejas requested a review from nightnei June 19, 2026 17:30
@wpmobilebot

wpmobilebot commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing c18c432 vs trunk

app-size

Metric trunk c18c432 Diff Change
App Size (Mac) 2341.84 MB 2341.84 MB +0.00 MB ⚪ 0.0%

site-editor

Metric trunk c18c432 Diff Change
load 1082 ms 1080 ms 2 ms ⚪ 0.0%

site-startup

Metric trunk c18c432 Diff Change
siteCreation 6497 ms 6486 ms 11 ms ⚪ 0.0%
siteStartup 6993 ms 6982 ms 11 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

@sejas
sejas requested a review from katinthehatsite June 22, 2026 11:04
@sejas
sejas removed the request for review from katinthehatsite June 22, 2026 14:44
@sejas

sejas commented Jun 22, 2026

Copy link
Copy Markdown
Member Author

I'm merging this. I'm happy to apply any feedback that could come.

@sejas
sejas merged commit 39ce42b into trunk Jun 22, 2026
12 checks passed
@sejas
sejas deleted the stu-1858-improve-first-run-auth-headless branch June 22, 2026 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants