Skip to content

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.

Clone a Bitbucket repository.

Terminal window
bb repo clone <repository> [options]
ArgumentDescription
repositoryRepository to clone (workspace/repo or full URL)
OptionDescription
-d, --directory <dir>Directory to clone into
--jsonOutput as JSON
Terminal window
# Clone using workspace/repo format
bb repo clone myworkspace/myrepo
# Clone into a specific directory
bb repo clone myworkspace/myrepo -d my-local-dir
# Clone using full URL
bb repo clone git@bitbucket.org:myworkspace/myrepo.git

Create a new repository.

Terminal window
bb repo create <name> [options]
ArgumentDescription
nameName for the new repository
OptionDescription
-w, --workspace <workspace>Workspace to create repository in
-d, --description <description>Repository description
--privateCreate a private repository (default)
--publicCreate a public repository
-p, --project <project>Project key
--jsonOutput as JSON
Terminal window
# Create a private repository
bb repo create my-new-repo -w myworkspace
# Create a public repository with description
bb repo create my-new-repo -w myworkspace --public -d "My awesome project"
# Create in a specific project
bb repo create my-new-repo -w myworkspace -p PROJ

List repositories in a workspace.

Terminal window
bb repo list [options]
OptionDescription
-w, --workspace <workspace>Workspace to list repositories from
--limit <number>Maximum number of repositories (default: 25)
--jsonOutput as JSON
Terminal window
# List repositories in a workspace
bb repo list -w myworkspace
# List more repositories
bb repo list -w myworkspace --limit 50
# List with JSON output for scripting
bb 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 names
bb repo list -w myworkspace --json --jq '.repositories[] | select(.is_private == false) | .full_name'
  • --limit is enforced across paginated repository responses

View repository details.

Terminal window
bb repo view [repository] [options]
ArgumentDescription
repositoryRepository to view in workspace/repo format (optional if in a repo directory)
OptionDescription
-w, --workspace <workspace>Workspace
--jsonOutput as JSON
Terminal window
# View current repository (from within repo directory)
bb repo view
# View specific repository using workspace/repo format
bb repo view myworkspace/myrepo
# View with explicit workspace option
bb repo view myrepo -w myworkspace
# Get repository details as JSON
bb repo view --json
  • The positional [repository] argument is the primary way to specify the repo (e.g., bb repo view myworkspace/myrepo). The global -w and -r flags 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.

Delete a repository. This action is permanent and cannot be undone.

Terminal window
bb repo delete <repository> [options]
ArgumentDescription
repositoryRepository to delete in workspace/repo format
OptionDescription
-w, --workspace <workspace>Workspace
-y, --yesConfirm deletion (required)
--jsonOutput as JSON
Terminal window
# Delete a repository (--yes is required to confirm)
bb repo delete myworkspace/myrepo --yes
# Delete using explicit workspace option
bb repo delete myrepo -w myworkspace --yes

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.

SubcommandDescription
listList 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)
Terminal window
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.

OptionDescription
--repo-onlyOnly show reviewers configured on the repository (exclude project-inherited)
--jsonOutput as JSON
Terminal window
# Effective list (repo + project-inherited)
bb repo default-reviewers list
# Only repo-level entries
bb repo default-reviewers list --repo-only
# JSON for scripting
bb repo default-reviewers list --json
Terminal window
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.

Terminal window
bb repo default-reviewers add "712020:3cfed7e0-0ed6-49fc-bb35-410a00ccee6f"
bb repo default-reviewers add "{c1cb1bb5-2e32-456e-a373-43978dc12aa1}"
Terminal window
bb repo default-reviewers remove <user> --yes

Removes 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}).

Terminal window
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-reviewers applies these reviewers when opening a pull request.