I am trying to search for issues with keywords in github.
I want to achieve this from command line.
I have already tried ghi (stephencelis/ghi
: GitHub Issues on the command line) --> the installation doesn't work.
Could you please suggest any other options?
2022: gh
2.7.0 comes with gh search issues
Adds the
search issues
andsearch prs
command.The
search issues
command includes a--include-prs
flag that allows for including pull requests in the search results.
2024: gh
v2.55.0 proposes in cli/cli
PR 9453:
- Update
gh search prs --project
flag doc to specifyowner/number
syntax- Update
gh search issues --project
flag doc to specifyowner/number
syntax
Update 2020: The GitHub CLI gh
is now 1.0 and available.
As noted in Alireza's answer, it can list issue through the gh issue list
command.
If the keyword is a label, you can use gh issue list -l xxx
to filter by label.
If not, grepping the title is a possible workaround.
From GH 1.8.0
The new
issue/pr list --search
flag enables searching issues and pull requests using keywords.In addition to searching by words that may appear in the contents of issues or pull requests, you can use any GitHub search syntax for more specific matching and to change the order of the results.
For example:
gh issue list --state closed --search "crash in:title"
- closed issues that contain "crash" in their titlegh issue list --search "no:assignee"
- open issues without an assigneegh issue list -l "bug" --search "sort:interactions-desc"
- bug threads that have the most interactionsgh pr list --search "review-requested:@me"
- pull requests where your review was requestedgh pr list --state merged --search "merged:>=2021-03-30"
- pull requests merged after a certain date
2017: You can search issues with GitHub Search APOI using the command-line curl
(see this tutorial)
curl -i -H 'Authorization: token my_token' 'https://api.github.com/search/issues?q=akeyword+repo:auser/arepo'
This is a workaround, while you can debug why a ruby/rail program like stephencelis/ghi
does not work.