Repository navigation
feat: add CLI device authentication - #154
Merged
Merged
Conversation
Add WorkOS device authorization commands for login, status, and logout with bounded polling, refresh-token rotation, secret-safe output, and native OS keyring storage without a plaintext fallback. Include exact native dependencies, generated install locks, and focused behavior and storage tests.
Load native keyring support only when account credentials are accessed and report safe failures. Restrict verification URLs to trusted transports and same-origin completion links before opening a browser.
Pepps233
requested changes
Aug 29, 2026
Pepps233
left a comment
Contributor
There was a problem hiding this comment.
Remove existing auth routings through diffex auth login, diffex auth status, and diffex auth logout. Instead, route auth using existing slash commands /login and /logout because they are the two main interfaces for interacting with model auths.
Remove the standalone account login, status, and logout routes, and integrate secure Diffex device sign-in and sign-out into the existing /login and /logout flows while preserving provider credential management.
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
Adds Diffex account authentication to the CLI through
diffex auth login,diffex auth status, anddiffex auth logout.The login flow uses device authorization and stores the resulting session in the operating system keychain without exposing tokens in terminal output.
Reasoning
This milestone connects the CLI to Diffex account identity without prematurely coupling authentication to hosted cloud operations.
Credentials must remain out of plaintext files and terminal output, while the browser handoff, polling behavior, refresh rotation, and logout path need predictable failure handling.
Changes
Testing
npm exec -- vitest run packages/coding-agent/test/account-auth-storage.test.ts packages/coding-agent/test/account-auth-command.test.tsnpm run checknpm run build