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, --no-unicode, --no-truncate, --locale <locale>, -w, --workspace, -r, --repo. See Global flags for the full list. The per-command tables below list only command-specific options. One exception: bb repo clone ignores -w, --workspace.

Clone a Bitbucket repository.

Terminal window
bb repo clone <repository> [options]
Argument Description
repository workspace/repo, a bare repository name, or a full clone URL

For a bare name, the workspace comes from BB_WORKSPACE, then the defaultWorkspace config key. The global -w is not honoured by this command.

Option Description
-d, --directory <dir> Directory to clone into
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
# Bare name — workspace comes from the environment
BB_WORKSPACE=myworkspace bb repo clone myrepo
# Clone using full URL
bb repo clone git@bitbucket.org:myworkspace/myrepo.git
  • For the workspace/repo and bare-name forms the CLI clones over SSH (git@bitbucket.org:<workspace>/<repo>.git). Pass a full HTTPS URL if you do not have SSH keys set up.
  • A path with more than one / fails with Invalid repository format. Use workspace/repo or a full URL.
  • --json emits { success, repository, path, cloneUrl }.

Create a new repository.

Terminal window
bb repo create <name> [options]
Argument Description
name Name for the new repository
Option Description Default
-d, --description <description> Repository description
--private Create a private repository true
--public Create a public repository
-p, --project <project> Project key
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
  • Visibility is private unless --public is passed. If both --private and --public are given, --public currently wins and no error is raised — unlike bb snippet create and bb project create, which reject the combination.
  • --json emits the raw Bitbucket repository object, with no envelope.

List repositories in a workspace.

Terminal window
bb repo list [options]
Option Description Default
--limit <number> Maximum number of repositories 25
--all List all repositories (overrides --limit)
Terminal window
# List repositories in a workspace
bb repo list -w myworkspace
# List more repositories
bb repo list -w myworkspace --limit 50
# List every repository in the workspace
bb repo list -w myworkspace --all
# 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'

The --json envelope is { workspace, count, repositories }, where repositories is the array of repository objects. --json <fields> drops the envelope and returns a flat array.

  • --limit caps how many repositories come back, not the page size. The CLI walks pages (at most 50 per request) until the cap is reached. A value below 1 fails with --limit must be a positive integer.
  • Long descriptions are truncated to 50 characters in the table (disable with the global --no-truncate); --json always carries the full values.
  • When the result is capped by --limit, a hint shows how many were listed; use a higher --limit or --all to see the rest (suppressed with --json).

View repository details.

Terminal window
bb repo view [repository] [options]
Argument Description
repository workspace/repo, or a bare repository name paired with -w. Optional inside a repository directory.
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
  • Resolution order: the positional argument wins, then the global -w/-r flags, then the git remote of the current directory.
  • --json emits the raw Bitbucket repository object, with no envelope.

Delete a repository.

Terminal window
bb repo delete <repository> [options]
Argument Description
repository workspace/repo, or a bare repository name when the workspace comes from -w, BB_WORKSPACE or the defaultWorkspace config key
Option Description
-y, --yes Confirm deletion (required)
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

--json emits { success, workspace, repoSlug }.


Default reviewers are auto-suggested when someone opens a pull request in Bitbucket’s web UI. This group reads and edits that list.

Terminal window
bb repo default-reviewers list [options]

By default the effective reviewer list is shown: 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)
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

--json emits { workspace, repoSlug, mode, count, reviewers }, where mode is effective or direct.

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 pull request they have 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.