HTTPS SSH

Bitbucket CLI

This is an attempt to make a CLI for handling my Bitbucket repositories without need to login on to the web dashboard. Main goal is installing a development keys and adding webhooks through command line.

Install

curl -OL https://bitbucket.org/dam1r89/bitbucket-cli/downloads/bb-cli.phar
chmod +x bb-cli.phar
mv bb-cli.phar /usr/local/bin/bb

Building

Run sh build.sh and built app will be under dist/bb-cli.phar.

Usage

Run a console

 bb console                                                                             ~/Desktop Damirs-MacBook-Air

 Username:
 > dam1r89

 password:
 >

 [no repo selected] [ ]:
 > find

 Keyword:
 > bitbucket

 Which role (owner|admin|contributor|member) [member]:
 >

 Ok dam1r89/bitbucket-cli (bitbucket-cli) (yes/no) [no]:
 > yes

 [dam1r89/bitbucket-cli] [ ]:
 > help

Commands: help, list, use, add webhook, list webhooks, add key, find, info

 [dam1r89/bitbucket-cli] [ ]:
 > add key

 Enter key path [/Users/dam1r89/.ssh/id_rsa.pub]:
 >

Creating repo:

 bb console                                                                                        ~/Desktop Damirs-MacBook-Air

 [no repo selected] [ ]:
 > create

 Repository name:
 > test-repository

New Project:

git init
git remote add origin git@://git@bitbucket.org/dam1r89/test-repository.git

Existing project:

git remote add origin git@://git@bitbucket.org/dam1r89/test-repository.git
git push -u origin --all
git push origin --tags

[no repo selected] [ ]: