gh search issues
gh search issues [<query>] [flags]
在 GitHub 上搜索问题。
该命令支持使用 GitHub 搜索语法、参数和限定符标志或两者的组合构建查询。
GitHub 搜索语法记录在:https://docs.github.com/search-github/searching-on-github/searching-issues-and-pull-requests
选项
-
--app <string> - 按 GitHub 应用作者过滤
-
--archived - 根据存储库存档状态过滤 {true|false}
-
--assignee <string> - 按受让人过滤
-
--author <string> - 按作者过滤
-
--closed <date> - 按关闭时间过滤
-
--commenter <user> - 按用户评论过滤
-
--comments <number> - 按评论数量过滤
-
--created <date> - 按创建时间过滤
-
--include-prs - 在结果中包含拉取请求
-
--interactions <number> - 按反应和评论数量过滤
-
--involves <user> - 按用户的参与度过滤
-q,--jq <expression>- 使用 jq 表达式过滤 JSON 输出
-
--json <fields> - 使用指定的字段输出 JSON
-
--label <strings> - 按标签过滤
-
--language <string> - 根据编码语言过滤
-L,--limit <int> (default 30)- 要获取的最大结果数
-
--locked - 按锁定的对话状态过滤
-
--match <strings> - 将搜索限制为问题的特定字段:{title|body|comments}
-
--mentions <user> - 按用户提及过滤
-
--milestone <title> - 按里程碑标题过滤
-
--no-assignee - 按缺少受让人过滤
-
--no-label - 按缺少标签过滤
-
--no-milestone - 按缺少里程碑过滤
-
--no-project - 按缺少项目过滤
-
--order <string> (default "desc") - 返回结果的顺序,除非指定了“--sort”标志,否则会被忽略:{asc|desc}
-
--owner <strings> - 按存储库所有者过滤
-
--project <number> - 按项目看板号过滤
-
--reactions <number> - 按反应数量过滤
-R,--repo <strings>- 按存储库过滤
-
--sort <string> (default "best-match") - 对获取的结果进行排序:{comments|created|interactions|reactions|reactions-+1|reactions--1|reactions-heart|reactions-smile|reactions-tada|reactions-thinking_face|updated}
-
--state <string> - 根据状态过滤:{open|closed}
-
--team-mentions <string> - 按团队提及过滤
-t,--template <string>- 使用 Go 模板格式化 JSON 输出;请参阅“gh help formatting”
-
--updated <date> - 按上次更新时间过滤
-
--visibility <strings> - 根据存储库可见性过滤:{public|private|internal}
-w,--web- 在网络浏览器中打开搜索查询
JSON 字段
assignees, author, authorAssociation, body, closedAt, commentsCount, createdAt, id, isLocked, isPullRequest, labels, number, repository, state, title, updatedAt, url
示例
# search issues matching set of keywords "readme" and "typo"
$ gh search issues readme typo
# search issues matching phrase "broken feature"
$ gh search issues "broken feature"
# search issues and pull requests in cli organization
$ gh search issues --include-prs --owner=cli
# search open issues assigned to yourself
$ gh search issues --assignee=@me --state=open
# search issues with numerous comments
$ gh search issues --comments=">100"
# search issues without label "bug"
$ gh search issues -- -label:bug
# search issues only from un-archived repositories (default is all repositories)
$ gh search issues --owner github --archived=false