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
Make tab completion available for more flags like labels and projects #11406
coreThis issue is not accepting PRs from outside contributorsenhancementa request to improve CLIgh-issuerelating to the gh issue commandgh-prrelating to the gh pr command
Using the gh cli using PowerShell, I expect that I should be able to tab complete all manner of things, that include labels projects and more
This is not the case today, so so it seems without wrapping the gh cli in other tooling and pulling together a local cache that updates as part of any call to the GitHub apis
Affected version
2.76.0
Steps to reproduce the behavior
This was an actual command that I ran & wanted to tab complete the labels in use in the repo vs then manually going to the repo and updating the labels.
gh issue create -t "Update the Working Group definitions markdown and pull in membership from a json file"`--body 'the working group definitions should be in a json file so that we can query them and they should be able to be emeded in the markdown file'`-R PowerShell/PowerShell `--assignee kilasuit
Expected vs actual behavior
Ability to tab complete the labels that are in use for that repo as well as all projects that I have access to (personal or organisational)
As you said, not all command options support auto-completion, and it's because due to the remarkable number of such options we have to choose wisely and prioritise those that actually bring value to the table. So, I wouldn't label this issue as
bugSomething isn't working
, and would rather stamp an
enhancementa request to improve CLI
on it.
Regarding labels, projects, etc, I think as a starter labels make more sense. It seems like a simple addition and also the data is easily available through a single (paginated) API request (See below for details). It will also enhance the UX for the following commands:
pr create/edit/list
issue create/edit/list
As of projects, they can be a bit tricky, especially regarding the sunsetting of ProjectsV1 and the multiple API requests needed to fetch all projects that a user has access to (i.e. projects available for a repo, projects owned by the user, etc). I'm not saying auto-completion for projects should be skipped, but it definitely requires a separate issue and needs more time for investigation.
Since this is an enhancement request, what I'm going to do is to keep this issue open for further internal discussion and will update you here.
Retrieving labels
The API simply provides the labels via this GraphQL query, and we already have it implemented in the codebase:
And as an example of how to override the auto-completion behaviour this is a good one where the information about the base repo is needed to perform the API request:
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.
changed the title [-]Tab completion seems not to be feature complete[/-][+]Make tab completion available for more flags like labels and projects[/+]on Aug 12, 2025
@BagToad and I looked into this and decided it's more complicated than what meets the eye, hence we marked it as
coreThis issue is not accepting PRs from outside contributors
. It's mostly due to the need to resolve the base repo before the actual invocation of the command.
coreThis issue is not accepting PRs from outside contributorsenhancementa request to improve CLIgh-issuerelating to the gh issue commandgh-prrelating to the gh pr command
Activity
babakks commentedon Jul 31, 2025
Hi, @kilasuit! And thanks for your suggestion! 🙏
As you said, not all command options support auto-completion, and it's because due to the remarkable number of such options we have to choose wisely and prioritise those that actually bring value to the table. So, I wouldn't label this issue as bugSomething isn't working
, and would rather stamp an
enhancement
a request to improve CLI
on it.
Regarding labels, projects, etc, I think as a starter labels make more sense. It seems like a simple addition and also the data is easily available through a single (paginated) API request (See below for details). It will also enhance the UX for the following commands:
pr create/edit/listissue create/edit/listAs of projects, they can be a bit tricky, especially regarding the sunsetting of ProjectsV1 and the multiple API requests needed to fetch all projects that a user has access to (i.e. projects available for a repo, projects owned by the user, etc). I'm not saying auto-completion for projects should be skipped, but it definitely requires a separate issue and needs more time for investigation.
Since this is an enhancement request, what I'm going to do is to keep this issue open for further internal discussion and will update you here.
Retrieving labels
The API simply provides the labels via this GraphQL query, and we already have it implemented in the codebase:
cli/api/queries_repo.go
Lines 1287 to 1300 in a2e23a2
And as an example of how to override the auto-completion behaviour this is a good one where the information about the base repo is needed to perform the API request:
cli/pkg/cmd/pr/create/create.go
Lines 353 to 359 in 6888786
github-actions commentedon Jul 31, 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.
[-]Tab completion seems not to be feature complete[/-][+]Make tab completion available for more flags like labels and projects[/+]babakks commentedon Dec 10, 2025
@BagToad and I looked into this and decided it's more complicated than what meets the eye, hence we marked it as coreThis issue is not accepting PRs from outside contributors
. It's mostly due to the need to resolve the base repo before the actual invocation of the command.
feat(zsh): complete PR numbers for `gh pr view`/`update-branch` (#367)