Commenter CLI is a command-line tool designed to perform comment operations on GitHub pull request (PR) issues. It simplifies creating, updating, and retrieving comments on GitHub PRs directly from your terminal.
- Create Comments: Add new comments to a specific PR.
- Update Comments: Modify existing comments on a PR.
- Get Comment ID: Retrieve the ID of a comment based on its text content.
- Autocompletion: Generate autocompletion scripts for various shells.
Before using this tool, ensure you have the following:
Go: Install Go programming language. GitHub Token: A valid GitHub personal access token with appropriate permissions.
To install Commenter CLI from the source, follow these steps:
- Clone the Repository:
git clone https://github.com/yourusername/commenter-cli.git
cd commenter-cli
- Download Dependencies:
go mod download
- Build the Binary:
go build -o commenter
Once installed, you'll have to set the GITHUB_TOKEN
environment then can use the commenter command to interact
with GitHub PR issues.
- create: Create a new comment on a PR.
- get: Get the message ID based on text.
- help: Display help information about any command.
- update: Update an existing comment on a PR.
To create a new comment on a specific PR:
./commenter create -o your-org -r your-repo -p 123 -c "This is a comment"
To update an existing comment:
./commenter update -o your-org -r your-repo -i 456 -c "Updated comment text"
To retrieve the ID of a comment based on its text:
./commenter get -o your-org -r your-repo -p 123 -f ./path/to/file
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch (git checkout -b feature-branch).
- Make your changes.
- Commit your changes (git commit -m 'Add new feature').
- Push to the branch (git push origin feature-branch).
- Open a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.