feat(cli): device-code flow is now the default for ctx7 login#2720
Merged
Conversation
The localhost-callback path is gone. Every install — laptop, SSH, Codespace, Docker, CI — goes through the same boxed prompt and verification page. Three reasons to make this the default: - The localhost flow was broken anywhere the browser couldn't reach 127.0.0.1:52417 (SSH, Docker, Codespaces). Auto-detection via SSH_CONNECTION / $DISPLAY was a half-fix that depended on env vars users don't always set. - Device flow works everywhere, has no random port-binding behavior, and still ends in the same long-lived ctx7sk- API key. - One UX path is simpler to support than two. Drops the --device flag (it was the opt-in for what's now the default). Older CLI versions (<= 0.5.0) continue to work against the unchanged auth endpoints, so pinned installs are unaffected. The legacy localhost machinery in utils/auth.ts is left in place for now — nothing imports it from commands/auth.ts anymore, and a follow-up can delete it once we're confident no rollback is needed.
35ee90c to
e7f08d6
Compare
enesgules
approved these changes
Jun 4, 2026
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.
Summary
After shipping 0.5.0 we realized the auto-detection heuristic (`SSH_CONNECTION` / `$DISPLAY`) was the wrong call — local users on macOS / Linux still saw the broken localhost-callback flow because the heuristic didn't fire for them. The right answer is to make device flow the only flow.
Changeset is `patch` — no API surface change for users, just a UX flip.
Test plan