feat(auth): add --no-browser-open to auth login#376
Merged
Conversation
Let users complete the OAuth flow by copy-pasting the printed authorize URL instead of having a browser opened automatically — useful on headless or remote hosts, or when the desktop browser shouldn't be hijacked. cli-core surfaces the authorize URL before its `openBrowser` hook fires, so skipping the spawn still leaves a usable login. The hook isn't handed the parsed flags, so the option is read off the command at call time. SKILL content regenerated.
doistbot
reviewed
Jun 2, 2026
doistbot
left a comment
Member
There was a problem hiding this comment.
Thanks scottlovegrove for your contribution 😎 👊. The implementation for the --no-browser-open flag is clean, and the proactive updates to the SKILL docs are much appreciated.
Few things worth tightening:
- Reauth flows: Follow-up login hints (e.g., for missing scopes) don't preserve the
--no-browser-openflag, which could unexpectedly spawn a browser later in headless environments. - Helper reuse: The command bypasses
src/lib/browser.ts; consider extending the shared helper with an option like{ announce: false }to keep browser-launch logic unified. - Test assertions: The test verifies the skipped browser behavior by setting Commander's internal state directly rather than parsing the public flag via
createTestProgram.
Address review feedback:
- Funnel the auth-login browser spawn through `openInBrowser` instead of
importing `open` directly, adding an `{ announce: false }` option so the
helper doesn't double-print the URL cli-core already shows.
- Exercise the real `--no-browser-open` flag via `createTestProgram` /
`parseAsync` rather than poking Commander's internal option store.
doist-release-bot Bot
added a commit
that referenced
this pull request
Jun 2, 2026
## [1.71.0](v1.70.0...v1.71.0) (2026-06-02) ### Features * **auth:** add `--no-browser-open` to `auth login` ([#376](#376)) ([90ee8ec](90ee8ec))
Contributor
|
🎉 This PR is included in version 1.71.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a
--no-browser-openflag totd auth login. With it, the OAuth flow prints the authorization URL for manual copy-paste instead of automatically opening a browser.Why
Useful on headless or remote hosts, in SSH sessions, or any time you'd rather not have the desktop browser hijacked. cli-core already auto-skips the spawn on detected headless/WSL environments; this flag forces the skip everywhere.
How
cli-core surfaces the authorize URL before its
openBrowserhook fires, so skipping the spawn still leaves a usable login — the printed URL is the path through. cli-core'sopenBrowserhook isn't handed the parsed flags, so the option is read off the command at call time (commander negatable--no-browser-open→browserOpen, defaulttrue).Tests
sync:skill.type-check,check(oxlint + oxfmt), and the auth login suite all pass.