Describe the feature or problem you’d like to solve
When I use gh auth login to login with the GitHub CLI OAuth app, I have to manually select and copy the one-time device code before launching the browser so I can paste it into the GitHub.com device login screen.
! First copy your one-time code: 7701-C5F6
Press Enter to open https://github.com/login/device in your browser...
I'd like some way I can configure gh to use the clipboard for certain features like gh auth login.
Proposed solution
I can see 3 different ways to provide this ability depending on how broadly this capability might be extended:
- Environment variable:
GH_CLIPBOARD=1
- Configuration setting:
gh config set clipboard enabled
- Command-specific flag:
gh auth login --clipboard
Additional context
One of gh dependencies is already including a library for putting content into the system's copy buffer:
|
github.com/atotto/clipboard v0.1.4 // indirect |
Describe the feature or problem you’d like to solve
When I use
gh auth loginto login with the GitHub CLI OAuth app, I have to manually select and copy the one-time device code before launching the browser so I can paste it into the GitHub.com device login screen.I'd like some way I can configure
ghto use the clipboard for certain features likegh auth login.Proposed solution
I can see 3 different ways to provide this ability depending on how broadly this capability might be extended:
GH_CLIPBOARD=1gh config set clipboard enabledgh auth login --clipboardAdditional context
One of
ghdependencies is already including a library for putting content into the system's copy buffer:cli/go.mod
Line 73 in 42a8e02