Skip to content
[ 03 ]Commands

copia-cli pr comment

copia-cli pr comment {<number> | <url>} [flags]

Add a comment to a Copia pull request by number or URL.

The body comes from --body, from a file with --body-file ("-" reads standard input), or from the editor with --editor. One of them, or --web, is required. On success the URL of the new comment is printed.

--editor opens the editor set in COPIA_EDITOR, the config key editor, VISUAL or EDITOR on an empty file and posts the saved text; empty text aborts without a comment.

--web opens the pull request page in the browser to comment there. No API call is made, so no token is needed.

Options

-b, --body <text>
The comment body text
-F, --body-file <file>
Read body text from file (use "-" to read from standard input)
-e, --editor
Write the comment body in the text editor
-w, --web
Open the pull request in the browser to add a comment

Options inherited from parent commands

--host <string>
Target Copia host
-R, --repo <string>
Select repository (owner/repo)
--token <string>
Authentication token

Examples

# Comment on a pull request
$ copia-cli pr comment 7 --body "Looks good to me"

# Read the comment from a file, or from standard input with -
$ copia-cli pr comment 7 --body-file review.md
$ echo "Rebased on develop" | copia-cli pr comment -F - \
    https://app.copia.io/my-org/my-repo/pulls/7

# Write the comment in the editor
$ copia-cli pr comment 7 --editor

# Comment in the browser
$ copia-cli pr comment 7 --web

See also