From f367521413f92c02692ddf4d09d2f05272cc59f5 Mon Sep 17 00:00:00 2001 From: Golenspade <2023004079@mails.cust.edu.cn> Date: Mon, 6 Oct 2025 22:32:43 +0800 Subject: [PATCH 1/2] docs(gh): add `gh pr comment` and `gh pr view` tldr pages --- pages/common/gh-pr-comment.md | 21 +++++++++++++++++++++ pages/common/gh-pr-view.md | 25 +++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 pages/common/gh-pr-comment.md create mode 100644 pages/common/gh-pr-view.md diff --git a/pages/common/gh-pr-comment.md b/pages/common/gh-pr-comment.md new file mode 100644 index 00000000000000..7aff0a89146512 --- /dev/null +++ b/pages/common/gh-pr-comment.md @@ -0,0 +1,21 @@ +# gh pr comment + +> Add a comment to a GitHub pull request. +> Part of the GitHub CLI: `gh`. +> More information: . + +- Comment on the pull request of the current branch: + +`gh pr comment --body "{{LGTM}}"` + +- Comment on a specific pull request: + +`gh pr comment {{123}} --body "{{Thanks!}}"` + +- Comment from a file: + +`gh pr comment {{123}} --body-file "{{path/to/file.txt}}"` + +- Open the editor to write a multi-line comment: + +`gh pr comment {{123}}` diff --git a/pages/common/gh-pr-view.md b/pages/common/gh-pr-view.md new file mode 100644 index 00000000000000..40e9c52dddcb0a --- /dev/null +++ b/pages/common/gh-pr-view.md @@ -0,0 +1,25 @@ +# gh pr view + +> View details of a GitHub pull request. +> Part of the GitHub CLI: `gh`. +> More information: . + +- View the pull request associated with the current branch: + +`gh pr view` + +- View a specific pull request: + +`gh pr view {{123}}` + +- Open the pull request in the default web browser: + +`gh pr view --web` + +- Show changed files: + +`gh pr view {{123}} --files` + +- Show comments in the terminal: + +`gh pr view {{123}} --comments` From 39b7d88cd9d02bde8d766fc875078c2a1e3f493d Mon Sep 17 00:00:00 2001 From: Golenspade <2023004079@mails.cust.edu.cn> Date: Tue, 7 Oct 2025 10:03:59 +0800 Subject: [PATCH 2/2] Address review feedback: update flag formats and remove non-existent options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove "Part of the GitHub CLI" line from both pages - Update flags to show both short and long forms: [-b|--body], [-F|--body-file], [-w|--web], [-c|--comments] - Remove quotes from file path in --body-file example - Remove --files example (flag doesn't exist in gh pr view) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- pages/common/gh-pr-comment.md | 7 +++---- pages/common/gh-pr-view.md | 9 ++------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/pages/common/gh-pr-comment.md b/pages/common/gh-pr-comment.md index 7aff0a89146512..8fd89464f060d9 100644 --- a/pages/common/gh-pr-comment.md +++ b/pages/common/gh-pr-comment.md @@ -1,20 +1,19 @@ # gh pr comment > Add a comment to a GitHub pull request. -> Part of the GitHub CLI: `gh`. > More information: . - Comment on the pull request of the current branch: -`gh pr comment --body "{{LGTM}}"` +`gh pr comment {{[-b|--body]}} "{{LGTM}}"` - Comment on a specific pull request: -`gh pr comment {{123}} --body "{{Thanks!}}"` +`gh pr comment {{123}} {{[-b|--body]}} "{{Thanks!}}"` - Comment from a file: -`gh pr comment {{123}} --body-file "{{path/to/file.txt}}"` +`gh pr comment {{123}} {{[-F|--body-file]}} {{path/to/file.txt}}` - Open the editor to write a multi-line comment: diff --git a/pages/common/gh-pr-view.md b/pages/common/gh-pr-view.md index 40e9c52dddcb0a..bfb2f4d43a9a15 100644 --- a/pages/common/gh-pr-view.md +++ b/pages/common/gh-pr-view.md @@ -1,7 +1,6 @@ # gh pr view > View details of a GitHub pull request. -> Part of the GitHub CLI: `gh`. > More information: . - View the pull request associated with the current branch: @@ -14,12 +13,8 @@ - Open the pull request in the default web browser: -`gh pr view --web` - -- Show changed files: - -`gh pr view {{123}} --files` +`gh pr view {{[-w|--web]}}` - Show comments in the terminal: -`gh pr view {{123}} --comments` +`gh pr view {{123}} {{[-c|--comments]}}`