You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature Request: Streamlined Authentication Flow for gh auth switch and gh auth refresh #12190
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.
Thank 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 wantedContributions 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.
Hey @Divyam-Kumar-Pandey we have a gh auth refresh -c option already to copy the OAuth code to clipboard - please let us know if that works for your use case ❤️
Hey @Divyam-Kumar-Pandey we have a gh auth refresh -c option 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, --clipboard on by default for gh auth login and gh 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 🤷
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 y and press Enter to proceed. Automating those steps would make the flow even smoother.
@BagToad : what are your thoughts about making -c, --clipboard on by default for gh auth login and gh 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 gh and its established flows. I would rather gh only 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 gh has 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.
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 y and press Enter to 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 Y input, only an ENTER keypress. I would be on board with making -c immediately open the browser.
Activity
github-actions commentedon Nov 24, 2025
Thank 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 wantedContributions 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.
Divyam-Kumar-Pandey commentedon Nov 24, 2025
@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.
BagToad commentedon 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 ❤️andyfeller commentedon Nov 24, 2025
@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 🤷
Divyam-Kumar-Pandey commentedon Nov 24, 2025
@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 commentedon Nov 24, 2025
@andyfeller Makes sense. I believe it would be more convenient if copying the code to the clipboard were enabled by default.
BagToad commentedon Nov 24, 2025
@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 commentedon Nov 24, 2025
@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.