@rushdigital/bitbucket-cli
v1.0.0-rc.5
Published
CLI tool for interaction with Bitbucket such as getting PR details, adding comments and creating tasks
Downloads
3
Readme
Bitbucket CLI
CLI tool for interaction with Bitbucket such as getting PR details, adding comments and creating tasks.
Installation
Requires Node.js 18 or above.
- Install the tool (with global option):
Yarn:
yarn global add @rushdigital/bitbucket-cli
NPM:
npm install -g @rushdigital/bitbucket-cli
Or install from source:
yarn global add https://bitbucket.org/rushdigital/bitbucket-cli.git
- Set environment variables
[email protected]
BITBUCKET_PASSWORD=API-token
See Create an API token article for more details.
Usage
Get PR details
bitbucket-cli pr get https://bitbucket.org/mydomain/myrepo/pull-requests/1
This will output details of the PR. You can get specific properties of the PR by adding --properties ...
option, e.g get PR description:
bitbucket-cli pr get https://bitbucket.org/mydomain/myrepo/pull-requests/1 --properties summary.raw
You can access nested properties by separating them with a .
. Refer to https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-get for documentaion of the response schema.
Add PR comment
bitbucket-cli pr comment update https://bitbucket.org/mydomain/myrepo/pull-requests/1 --content "This is my comment"
Update PR comment
You can update a comment by matching a substring
bitbucket-cli pr comment update https://bitbucket.org/mydomain/myrepo/pull-requests/1 --content "Updated comment" --match "my comment"
Note: only the first matching comment will be updated.
Or use --id
instead of --match
to update comment by its ID.
Command Reference
Support
If you find a bug or have a feature request please log it at https://bitbucket.org/rushdigital/bitbucket-cli/issues
About RUSH
RUSH was founded on a simple principle; the exhilarating feeling of solving a difficult problem, a feeling that is common in the challenging projects RUSH tackles. We’re committed to bringing this enthusiasm to our work as a forward-looking, tech-engaged business with the purpose statement: We design and build technology to better serve humankind.
Our ways of working have been tested in some of the most demanding and impactful projects, resulting in effective and elegant award-winning digital experiences that millions of people benefit from every day.
We strive for continuous improvement to refine our practices and processes - like this tool, created to automate repetitive tasks and make the teams' lives easier. If you'd like to join or learn more about RUSH's team of strategic thinkers, empathetic designers and technical mavericks visit rush.co.nz/careers