Skip to content

Latest commit

 

History

History
54 lines (36 loc) · 1.28 KB

README.md

File metadata and controls

54 lines (36 loc) · 1.28 KB

bb-cli

Description

This is an example of a specialized command line tool to interact with the Bitbucket API with a focus on scaffolding repositories and projects.

Setup

Create an OAuth consumer for your Bitbucket workspace and use the token in the format of : to authenticate the CLI with your workspace.

Be sure to enable the authorizations for the consumer you want to test with the CLI.

Usage

# Show help
bb -h

# Override config file
bb --config=config.json

# Authenticate with Bitbucket
bb auth -t <token>

# List workspaces
bb list workspaces

# List projects
bb list projects -w <workspace>

# Get a project
bb get project -w <workspace> -n <project>

# Create a project
bb create project -w <workspace> -n "<name>" -k <key> -p -d "<description>"

# List repositories
bb list repositories -w <workspace> -n <project>

# Create repository
bb create repository -w <workspace> -n <project> -r <repository slug> -p

# Add access key
bb add access-key -w <workspace> -r <repository slug> -k <access key> -l <access key label>

# Add a webhook
bb add webhook -w <workspace> -r <repositor slugy> -u <webhook url> -d <webhook label> --events repo:push repo:update

# Add pipeline variable
bb add variable -w <workspace> -r <repository slug> -v <value> -l <label> -s