Linux command
gh-pr-view 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
View current PR
gh pr view
View specific PR
gh pr view [pr-number]
Open PR in browser
gh pr view --web
View as JSON
gh pr view --json [title,body,state]
View PR comments
gh pr view --comments
说明
gh pr view displays detailed information about a pull request including title, body, state, reviewers, labels, and merge status. It renders markdown content in the terminal. The command defaults to the pull request for the current branch if no number is specified. JSON output enables scripted access to PR data with optional jq filtering.
参数
- --web
- Open in browser instead of terminal.
- --comments
- Show PR comments.
- --json _FIELDS_
- Output specific fields as JSON.
- -q _QUERY_, --jq _QUERY_
- Filter JSON output with jq syntax.
- -t, --template _TEMPLATE_
- Format output using a Go template.
- --help
- Display help information.
FAQ
What is the gh-pr-view command used for?
gh pr view displays detailed information about a pull request including title, body, state, reviewers, labels, and merge status. It renders markdown content in the terminal. The command defaults to the pull request for the current branch if no number is specified. JSON output enables scripted access to PR data with optional jq filtering.
How do I run a basic gh-pr-view example?
Run `gh pr view` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --web do in gh-pr-view?
Open in browser instead of terminal.