bitbucket-server-cli
CLI for interacting with Bitbucket Server
What is bitbucket-server-cli?
bitbucket-server-cli helps you quickly scan your Bitbucket repositories. Currently it can:
- Audit permissions to ensure all of your repositories are configured similarly
- Finds stale pull requests
- Compiles statistics about pull requests
How do I install?
First thing first, let's make sure you have the necessary pre-requisites.
System Dependencies
Node
Install
npm install bitbucket-server-cli -g
Set environment variables
Set the following environment variables:
- BITBUCKET_BASE_URL, ex:
https://bitbucketserver.myserver.com
- BITBUCKET_USERNAME, ex:
username
- BITBUCKET_PASSWORD, ex:
password
Commands and configuration
NOTE: You will need ADMIN permissions to each project/repo you are auditing.
Global Options
Option | Alias | Description |
---|---|---|
bitbucket-server-cli --help | bitbucket-server-cli -h | Lists supported CLI options |
bitbucket-server-cli --version | bitbucket-server-cli -v | Lists the current version number |
bitbucket-server-cli --projects | bitbucket-server-cli -p | Comma separated list of Bitbucket project keys |
Commands
bitbucket-server-cli audit-permissions
Audits permissions
Alias: ap
Examples
bitbucket-server-cli -p "MYPROJECTKEY,MYPROJECTKEY2" -c "./permissionsConfig.json" audit-permissions
bitbucket-server-cli -p "MYPROJECTKEY,MYPROJECTKEY2" -c "./permissionsConfig.json" ap
Please see the Permissions README for additional examples.
bitbucket-server-cli stale-prs
Fetches a list of stale pull requests
Alias: sp
Examples
bitbucket-server-cli -p "MYPROJECTKEY,MYPROJECTKEY2" -s "30 days" stale-prs
bitbucket-server-cli -p "MYPROJECTKEY,MYPROJECTKEY2" -s "30 days" sp
Please see the Stale PRs README for additional examples.
bitbucket-server-cli pr-stats
Fetch PRs stats
Alias: s
Examples
bitbucket-server-cli -p "MYPROJECTKEY,MYPROJECTKEY2" -r "30 days" pr-stats
bitbucket-server-cli -p "MYPROJECTKEY,MYPROJECTKEY2" -r "30 days" s
Please see the Pull Request Stats README for additional examples.
Contributing
Please see CONTRIBUTING.md.
Release History
Please see CHANGELOG.md.
License
Copyright (c) 2017-2018 Thomas Lindner. Licensed under the MIT license.