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.
bb repo clone
Section titled “bb repo clone”Clone a Bitbucket repository.
bb repo clone <repository> [options]Arguments
Section titled “Arguments”| 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.
Options
Section titled “Options”| Option | Description |
|---|---|
-d, --directory <dir> |
Directory to clone into |
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
# Bare name — workspace comes from the environmentBB_WORKSPACE=myworkspace bb repo clone myrepo
# Clone using full URLbb repo clone git@bitbucket.org:myworkspace/myrepo.git- For the
workspace/repoand 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 withInvalid repository format. Use workspace/repo or a full URL. --jsonemits{ success, repository, path, cloneUrl }.
bb 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 | Default |
|---|---|---|
-d, --description <description> |
Repository description | |
--private |
Create a private repository | true |
--public |
Create a public repository | |
-p, --project <project> |
Project key |
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 PROJ- Visibility is private unless
--publicis passed. If both--privateand--publicare given,--publiccurrently wins and no error is raised — unlikebb snippet createandbb project create, which reject the combination. --jsonemits the raw Bitbucket repository object, with no envelope.
bb repo list
Section titled “bb repo list”List repositories in a workspace.
bb repo list [options]Options
Section titled “Options”| Option | Description | Default |
|---|---|---|
--limit <number> |
Maximum number of repositories | 25 |
--all |
List all repositories (overrides --limit) |
Examples
Section titled “Examples”# List repositories in a workspacebb repo list -w myworkspace
# List more repositoriesbb repo list -w myworkspace --limit 50
# List every repository in the workspacebb repo list -w myworkspace --all
# 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'JSON output
Section titled “JSON output”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.
--limitcaps 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);--jsonalways carries the full values. - When the result is capped by
--limit, a hint shows how many were listed; use a higher--limitor--allto see the rest (suppressed with--json).
bb repo view
Section titled “bb repo view”View repository details.
bb repo view [repository] [options]Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
repository |
workspace/repo, or a bare repository name paired with -w. Optional inside a repository directory. |
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- Resolution order: the positional argument wins, then the global
-w/-rflags, then the git remote of the current directory. --jsonemits the raw Bitbucket repository object, with no envelope.
bb repo delete
Section titled “bb repo delete”Delete a repository.
bb repo delete <repository> [options]Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
repository |
workspace/repo, or a bare repository name when the workspace comes from -w, BB_WORKSPACE or the defaultWorkspace config key |
Options
Section titled “Options”| Option | Description |
|---|---|
-y, --yes |
Confirm deletion (required) |
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 --yes--json emits { success, workspace, repoSlug }.
bb repo default-reviewers
Section titled “bb repo default-reviewers”Default reviewers are auto-suggested when someone opens a pull request in Bitbucket’s web UI. This group reads and edits that list.
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: 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) |
# 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 --json--json emits { workspace, repoSlug, mode, count, reviewers }, where mode is effective or direct.
bb 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 pull request they have 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.