Copy login device code to clipboard#1093
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enhances the entire login device authorization flow by automatically copying the displayed user device code to the system clipboard, while keeping the manual copy path intact if clipboard access fails.
Changes:
- Add clipboard support and wire it into
entire loginto copy the device user code automatically. - Add a small helper to handle clipboard copy + warning behavior without breaking login.
- Add unit tests covering clipboard copy success and failure.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| go.mod | Promotes github.com/atotto/clipboard to a direct dependency used by the login command. |
| cmd/entire/cli/login.go | Copies the device user code to clipboard (best-effort) and prints a warning on failure without aborting login. |
| cmd/entire/cli/login_test.go | Adds focused tests validating clipboard-copy behavior and warning output on failure. |
Soph
left a comment
There was a problem hiding this comment.
@blackgirlbytes could we do the clipboard add when you hit enter? That way you know more what is happening and are a bit more in control? Like "Press Enter to copy the code into your clipboard and open ... in your browser..."
totally can do it! @Soph YAY! |
…ce-code # Conflicts: # go.mod
|
@Soph updated for pressing Enter |
Summary
entire loginTests
mise run checkmise run lintScreen.Recording.2026-05-01.at.7.13.54.AM.mov