Repository navigation
Feature Request: Streamlined Authentication Flow for gh auth switch and gh auth refresh #12190
Description
Activity
- addedenhancementa request to improve CLIa request to improve CLI
on Nov 24, 2025 github-actions commented
on Nov 24, 2025 on Nov 24, 2025 – with GitHub ActionsContributorMore actionsThank you for your issue! We have categorized it as a feature request, and it has been added to our backlog. In doing so, we are not committing to implementing this feature at this time, but, we will consider it for future releases based on community feedback and our own product roadmap.
Unless you see the help wanted
Contributions welcome label, we are not currently looking for external contributions for this feature.If you come across this issue and would like to see it implemented, please add a thumbs up! This will help us prioritize the feature. Please only comment if you have additional information or viewpoints to contribute.
Reacted by Divyam Kumar Pandey@babakks If this proposal is accepted, I would like to volunteer to work on the implementation. Kindly let me know if the issue can be assigned to me.
Hey @Divyam-Kumar-Pandey we have a
gh auth refresh -coption already to copy the OAuth code to clipboard - please let us know if that works for your use case ❤️- addedgh-authrelating to the gh auth commandrelating to the gh auth command
on Nov 24, 2025 Hey @Divyam-Kumar-Pandey we have a
gh auth refresh -coption already to copy the OAuth code to clipboard - please let us know if that works for your use case ❤️@BagToad : what are your thoughts about making
-c, --clipboardon by default forgh auth loginandgh auth refresh?I agree this should really address the concern raised. The GitHub Copilot CLI automatically copies its device code to the clipboard before pressing enter:
If users weren't copying and pasting it, then I'd be worried about overwriting what was in their copy buffer, however I think most everyone is copy and pasting rather than memorizing and entering it 🤷
@BagToad Thanks for pointing that out!
The only remaining friction is that it doesn’t automatically open the browser. Also, since the user will almost always confirm the login. I’m not sure there’s much value in waiting for them to type
yand pressEnterto proceed. Automating those steps would make the flow even smoother.@andyfeller Makes sense. I believe it would be more convenient if copying the code to the clipboard were enabled by default.
@BagToad : what are your thoughts about making
-c, --clipboardon by default forgh auth loginandgh auth refresh?I agree this should really address the concern raised. The GitHub Copilot CLI automatically copies its device code to the clipboard before pressing enter:
@andyfeller I personally dislike this behavior in the context of
ghand its established flows. I would ratherghonly read and write a user's clipboard only when told as it is different behavior. I'd be happy to have a configuration option to enable this behavior, but replacing non-destructive behavior with a destructive behavior by default feels like the wrong decision.The copilot CLI affords itself the luxury of being a new product with new UX flows. Since
ghhas established flows that users are accustomed to, I don't like the idea of sliding in a data destructive action like writing to the clipboard where it was once absent.Edit: Some more thought to this - a major release for something like this would be unprecedented, but it does cross my mind as a way to excuse the change and get what is ultimately a more useful design out the door.
@BagToad Thanks for pointing that out!
The only remaining friction is that it doesn’t automatically open the browser. Also, since the user will almost always confirm the login. I’m not sure there’s much value in waiting for them to type
yand pressEnterto proceed. Automating those steps would make the flow even smoother.@Divyam-Kumar-Pandey That makes sense, but I'd just note that we don't require a
Yinput, only anENTERkeypress. I would be on board with making-cimmediately open the browser.Reacted by Divyam Kumar Pandey- addedauthrelated to tokens, authentication state, or oauthrelated to tokens, authentication state, or oauthand removedneeds-triageneeds to be reviewedneeds to be reviewed
on Mar 9, 2026
Describe the feature or problem you’d like to solve
I frequently use gh auth switch and gh auth refresh multiple times throughout the day. The current authentication flow requires manually copying the verification code and opening the authorization URL in a browser, which slows down the workflow and adds repeated friction.
Proposed solution
Enhance the authentication process by automatically copying the verification code to the clipboard and opening the required browser window. This improvement would significantly reduce manual steps, making the authentication experience smoother, faster, and more efficient.
Additional context
Please refer to the attached screenshot for the current flow.