Repo Commands - Clone, Create & Manage Bitbucket Repositories
Manage Bitbucket repositories.
Global options available on all repo commands: --json [fields], --jq <expression>, --no-color, -w, --workspace, -r, --repo.
bb repo clone
Section titled “bb repo clone”Clone a Bitbucket repository.
bb repo clone <repository> [options]Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
repository | Repository to clone (workspace/repo or full URL) |
Options
Section titled “Options”| Option | Description |
|---|---|
-d, --directory <dir> | Directory to clone into |
--json | Output as JSON |
Examples
Section titled “Examples”# Clone using workspace/repo formatbb repo clone myworkspace/myrepo
# Clone into a specific directorybb repo clone myworkspace/myrepo -d my-local-dir
# Clone using full URLbb repo clone git@bitbucket.org:myworkspace/myrepo.gitbb repo create
Section titled “bb repo create”Create a new repository.
bb repo create <name> [options]Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
name | Name for the new repository |
Options
Section titled “Options”| Option | Description |
|---|---|
-w, --workspace <workspace> | Workspace to create repository in |
-d, --description <description> | Repository description |
--private | Create a private repository (default) |
--public | Create a public repository |
-p, --project <project> | Project key |
--json | Output as JSON |
Examples
Section titled “Examples”# Create a private repositorybb repo create my-new-repo -w myworkspace
# Create a public repository with descriptionbb repo create my-new-repo -w myworkspace --public -d "My awesome project"
# Create in a specific projectbb repo create my-new-repo -w myworkspace -p PROJbb repo list
Section titled “bb repo list”List repositories in a workspace.
bb repo list [options]Options
Section titled “Options”| Option | Description |
|---|---|
-w, --workspace <workspace> | Workspace to list repositories from |
--limit <number> | Maximum number of repositories (default: 25) |
--json | Output as JSON |
Examples
Section titled “Examples”# List repositories in a workspacebb repo list -w myworkspace
# List more repositoriesbb repo list -w myworkspace --limit 50
# List with JSON output for scriptingbb repo list -w myworkspace --json
# Project to specific fields (returns a flat array)bb repo list -w myworkspace --json full_name,is_private,language
# Filter with built-in --jq — print just public repo namesbb repo list -w myworkspace --json --jq '.repositories[] | select(.is_private == false) | .full_name'--limitis enforced across paginated repository responses
bb repo view
Section titled “bb repo view”View repository details.
bb repo view [repository] [options]Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
repository | Repository to view in workspace/repo format (optional if in a repo directory) |
Options
Section titled “Options”| Option | Description |
|---|---|
-w, --workspace <workspace> | Workspace |
--json | Output as JSON |
Examples
Section titled “Examples”# View current repository (from within repo directory)bb repo view
# View specific repository using workspace/repo formatbb repo view myworkspace/myrepo
# View with explicit workspace optionbb repo view myrepo -w myworkspace
# Get repository details as JSONbb repo view --json- The positional
[repository]argument is the primary way to specify the repo (e.g.,bb repo view myworkspace/myrepo). The global-wand-rflags also work as an alternative. - The command will automatically detect the repository from your current directory’s git remote if you don’t specify one.
bb repo delete
Section titled “bb repo delete”Delete a repository. This action is permanent and cannot be undone.
bb repo delete <repository> [options]Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
repository | Repository to delete in workspace/repo format |
Options
Section titled “Options”| Option | Description |
|---|---|
-w, --workspace <workspace> | Workspace |
-y, --yes | Confirm deletion (required) |
--json | Output as JSON |
Examples
Section titled “Examples”# Delete a repository (--yes is required to confirm)bb repo delete myworkspace/myrepo --yes
# Delete using explicit workspace optionbb repo delete myrepo -w myworkspace --yesbb repo default-reviewers
Section titled “bb repo default-reviewers”Inspect and manage the default reviewers configured on a repository. Default reviewers in Bitbucket Cloud are automatically suggested when someone opens a pull request through the web UI; this command group lets you see and edit that list from the CLI.
Subcommands
Section titled “Subcommands”| Subcommand | Description |
|---|---|
list | List the default reviewers for a repository |
add <user> | Add a default reviewer (accepts account ID or {uuid}) |
remove <user> | Remove a default reviewer (accepts account ID or {uuid}, requires --yes) |
bb repo default-reviewers list
Section titled “bb repo default-reviewers list”bb repo default-reviewers list [options]By default the effective reviewer list is shown — this includes reviewers configured directly on the repository and reviewers inherited from the parent project, matching what Bitbucket’s web UI would auto-populate.
| Option | Description |
|---|---|
--repo-only | Only show reviewers configured on the repository (exclude project-inherited) |
--json | Output as JSON |
# Effective list (repo + project-inherited)bb repo default-reviewers list
# Only repo-level entriesbb repo default-reviewers list --repo-only
# JSON for scriptingbb repo default-reviewers list --jsonbb repo default-reviewers add
Section titled “bb repo default-reviewers add”bb repo default-reviewers add <user>Adds a user as a default reviewer on the repository. Requires repository admin permission.
The <user> argument accepts either an account ID (e.g. 712020:3cfed7e0-0ed6-49fc-bb35-410a00ccee6f) or a UUID in curly braces (e.g. {c1cb1bb5-2e32-456e-a373-43978dc12aa1}). Bitbucket Cloud’s GDPR changes retired username lookups, so nicknames like jdoe are no longer accepted.
You can find a user’s account ID from the Bitbucket web UI under their profile, or by running bb pr reviewers list <pr-id> --json on a PR they’ve reviewed.
bb repo default-reviewers add "712020:3cfed7e0-0ed6-49fc-bb35-410a00ccee6f"bb repo default-reviewers add "{c1cb1bb5-2e32-456e-a373-43978dc12aa1}"bb repo default-reviewers remove
Section titled “bb repo default-reviewers remove”bb repo default-reviewers remove <user> --yesRemoves a user from the repository’s default reviewers. --yes is required to confirm. Requires repository admin permission.
<user> accepts the same identifiers as add (account ID or {uuid}).
bb repo default-reviewers remove "712020:3cfed7e0-0ed6-49fc-bb35-410a00ccee6f" --yes- Project-inherited reviewers can only be removed by editing the parent project, not the repository.
- Related:
bb pr create --default-reviewersapplies these reviewers when opening a pull request.