Repository navigation
Support setting related fields for PRs and issues when creating #340
Description
Activity
We were just brainstorming this sort of thing last week :)
we're trying to decide what the best UX for this is and as you suggest are considering enter-to-skip prompts to add those links.
Reacted by John Bates, tarlitongodoy, Nandor Vilagos and Daniel LundinThis exists in https://github.com/github/hub with the following usage
Usage: hub pull-request [-focpd] [-b <BASE>] [-h <HEAD>] [-r <REVIEWERS> ] [-a <ASSIGNEES>] [-M <MILESTONE>] [-l <LABELS>] hub pull-request -m <MESSAGE> [--edit] hub pull-request -F <FILE> [--edit] hub pull-request -i <ISSUE>Or how I usually do it with
hub pull-request -l feature -r user1,user2,user3 -b stagingReacted by Nandor VilagosJust made my first PR with the new CLI tool. I think there is a ton of potential here! For me, at a minimum, having the ability to set a reviewer(s) would be really useful. As the tool stands now, I have to use the view command to open the PR up in the browser to set my reviewers.
- changed the title
[-]Support setting related fields for PRs[/-][+]Support setting related fields for PRs and issues[/+]on Feb 13, 2020 Could also have a
gh pr editpurely for modifying labels/reviewers/assignees- avoids the overhead/inconvenience of specifying these on
gh pr create/clickingEnterlots of times to keep them blank - can re-use logic for supporting additional flags in
gh pr create
Reacted by Toni Bustos and Clare Sloggett- avoids the overhead/inconvenience of specifying these on
I was just about to submit a feature request until GitHub helpfully pointed out this issue. Here's what I was about to post:
I use the
tibdex/autosquashGitHub Action. It automatically merges PRs that have anautosquashlabel. My workflow is to rungh pr create, preview the PR in the browser, select the label and create the PR.I'd like to be able to instead invoke
gh pr create --label autosquashand have the label automatically applied and remove the need to even open the browser. The benefit for me is that right now the added friction of having to leave the terminal and keyboard means that I don't make PRs as small as they could be.Reacted by Flavio Miyamoto and James Kiefer- changed the title
[-]Support setting related fields for PRs and issues[/-][+]Support setting related fields for PRs and issues when creating[/+]on Feb 28, 2020 - addedneeds-designAn engineering task needs design to proceedAn engineering task needs design to proceed
on Mar 18, 2020 Right now, I feel the same but mostly with issues.
I still have to use the browser to set the labels to keep my issues organized.This keeps me away from trying to master the CLI since I know the are some things I can't do with it
I think an interface like the one @aidansteele suggested could work for issues as well
gh issue create --label bugReacted by Aidan Steele, Markus Skyttner and ahpaleusEditing a pullrequest to either close or apply a label would make automating some housekeeping where I apply a label, close and delete the branch of a pullrequest.
Done in #787
Reacted by Casper da Costa-Luis, Riley Chase and Agniva De Sarker- added a commit that references this issue
on Jul 21, 2025
Describe the feature or problem you’d like to solve
Add support to the
gh pr createcommand to set fields like assignee, reviewers, labels, projects, etc for a new PR.Proposed solution
Additional prompts in the "create wizard" and additional flags for non-interactive use.
It would benefits users as it would avoid the need to open the PR in a web browser after creating a PR in order to add the correct related fields for their PR.