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
Support gh pr create --browse --copy as in hub to open and copy PRs #1646
changed the title [-]Support `gh pr create --browse --copy` as in hub[/-][+]Support `gh pr create --browse --copy` as in hub to open and copy PRs[/+]on Sep 9, 2020
I would really like to see this too, as I miss it greatly after migrating from hub. My use case mainly is that I want to create a PR in the CLI and then open it to add screenshots to it and now I have to click the link whereas with --browse it "just worked". I didn't know about --copy but would like that too, and would use it a lot as I use the copyq clipboard manager and would be great to have the PR URL automatically added to my clipboard stack.
We've talked about this and we're generally in favor of adding this functionality to any command that otherwise prints a URL for the created record to standard output.
I suspect that this would involve creating a new flags helper similar to this:
I would love to see these options supported in GitHub’s CLI! They are features I’ve hacked together myself with shell functions, but having them available as first class features would be much appreciated.
Activity
[-]Support `gh pr create --browse --copy` as in hub[/-][+]Support `gh pr create --browse --copy` as in hub to open and copy PRs[/+]mislav commentedon Sep 9, 2020
Thank you! This was proposed months ago, but we decided to not incorporate it back then #478 (comment)
We might revisit this now. I'll leave open to gather feedback. 🙇
gibfahn commentedon Sep 9, 2020
If the answer is gh aliases that seems reasonable, but for cross-platform copying that starts to get complex.
ElijahLynn commentedon Mar 4, 2021
I would really like to see this too, as I miss it greatly after migrating from
hub. My use case mainly is that I want to create a PR in the CLI and then open it to add screenshots to it and now I have to click the link whereas with--browseit "just worked". I didn't know about--copybut would like that too, and would use it a lot as I use thecopyqclipboard manager and would be great to have the PR URL automatically added to my clipboard stack.jrogov commentedon Mar 19, 2021
As a dirty workaround, bash function/script may be used (OSX in example):
Note: interactive features of gh (e.g. progress of creating a PR) are lost.
Similarly,
open $urlcan be used to open the PR itself.mislav commentedon Mar 9, 2022
We've talked about this and we're generally in favor of adding this functionality to any command that otherwise prints a URL for the created record to standard output.
I suspect that this would involve creating a new flags helper similar to this:
cli/pkg/cmdutil/json_flags.go
Lines 25 to 29 in e361fd4
And a new "exporter" similar to this:
cli/pkg/cmd/pr/view/view.go
Lines 118 to 119 in e361fd4
Alternatively, this could all be handled on the IOStreams level; for example:
jlorenzen commentedon Apr 18, 2022
I would also love to see the option to support opening the PR after creation. One of the biggest features I miss from
hub.tjtrabue commentedon Apr 18, 2022
I would love to see these options supported in GitHub’s CLI! They are features I’ve hacked together myself with shell functions, but having them available as first class features would be much appreciated.
gibfahn commentedon Apr 21, 2022
+1 to hacking things together with shell functions, my
gh prwrapper is getting a bit excessively long at this point 😁(https://github.com/gibfahn/dot/blob/main/dotfiles/bin/git-pr)
bag-man commentedon May 5, 2022
+1 this would be lovely!
danielnolan commentedon May 12, 2022
Having the ability to copy the pr url to the clipboard when opening a pr from the command line is one of the biggest things I miss from Hub
sheharyarn commentedon May 20, 2024
Bump. I'm trying to switch to
ghfromhub, and would really to like to have the--copyflag.