gh issue view
gh issue view {<number> | <url>} [flags]
显示问题的标题、内容和其他信息。
使用 --web 标志,在网络浏览器中打开问题,而不是在终端中。
选项
-c,--comments- 查看问题评论
-q,--jq <expression>- 使用 jq 表达式筛选 JSON 输出
-
--json <fields> - 输出包含指定字段的 JSON
-t,--template <string>- 使用 Go 模板格式化 JSON 输出;请参阅“gh help formatting”。
-w,--web- 在浏览器中打开问题
从父命令继承的选项
-R,--repo <[HOST/]OWNER/REPO>- 使用 [HOST/]OWNER/REPO 格式选择另一个仓库
JSON 字段
assignees, author, body, closed, closedAt, comments, createdAt, id, isPinned, labels, milestone, number, projectCards, projectItems, reactionGroups, state, stateReason, title, updatedAt, url
另请参阅
使用
在终端中
默认情况下,我们将在终端中显示项目。
# Viewing an issue in terminal
~/Projects/my-project$ gh issue view 21
Issue title
opened by user. 0 comments. (label)
Issue body
View this issue on GitHub: https://github.com/owner/repo/issues/21
~/Projects/my-project$
在浏览器中
使用 --web 或 -w 快速在浏览器中打开项目。
# Viewing an issue in the browser
~/Projects/my-project$ gh issue view 21 --web
Opening https://github.com/owner/repo/issues/21 in your browser.
~/Projects/my-project$