← 返回命令列表

Linux command

gh-pr-comment 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Add comment to PR

gh pr comment [number] -b "[comment]"

Comment interactively

gh pr comment [number]

Comment from file

gh pr comment [number] -F [comment.md]

Edit last comment

gh pr comment [number] --edit-last -b "[new text]"

说明

gh pr comment adds comments to pull requests from the command line. It provides flexible options for composing comments, including inline text, file input, and interactive editing. When called without the --body flag, the command opens your default editor for composing the comment. Comments support full GitHub-flavored Markdown including code blocks, tables, task lists, and @ mentions. The --edit-last option allows modifying your most recent comment on a pull request.

参数

-b, --body _text_
Comment body.
-F, --body-file _file_
Read body from file.
--edit-last
Edit last comment.
-R, --repo _owner/repo_
Repository.

FAQ

What is the gh-pr-comment command used for?

gh pr comment adds comments to pull requests from the command line. It provides flexible options for composing comments, including inline text, file input, and interactive editing. When called without the --body flag, the command opens your default editor for composing the comment. Comments support full GitHub-flavored Markdown including code blocks, tables, task lists, and @ mentions. The --edit-last option allows modifying your most recent comment on a pull request.

How do I run a basic gh-pr-comment example?

Run `gh pr comment [number] -b "[comment]"` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -b, --body _text_ do in gh-pr-comment?

Comment body.