Conversation
Member
appleboy
commented
Feb 28, 2026
- Add a new TUI interface using BubbleTea and Lipgloss for interactive terminal OAuth flows
- Refactor all CLI output to use a Displayer abstraction
- Support both TUI and plain text output based on terminal detection
- Replace direct stdout printing with Displayer calls throughout the OAuth logic
- Implement device flow progress, token info, and error handling visually in the TUI
- Integrate new Displayer implementations (TUI, plain, test/noop) and message types
- Update tests to use NoopDisplayer for refresh and polling flows
- Add BubbleTea, Lipgloss, and Charm libraries to dependencies
- Improve UX with status logs, spinners, and styled banners for each OAuth phase
- Add a new TUI interface using BubbleTea and Lipgloss for interactive terminal OAuth flows - Refactor all CLI output to use a Displayer abstraction - Support both TUI and plain text output based on terminal detection - Replace direct stdout printing with Displayer calls throughout the OAuth logic - Implement device flow progress, token info, and error handling visually in the TUI - Integrate new Displayer implementations (TUI, plain, test/noop) and message types - Update tests to use NoopDisplayer for refresh and polling flows - Add BubbleTea, Lipgloss, and Charm libraries to dependencies - Improve UX with status logs, spinners, and styled banners for each OAuth phase Signed-off-by: appleboy <appleboy.tw@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR introduces a terminal UI (BubbleTea/Lipgloss) for interactive OAuth device flows and refactors OAuth-related CLI output behind a Displayer abstraction to support both TUI and plain-text output depending on terminal detection.
Changes:
- Added a new
tuipackage (model + message types) andDisplayerimplementations (TUI program sender, plain text, noop for tests). - Refactored the OAuth flow in
main.goto emit output exclusively viatui.Displayerand to select TUI vs plain mode at runtime. - Updated tests to pass a
NoopDisplayerinto refactored functions.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
tui/model.go |
BubbleTea model rendering OAuth device flow phases and status log. |
tui/messages.go |
Message types sent from OAuth logic to the TUI model. |
tui/displayer.go |
Displayer interface + Plain/Program/Noop implementations. |
main.go |
Refactors flow to use Displayer; adds TUI bootstrapping and terminal detection. |
polling_test.go |
Updates polling tests for new pollForTokenWithProgress(..., Displayer) signature. |
main_test.go |
Updates refresh token tests for new refreshAccessToken(..., Displayer) signature. |
go.mod / go.sum |
Adds Charm/BubbleTea/Lipgloss dependencies and indirect transitive deps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Change isTTY to check stderr instead of stdout, matching TUI rendering output - Correct the goroutine WaitGroup usage for proper parallel execution in main - Truncate and display token info with a character limit on verification success in the TUI Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Refactor goroutine launching to use wg.Go instead of manual goroutine creation and wg.Add for TUI program execution Signed-off-by: appleboy <appleboy.tw@gmail.com>
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.