Skip to content

bb repo

Create, clone, browse and configure repositories

63 commands.

bb repo admin
Create, fork, update and delete repositories (4 commands)
bb repo archive
Download repository archive
bb repo browse
Read a file, a tree, its history or its blame at any ref (5 commands)
bb repo cat
Output the raw content of a file over REST
bb repo clone
Clone a repository to the local filesystem
bb repo comment
Add, list, update and delete comments on commits and pull requests (4 commands)
bb repo compare
Compare commits or branches
bb repo create
Create a new repository
bb repo default-task
Add, list, update and delete the tasks each pull request in a repository starts with (4 commands)
bb repo delete
Delete a repository
bb repo edit
Edit a file's content over REST
bb repo fork
Fork a repository
bb repo get
Show a repository's details and its README
bb repo label
Add, list and remove a repository's labels (3 commands)
bb repo list
List repositories
bb repo permissions
Grant, list and revoke repository permissions (4 commands)
bb repo settings
Read and change a repository's pull request, security and webhook settings (20 commands)
bb repo ssh-key
Add, list and remove the SSH access keys of a project or repository (3 commands)
bb repo sync
Bring a fork up to date with its origin, and turn automatic syncing on or off (3 commands)
bb repo unwatch
Unwatch repository
bb repo watch
Watch repository

bb repo admin

Create, fork, update and delete repositories

create
Create a new repository
delete
Delete a repository
fork
Fork a repository
update
Update repository metadata

bb repo admin create

Create a new repository

bb repo admin create [flags]

Alias for bb repo create.

# Create a repository in a project
bb repo admin create --project PROJ --name billing-service

# With a description and a default branch
bb repo admin create --project PROJ --name billing-service \
  --description "Billing API" --default-branch main
--default-branch string
Repository default branch
--description string
Repository description
--forkable
Repository forkable (default true)
--name string
Repository name
--project string
Project key

Inherited from bb repo admin:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Checks your permission and the current state this depends on, without changing anything (preconditions-checked)

Output with --json, where ? marks a field that can be absent
data
  repository        object
    id?             integer                                       Repository identifier.
    projectKey?     string                                        Project the repository belongs to.
    slug?           string                                        Repository slug, as it appears in URLs.
    name?           string                                        Display name, which may differ from the slug.
    description?    string                                        Description, when one was given.
    defaultBranch?  string                                        Branch a clone checks out, when the instance reports
                                                                  it.
    public          boolean                                       Whether the repository is readable without
                                                                  authentication.
    forkable        boolean                                       Whether users may fork it.
    archived        boolean                                       Whether it is archived and therefore read-only.
    scmId?          string                                        Source control system. git on every supported
                                                                  instance.
    state?          AVAILABLE|INITIALISING|INITIALISATION_FAILED
    statusMessage?  string                                        What the state means, when Bitbucket explains it.
    origin?         object                                        Repository this one was forked from.
      projectKey    string                                        Project key the repository belongs to.
      slug          string                                        Repository slug.

bb repo admin delete

Delete a repository

bb repo admin delete [PROJECT/slug] [flags]

Alias for bb repo delete.

# Delete a repository; at a terminal bb asks first
bb repo admin delete PROJ/repo

# In a script, where nobody can be asked; --yes counts only when the repository is named
bb repo admin delete PROJ/repo --yes
--yes
Skip the confirmation. Only applies when the repository is named explicitly.

Inherited from bb repo admin:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Predicts the outcome from what it can read, without changing anything (predicted)

Output with --json, where ? marks a field that can be absent
data
  status        string  Outcome of the command.
  repository    object
    projectKey  string  Project key the repository belongs to.
    slug        string  Repository slug.

bb repo admin fork

Fork a repository

bb repo admin fork [flags]

Alias for bb repo fork.

# Fork a repository
bb repo admin fork --repo PROJ/repo

# Into another project, under another name
bb repo admin fork --repo PROJ/repo --project SANDBOX --name repo-experiment
--name string
Name of the new fork
--project string
Project key of the new fork

Inherited from bb repo admin:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Predicts the outcome from what it can read, without changing anything (predicted)

Output with --json, where ? marks a field that can be absent
data
  repository        object
    id?             integer                                       Repository identifier.
    projectKey?     string                                        Project the repository belongs to.
    slug?           string                                        Repository slug, as it appears in URLs.
    name?           string                                        Display name, which may differ from the slug.
    description?    string                                        Description, when one was given.
    defaultBranch?  string                                        Branch a clone checks out, when the instance reports
                                                                  it.
    public          boolean                                       Whether the repository is readable without
                                                                  authentication.
    forkable        boolean                                       Whether users may fork it.
    archived        boolean                                       Whether it is archived and therefore read-only.
    scmId?          string                                        Source control system. git on every supported
                                                                  instance.
    state?          AVAILABLE|INITIALISING|INITIALISATION_FAILED
    statusMessage?  string                                        What the state means, when Bitbucket explains it.
    origin?         object                                        Repository this one was forked from.
      projectKey    string                                        Project key the repository belongs to.
      slug          string                                        Repository slug.

bb repo admin update

Update repository metadata

bb repo admin update [flags]
# Change a repository's description and default branch
bb repo admin update --repo PROJ/repo --description "Billing API" --default-branch main
--default-branch string
Repository default branch
--description string
Repository description
--name string
Repository name

Inherited from bb repo admin:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Predicts the outcome from what it can read, without changing anything (predicted)

Output with --json, where ? marks a field that can be absent
data
  repository        object
    id?             integer                                       Repository identifier.
    projectKey?     string                                        Project the repository belongs to.
    slug?           string                                        Repository slug, as it appears in URLs.
    name?           string                                        Display name, which may differ from the slug.
    description?    string                                        Description, when one was given.
    defaultBranch?  string                                        Branch a clone checks out, when the instance reports
                                                                  it.
    public          boolean                                       Whether the repository is readable without
                                                                  authentication.
    forkable        boolean                                       Whether users may fork it.
    archived        boolean                                       Whether it is archived and therefore read-only.
    scmId?          string                                        Source control system. git on every supported
                                                                  instance.
    state?          AVAILABLE|INITIALISING|INITIALISATION_FAILED
    statusMessage?  string                                        What the state means, when Bitbucket explains it.
    origin?         object                                        Repository this one was forked from.
      projectKey    string                                        Project key the repository belongs to.
      slug          string                                        Repository slug.

bb repo archive

Download repository archive

bb repo archive [flags]
# Download the repository as repo.zip
bb repo archive --repo PROJ/repo

# One directory of a tagged release, as a tarball
bb repo archive --repo PROJ/repo --at v1.2.0 --path docs --format tar.gz \
  --output docs-1.2.0.tar.gz
--at string
The commit to stream an archive of
--format string
The format to stream the archive in (one of: zip, tar, tar.gz, tgz) (default "zip")
-o, --output string
Output filename (use '-' for stdout, defaults to <repo-slug>.<format>)
--path string
Paths to include in the streamed archive
--prefix string
A prefix to apply to all entries in the streamed archive
--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Runs as usual: this command changes nothing, so there is nothing to hold back

Output with --json, where ? marks a field that can be absent
data
  status        string  Outcome of the command.
  repository    object
    projectKey  string  Project key the repository belongs to.
    slug        string  Repository slug.
  file          string  Path the archive was written to.

bb repo browse

Read a file, a tree, its history or its blame at any ref

blame
Get file blame
file
Get structured file content
history
List commit history for a file
raw
Get raw file content
tree
List repository files in a directory

bb repo browse blame

Get file blame

bb repo browse blame <path> [flags]
# Who last changed each line of a file
bb repo browse blame src/main.go --repo PROJ/repo
--at string
Commit ID or ref

Inherited from bb repo browse:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Runs as usual: this command changes nothing, so there is nothing to hold back

Output with --json, where ? marks a field that can be absent
data
  repository    object
    projectKey  string                  Project key the repository belongs to.
    slug        string                  Repository slug.
  path          string                  File that was read.
  at?           string                  Commit or ref it was read at, when --at was given.
  binary        boolean                 Whether Bitbucket refused to render the file as text.
  complete      boolean                 Whether lines is the whole file.
  lines         list of object or null  The file's lines, in order.
    text        string                  The line, without its terminator.
    author?     string                  Who last changed it.

bb repo browse file

Get structured file content

bb repo browse file <path> [flags]
# A file's content line by line, on a branch of your choice
bb repo browse file src/main.go --repo PROJ/repo --at feature/x
--at string
Commit ID or ref

Inherited from bb repo browse:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Runs as usual: this command changes nothing, so there is nothing to hold back

Output with --json, where ? marks a field that can be absent
data
  repository    object
    projectKey  string                  Project key the repository belongs to.
    slug        string                  Repository slug.
  path          string                  File that was read.
  at?           string                  Commit or ref it was read at, when --at was given.
  binary        boolean                 Whether Bitbucket refused to render the file as text.
  complete      boolean                 Whether lines is the whole file.
  lines         list of object or null  The file's lines, in order.
    text        string                  The line, without its terminator.
    author?     string                  Who last changed it.

bb repo browse history

List commit history for a file

bb repo browse history <path> [flags]
# The commits that changed a file
bb repo browse history src/main.go --repo PROJ/repo
--all
Return every result rather than the first --limit
--limit int
Maximum number of results to return (default 25)

Inherited from bb repo browse:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Runs as usual: this command changes nothing, so there is nothing to hold back

Output with --json, where ? marks a field that can be absent
data
  repository             object
    projectKey           string                  Project key the repository belongs to.
    slug                 string                  Repository slug.
  path                   string                  File the history is for.
  commits                list of object or null  Commits that touched it, newest first.
    id?                  string                  Full 40-character SHA1.
    displayId?           string                  Abbreviated SHA1 as Bitbucket renders it.
    message?             string                  Full commit message, including the body.
    author?              object                  Who wrote the change.
      name?              string                  Display name.
      emailAddress?      string                  Email address, when the instance exposes it.
      avatarUrl?         string                  URL of the avatar image, when one is configured.
    authorTimestamp?     integer                 When the change was written, in milliseconds since the epoch.
    committer?           object                  Who committed the change.
      name?              string                  Display name.
      emailAddress?      string                  Email address, when the instance exposes it.
      avatarUrl?         string                  URL of the avatar image, when one is configured.
    committerTimestamp?  integer                 When the change was committed, in milliseconds since the epoch.
    parents?             list of string          Commit ids of the parents.

bb repo browse raw

Get raw file content

bb repo browse raw <path> [flags]

The file is written to stdout as it arrives, byte for byte, whatever its size. With --json it is returned inside the document instead -- as text, or as base64 when it is not text -- which holds it in memory, so a file larger than 64 MiB is refused under --json.

# A file's bytes, saved locally
bb repo browse raw docs/logo.png --repo PROJ/repo > logo.png
--at string
Commit ID or ref

Inherited from bb repo browse:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Runs as usual: this command changes nothing, so there is nothing to hold back

Output with --json, where ? marks a field that can be absent
data
  repository    object
    projectKey  string  Project key the repository belongs to.
    slug        string  Repository slug.
  path          string  File that was read.
  at?           string  Commit or ref it was read at, when --at was given.
  encoding      string  How content is encoded: utf-8 for text, base64 for anything that is not valid UTF-8.
  content       string  The file.

bb repo browse tree

List repository files in a directory

bb repo browse tree [path] [flags]
# The files at the top of a repository
bb repo browse tree --repo PROJ/repo

# In a directory, at a tag
bb repo browse tree src --repo PROJ/repo --at v1.2.0
--all
Return every result rather than the first --limit
--at string
Commit ID or ref to browse
--limit int
Maximum number of results to return (default 1000)

Inherited from bb repo browse:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Runs as usual: this command changes nothing, so there is nothing to hold back

Output with --json, where ? marks a field that can be absent
data
  repository    object
    projectKey  string                  Project key the repository belongs to.
    slug        string                  Repository slug.
  path          string                  Directory that was listed, empty for the repository root.
  files         list of string or null  Paths under that directory, relative to the repository root.

bb repo cat

Output the raw content of a file over REST

bb repo cat <path> [flags]

The file is written to stdout as it arrives, byte for byte, whatever its size. With --json it is returned inside the document instead -- as text, or as base64 when it is not text -- which holds it in memory, so a file larger than 64 MiB is refused under --json.

# Print a file without cloning the repository
bb repo cat README.md --repo PROJ/repo

# As it was at a tag
bb repo cat README.md --repo PROJ/repo --at v1.2.0
--at string
Commit ID or ref to cat
--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Runs as usual: this command changes nothing, so there is nothing to hold back

Output with --json, where ? marks a field that can be absent
data
  repository    object
    projectKey  string  Project key the repository belongs to.
    slug        string  Repository slug.
  path          string  File that was read.
  at?           string  Commit or ref it was read at, when --at was given.
  encoding      string  How content is encoded: utf-8 for text, base64 for anything that is not valid UTF-8.
  content       string  The file.

bb repo clone

Clone a repository to the local filesystem

bb repo clone <repository> [directory] [-- <gitflags>...] [flags]

Also available as bb clone.

# Clone into a directory named after the repository
bb repo clone PROJ/repo

# By the address the browser shows, into a directory of your choice
bb repo clone https://bitbucket.example.com/projects/PROJ/repos/repo work/repo

# Over HTTPS only, passing flags on to git
bb repo clone PROJ/repo --https -- --depth 1
--https
Use HTTPS only and skip the SSH clone attempt
--no-upstream
Do not add an upstream remote when cloning a fork
--ssh
Use SSH only and disable HTTPS fallback
-u, --upstream-remote-name string
Upstream remote name when cloning a fork (default "upstream")

Also takes the global flags.

Dry run: Shows that it would clone into a new directory, without doing it; nothing is checked first (predicted)

Output with --json, where ? marks a field that can be absent
data
  status           string   Outcome of the command.
  repository       object
    projectKey     string   Project key the repository belongs to.
    slug           string   Repository slug.
  cloneUrl         string   URL git was pointed at.
  directory        string   Directory the working tree landed in.
  noUpstream       boolean  Whether --no-upstream was passed, which stops bb looking for a parent at all.
  upstream         object
    configured     boolean  Whether the remote was added.
    name           string   Remote name that was used or would have been.
    url            string   Parent repository's clone URL.
  repositoryInput  object
    raw            string   The argument as it was typed.
    usedUrl        boolean  Whether that argument was a clone URL rather than a PROJECT/slug.

bb repo comment

Add, list, update and delete comments on commits and pull requests

create
Create a comment
delete
Delete a comment
list
List comments
update
Update a comment

bb repo comment create

Create a comment

bb repo comment create [flags]

Create a comment on a commit or a pull request.

Pass --parent to reply to an existing comment rather than start a new thread. The id to pass is the one bb repo comment list reports; a reply carries reply and parentId in that listing, so a thread can be walked back to its root.

# Comment on a line of a file in a commit
bb repo comment create --commit a1b2c3d --repo PROJ/repo \
  --path src/main.go --line 41 --text "This swallows the error."

# Reply to a comment on a pull request
bb repo comment create --pr 42 --repo PROJ/repo --parent 1389396 --text "Fixed."
--line int
Line within --path to anchor the comment to
--line-type string
Which side of the diff --line refers to (one of: ADDED, REMOVED, CONTEXT)
--parent int
Reply to this comment id instead of starting a new thread
--path string
Anchor the comment to this file, which is what makes it listable
--text string
Comment text

Inherited from bb repo comment:

--commit string
Commit ID context
--pr string
Pull request ID context
--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Predicts the outcome from what it can read, without changing anything (predicted)

Output with --json, where ? marks a field that can be absent
data
  context            object
    type             commit|pull_request
    projectKey       string                 Project the repository belongs to.
    slug             string                 Repository slug.
    commitId?        string                 Commit the comment is on.
    pullRequestId?   string                 Pull request the comment is on.
  comment            object
    id?              integer                Comment identifier.
    version          integer                Optimistic-locking version.
    text?            string                 The comment text.
    state?           OPEN|RESOLVED|PENDING
    severity?        string                 NORMAL for an ordinary comment, BLOCKER for a task.
    pending          boolean                Whether this is an unpublished draft comment.
    resolved         boolean                Whether the thread this comment belongs to is resolved.
    anchored         boolean                Whether the comment is attached to a line rather than to the commit or pull
                                            request.
    reply            boolean                Whether this comment is a reply to another rather than the root of a thread.
    parentId?        integer                Comment this one replies to.
    anchor?          object                 Where in the diff it sits.
      path?          string                 File the comment is anchored to.
      srcPath?       string                 Path before a rename, when the file was renamed.
      line?          integer                Line within that file.
      lineType?      string                 ADDED, REMOVED or CONTEXT.
      fileType?      string                 FROM or TO, which side of the diff the line is on.
      diffType?      string                 COMMIT, EFFECTIVE or RANGE.
      fromHash?      string                 Commit the diff was taken from.
      toHash?        string                 Commit the diff was taken to.
    author?          object                 Who wrote it.
      id?            integer                User identifier.
      name?          string                 Username.
      displayName?   string                 Human-readable name.
      emailAddress?  string                 Email address, when the instance exposes it.
      slug?          string                 URL-safe form of the username.
      type?          string                 Account kind: NORMAL for a person, SERVICE for an integration account.
      active         boolean                Whether the account is enabled.
    replyCount       integer                Direct replies to this comment.
    createdDate?     integer                When it was written, in milliseconds since the epoch.
    updatedDate?     integer                When it last changed, in milliseconds since the epoch.
    resolvedDate?    integer                When it was resolved, in milliseconds since the epoch.
    properties?      map of any             Per-comment extras Bitbucket attaches, reactions among them.

bb repo comment delete

Delete a comment

bb repo comment delete [flags]
# Delete a comment on a commit
bb repo comment delete --commit a1b2c3d --id 1389396 --repo PROJ/repo
--id string
Comment ID
--version int32
Expected comment version
-y, --yes
Confirm without being asked; applies only when the target is named with --repo PROJECT/slug

Inherited from bb repo comment:

--commit string
Commit ID context
--pr string
Pull request ID context
--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Checks your permission and the current state this depends on, without changing anything (preconditions-checked)

Output with --json, where ? marks a field that can be absent
data
  status            string               Outcome of the command.
  context           object
    type            commit|pull_request
    projectKey      string               Project the repository belongs to.
    slug            string               Repository slug.
    commitId?       string               Commit the comment is on.
    pullRequestId?  string               Pull request the comment is on.
  id                string               Identifier of the comment that was deleted, as it was given on the command
                                         line.
  version?          integer              Version the delete was performed against.

bb repo comment list

List comments

bb repo comment list [flags]
# The comments on one file of a commit
bb repo comment list --commit a1b2c3d --path src/main.go --repo PROJ/repo

# Of a pull request
bb repo comment list --pr 42 --path src/main.go --repo PROJ/repo
--all
Return every result rather than the first --limit
--limit int
Maximum number of results to return (default 25)
--path string
File path to scope the listing to. Bitbucket requires it: a comment anchored to no file cannot be listed.

Inherited from bb repo comment:

--commit string
Commit ID context
--pr string
Pull request ID context
--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Runs as usual: this command changes nothing, so there is nothing to hold back

Output with --json, where ? marks a field that can be absent
data
  context            object
    type             commit|pull_request
    projectKey       string                  Project the repository belongs to.
    slug             string                  Repository slug.
    commitId?        string                  Commit the comment is on.
    pullRequestId?   string                  Pull request the comment is on.
  comments           list of object or null  Comments in that context.
    id?              integer                 Comment identifier.
    version          integer                 Optimistic-locking version.
    text?            string                  The comment text.
    state?           OPEN|RESOLVED|PENDING
    severity?        string                  NORMAL for an ordinary comment, BLOCKER for a task.
    pending          boolean                 Whether this is an unpublished draft comment.
    resolved         boolean                 Whether the thread this comment belongs to is resolved.
    anchored         boolean                 Whether the comment is attached to a line rather than to the commit or pull
                                             request.
    reply            boolean                 Whether this comment is a reply to another rather than the root of a
                                             thread.
    parentId?        integer                 Comment this one replies to.
    anchor?          object                  Where in the diff it sits.
      path?          string                  File the comment is anchored to.
      srcPath?       string                  Path before a rename, when the file was renamed.
      line?          integer                 Line within that file.
      lineType?      string                  ADDED, REMOVED or CONTEXT.
      fileType?      string                  FROM or TO, which side of the diff the line is on.
      diffType?      string                  COMMIT, EFFECTIVE or RANGE.
      fromHash?      string                  Commit the diff was taken from.
      toHash?        string                  Commit the diff was taken to.
    author?          object                  Who wrote it.
      id?            integer                 User identifier.
      name?          string                  Username.
      displayName?   string                  Human-readable name.
      emailAddress?  string                  Email address, when the instance exposes it.
      slug?          string                  URL-safe form of the username.
      type?          string                  Account kind: NORMAL for a person, SERVICE for an integration account.
      active         boolean                 Whether the account is enabled.
    replyCount       integer                 Direct replies to this comment.
    createdDate?     integer                 When it was written, in milliseconds since the epoch.
    updatedDate?     integer                 When it last changed, in milliseconds since the epoch.
    resolvedDate?    integer                 When it was resolved, in milliseconds since the epoch.
    properties?      map of any              Per-comment extras Bitbucket attaches, reactions among them.

bb repo comment update

Update a comment

bb repo comment update [flags]
# Reword a comment on a pull request
bb repo comment update --pr 42 --id 1389396 --repo PROJ/repo --text "Fixed in a1b2c3d."
--id string
Comment ID
--text string
Comment text
--version int32
Expected comment version

Inherited from bb repo comment:

--commit string
Commit ID context
--pr string
Pull request ID context
--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Checks your permission and the current state this depends on, without changing anything (preconditions-checked)

Output with --json, where ? marks a field that can be absent
data
  context            object
    type             commit|pull_request
    projectKey       string                 Project the repository belongs to.
    slug             string                 Repository slug.
    commitId?        string                 Commit the comment is on.
    pullRequestId?   string                 Pull request the comment is on.
  comment            object
    id?              integer                Comment identifier.
    version          integer                Optimistic-locking version.
    text?            string                 The comment text.
    state?           OPEN|RESOLVED|PENDING
    severity?        string                 NORMAL for an ordinary comment, BLOCKER for a task.
    pending          boolean                Whether this is an unpublished draft comment.
    resolved         boolean                Whether the thread this comment belongs to is resolved.
    anchored         boolean                Whether the comment is attached to a line rather than to the commit or pull
                                            request.
    reply            boolean                Whether this comment is a reply to another rather than the root of a thread.
    parentId?        integer                Comment this one replies to.
    anchor?          object                 Where in the diff it sits.
      path?          string                 File the comment is anchored to.
      srcPath?       string                 Path before a rename, when the file was renamed.
      line?          integer                Line within that file.
      lineType?      string                 ADDED, REMOVED or CONTEXT.
      fileType?      string                 FROM or TO, which side of the diff the line is on.
      diffType?      string                 COMMIT, EFFECTIVE or RANGE.
      fromHash?      string                 Commit the diff was taken from.
      toHash?        string                 Commit the diff was taken to.
    author?          object                 Who wrote it.
      id?            integer                User identifier.
      name?          string                 Username.
      displayName?   string                 Human-readable name.
      emailAddress?  string                 Email address, when the instance exposes it.
      slug?          string                 URL-safe form of the username.
      type?          string                 Account kind: NORMAL for a person, SERVICE for an integration account.
      active         boolean                Whether the account is enabled.
    replyCount       integer                Direct replies to this comment.
    createdDate?     integer                When it was written, in milliseconds since the epoch.
    updatedDate?     integer                When it last changed, in milliseconds since the epoch.
    resolvedDate?    integer                When it was resolved, in milliseconds since the epoch.
    properties?      map of any             Per-comment extras Bitbucket attaches, reactions among them.

bb repo compare

Compare commits or branches

bb repo compare <from> <to> [flags]

Compare commits or branches: what is reachable from <from> but not from <to>. Pass the ref you are asking about first; git log's range puts it last.

bb repo compare feature/x main        # what feature/x adds
bb repo compare main feature/x        # nothing, unless main has moved
# The commits feature/x adds to main
bb repo compare feature/x main --repo PROJ/repo

# As a diff
bb repo compare feature/x main --repo PROJ/repo --diff
--diff
Show the unified diff of the changes
--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Runs as usual: this command changes nothing, so there is nothing to hold back

Output with --json, where ? marks a field that can be absent
data
  repository     object
    projectKey   string                  Project key the repository belongs to.
    slug         string                  Repository slug.
  from           string                  Ref the comparison started at.
  to             string                  Ref it ended at.
  changes        list of object or null  Files that differ between the two.
    path         string                  Path after the change.
    srcPath?     string                  Path before a rename or copy.
    type?        string                  ADD, MODIFY, DELETE, COPY, MOVE or UNKNOWN.
    nodeType?    string                  FILE, DIRECTORY or SUBMODULE.
    executable?  boolean                 Whether the file is executable after the change.
  patch?         string                  The unified diff, when --diff was passed.

bb repo create

Create a new repository

bb repo create [flags]

Also available as bb repo admin create.

# Create a repository in a project
bb repo create --project PROJ --name billing-service

# With a description and a default branch
bb repo create --project PROJ --name billing-service \
  --description "Billing API" --default-branch main
--default-branch string
Repository default branch
--description string
Repository description
--forkable
Repository forkable (default true)
--name string
Repository name
--project string
Project key

Also takes the global flags.

Dry run: Checks your permission and the current state this depends on, without changing anything (preconditions-checked)

Output with --json, where ? marks a field that can be absent
data
  repository        object
    id?             integer                                       Repository identifier.
    projectKey?     string                                        Project the repository belongs to.
    slug?           string                                        Repository slug, as it appears in URLs.
    name?           string                                        Display name, which may differ from the slug.
    description?    string                                        Description, when one was given.
    defaultBranch?  string                                        Branch a clone checks out, when the instance reports
                                                                  it.
    public          boolean                                       Whether the repository is readable without
                                                                  authentication.
    forkable        boolean                                       Whether users may fork it.
    archived        boolean                                       Whether it is archived and therefore read-only.
    scmId?          string                                        Source control system. git on every supported
                                                                  instance.
    state?          AVAILABLE|INITIALISING|INITIALISATION_FAILED
    statusMessage?  string                                        What the state means, when Bitbucket explains it.
    origin?         object                                        Repository this one was forked from.
      projectKey    string                                        Project key the repository belongs to.
      slug          string                                        Repository slug.

bb repo default-task

Add, list, update and delete the tasks each pull request in a repository starts with

add
Add a default checklist task
delete
Delete a default checklist task
list
List default checklist tasks
update
Update a default checklist task

bb repo default-task add

Add a default checklist task

bb repo default-task add <description> [flags]
# A task every new pull request in the repository starts with
bb repo default-task add "Update the changelog" --repo PROJ/repo

# Only for pull requests from a feature branch into main
bb repo default-task add "Update the changelog" --repo PROJ/repo \
  --source-ref 'feature/*' --target-ref main
--source-ref string
Source ref to match; a glob matches as a pattern, anything else as a branch (default: any ref)
--target-ref string
Target ref to match; a glob matches as a pattern, anything else as a branch (default: any ref)

Inherited from bb repo default-task:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Predicts the outcome from what it can read, without changing anything (predicted)

Output with --json, where ? marks a field that can be absent
data
  repository        object
    projectKey      string                                                             Project key the repository belongs to.
    slug            string                                                             Repository slug.
  task              object
    id?             integer                                                            Task identifier, which update and delete
                                                                                       address.
    description?    string                                                             The task text, which appears on every
                                                                                       pull request the matchers cover.
    sourceMatcher?  object                                                             Which source branches the task applies
                                                                                       to; type ANY_REF when it applies to all
                                                                                       of them.
      id?           string                                                             Matcher value: a branch name, a pattern,
                                                                                       or a model branch id depending on type.
      displayId?    string                                                             Human-readable form of the same thing.
      type?         ANY_REF|BRANCH|PATTERN|MODEL_BRANCH|MODEL_CATEGORY|DEFAULT_BRANCH  ANY_REF, BRANCH, PATTERN, MODEL_BRANCH,
                                                                                       MODEL_CATEGORY or DEFAULT_BRANCH, which
                                                                                       decides how id is read.
    targetMatcher?  object                                                             Which target branches the task applies
                                                                                       to; type ANY_REF when it applies to all
                                                                                       of them.
      id?           string                                                             Matcher value: a branch name, a pattern,
                                                                                       or a model branch id depending on type.
      displayId?    string                                                             Human-readable form of the same thing.
      type?         ANY_REF|BRANCH|PATTERN|MODEL_BRANCH|MODEL_CATEGORY|DEFAULT_BRANCH  ANY_REF, BRANCH, PATTERN, MODEL_BRANCH,
                                                                                       MODEL_CATEGORY or DEFAULT_BRANCH, which
                                                                                       decides how id is read.
    scope?          PROJECT|REPOSITORY                                                 PROJECT when the task is set on the
                                                                                       project, and a repository inherits it;
                                                                                       REPOSITORY when it is set on the
                                                                                       repository itself.

bb repo default-task delete

Delete a default checklist task

bb repo default-task delete <task-id> [flags]

Delete one of the repository's default checklist tasks.

A task the repository inherits from its project is refused; bb project default-task delete deletes it there, for every repository in the project.

# By the id bb repo default-task list prints
bb repo default-task delete 3 --repo PROJ/repo
-y, --yes
Confirm without being asked; applies only when the target is named with --repo PROJECT/slug

Inherited from bb repo default-task:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Checks your permission and the current state this depends on, without changing anything (preconditions-checked)

Output with --json, where ? marks a field that can be absent
data
  status        string  Outcome of the command.
  repository    object
    projectKey  string  Project key the repository belongs to.
    slug        string  Repository slug.
  id            string  Identifier of the task that was deleted, as it was given on the command line.

bb repo default-task list

List default checklist tasks

bb repo default-task list

List the repository's default checklist tasks, and those it inherits from its project, which are marked as inherited. bb project default-task changes an inherited one.

# The repository's own tasks, and those it inherits from its project
bb repo default-task list --repo PROJ/repo

Inherited from bb repo default-task:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Runs as usual: this command changes nothing, so there is nothing to hold back

Output with --json, where ? marks a field that can be absent
data
  repository        object
    projectKey      string                                                             Project key the repository belongs to.
    slug            string                                                             Repository slug.
  tasks             list of object or null                                             Default checklist tasks on the
                                                                                       repository.
    id?             integer                                                            Task identifier, which update and delete
                                                                                       address.
    description?    string                                                             The task text, which appears on every
                                                                                       pull request the matchers cover.
    sourceMatcher?  object                                                             Which source branches the task applies
                                                                                       to; type ANY_REF when it applies to all
                                                                                       of them.
      id?           string                                                             Matcher value: a branch name, a pattern,
                                                                                       or a model branch id depending on type.
      displayId?    string                                                             Human-readable form of the same thing.
      type?         ANY_REF|BRANCH|PATTERN|MODEL_BRANCH|MODEL_CATEGORY|DEFAULT_BRANCH  ANY_REF, BRANCH, PATTERN, MODEL_BRANCH,
                                                                                       MODEL_CATEGORY or DEFAULT_BRANCH, which
                                                                                       decides how id is read.
    targetMatcher?  object                                                             Which target branches the task applies
                                                                                       to; type ANY_REF when it applies to all
                                                                                       of them.
      id?           string                                                             Matcher value: a branch name, a pattern,
                                                                                       or a model branch id depending on type.
      displayId?    string                                                             Human-readable form of the same thing.
      type?         ANY_REF|BRANCH|PATTERN|MODEL_BRANCH|MODEL_CATEGORY|DEFAULT_BRANCH  ANY_REF, BRANCH, PATTERN, MODEL_BRANCH,
                                                                                       MODEL_CATEGORY or DEFAULT_BRANCH, which
                                                                                       decides how id is read.
    scope?          PROJECT|REPOSITORY                                                 PROJECT when the task is set on the
                                                                                       project, and a repository inherits it;
                                                                                       REPOSITORY when it is set on the
                                                                                       repository itself.

bb repo default-task update

Update a default checklist task

bb repo default-task update <task-id> [flags]

Update one of the repository's default checklist tasks.

A task the repository inherits from its project is refused; bb project default-task update changes it there, for every repository in the project.

# Reword a task
bb repo default-task update 3 --repo PROJ/repo --description "Update CHANGELOG.md"
--description string
New task description
--source-ref string
New source ref to match; a glob matches as a pattern, anything else as a branch (default: any ref)
--target-ref string
New target ref to match; a glob matches as a pattern, anything else as a branch (default: any ref)

Inherited from bb repo default-task:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Checks your permission and the current state this depends on, without changing anything (preconditions-checked)

Output with --json, where ? marks a field that can be absent
data
  repository        object
    projectKey      string                                                             Project key the repository belongs to.
    slug            string                                                             Repository slug.
  task              object
    id?             integer                                                            Task identifier, which update and delete
                                                                                       address.
    description?    string                                                             The task text, which appears on every
                                                                                       pull request the matchers cover.
    sourceMatcher?  object                                                             Which source branches the task applies
                                                                                       to; type ANY_REF when it applies to all
                                                                                       of them.
      id?           string                                                             Matcher value: a branch name, a pattern,
                                                                                       or a model branch id depending on type.
      displayId?    string                                                             Human-readable form of the same thing.
      type?         ANY_REF|BRANCH|PATTERN|MODEL_BRANCH|MODEL_CATEGORY|DEFAULT_BRANCH  ANY_REF, BRANCH, PATTERN, MODEL_BRANCH,
                                                                                       MODEL_CATEGORY or DEFAULT_BRANCH, which
                                                                                       decides how id is read.
    targetMatcher?  object                                                             Which target branches the task applies
                                                                                       to; type ANY_REF when it applies to all
                                                                                       of them.
      id?           string                                                             Matcher value: a branch name, a pattern,
                                                                                       or a model branch id depending on type.
      displayId?    string                                                             Human-readable form of the same thing.
      type?         ANY_REF|BRANCH|PATTERN|MODEL_BRANCH|MODEL_CATEGORY|DEFAULT_BRANCH  ANY_REF, BRANCH, PATTERN, MODEL_BRANCH,
                                                                                       MODEL_CATEGORY or DEFAULT_BRANCH, which
                                                                                       decides how id is read.
    scope?          PROJECT|REPOSITORY                                                 PROJECT when the task is set on the
                                                                                       project, and a repository inherits it;
                                                                                       REPOSITORY when it is set on the
                                                                                       repository itself.

bb repo delete

Delete a repository

bb repo delete [PROJECT/slug] [flags]

Name the repository as a PROJECT/slug argument or with --repo. Without one it is inferred from the git remote, and --yes does not apply to an inferred target: a safety flag that works on a target you did not name is not one. At a terminal the confirmation names what will be deleted.

Also available as bb repo admin delete.

# Delete a repository; at a terminal bb asks first
bb repo delete PROJ/repo

# In a script, where nobody can be asked; --yes counts only when the repository is named
bb repo delete PROJ/repo --yes
--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)
--yes
Skip the confirmation. Only applies when the repository is named explicitly.

Also takes the global flags.

Dry run: Predicts the outcome from what it can read, without changing anything (predicted)

Output with --json, where ? marks a field that can be absent
data
  status        string  Outcome of the command.
  repository    object
    projectKey  string  Project key the repository belongs to.
    slug        string  Repository slug.

bb repo edit

Edit a file's content over REST

bb repo edit <path> [flags]
# Change a file on a branch in one commit, naming the commit you read it at
bb repo edit VERSION --repo PROJ/repo --branch main --source-commit a1b2c3d \
  --content "1.2.1" --message "Bump the version to 1.2.1"

# Add a file on a new branch cut from main, with its content from stdin
bb repo edit docs/notes.md --repo PROJ/repo --branch feature/notes \
  --source-branch main --content - --message "Add notes" < notes.md
--branch string
The branch on which the file should be modified or created
--content string
The full content of the file
--message string
Commit message
--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)
--source-branch string
Starting point branch
--source-commit string
Commit ID before editing

Also takes the global flags.

Dry run: Predicts the outcome from what it can read, without changing anything (predicted)

Output with --json, where ? marks a field that can be absent
data
  repository             object
    projectKey           string          Project key the repository belongs to.
    slug                 string          Repository slug.
  path                   string          File that was written.
  branch?                string          Branch the commit landed on.
  commit                 object          The commit the edit produced.
    id?                  string          Full 40-character SHA1.
    displayId?           string          Abbreviated SHA1 as Bitbucket renders it.
    message?             string          Full commit message, including the body.
    author?              object          Who wrote the change.
      name?              string          Display name.
      emailAddress?      string          Email address, when the instance exposes it.
      avatarUrl?         string          URL of the avatar image, when one is configured.
    authorTimestamp?     integer         When the change was written, in milliseconds since the epoch.
    committer?           object          Who committed the change.
      name?              string          Display name.
      emailAddress?      string          Email address, when the instance exposes it.
      avatarUrl?         string          URL of the avatar image, when one is configured.
    committerTimestamp?  integer         When the change was committed, in milliseconds since the epoch.
    parents?             list of string  Commit ids of the parents.

bb repo fork

Fork a repository

bb repo fork [flags]

Also available as bb repo admin fork.

# Fork a repository
bb repo fork --repo PROJ/repo

# Into another project, under another name
bb repo fork --repo PROJ/repo --project SANDBOX --name repo-experiment
--name string
Name of the new fork
--project string
Project key of the new fork
--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Predicts the outcome from what it can read, without changing anything (predicted)

Output with --json, where ? marks a field that can be absent
data
  repository        object
    id?             integer                                       Repository identifier.
    projectKey?     string                                        Project the repository belongs to.
    slug?           string                                        Repository slug, as it appears in URLs.
    name?           string                                        Display name, which may differ from the slug.
    description?    string                                        Description, when one was given.
    defaultBranch?  string                                        Branch a clone checks out, when the instance reports
                                                                  it.
    public          boolean                                       Whether the repository is readable without
                                                                  authentication.
    forkable        boolean                                       Whether users may fork it.
    archived        boolean                                       Whether it is archived and therefore read-only.
    scmId?          string                                        Source control system. git on every supported
                                                                  instance.
    state?          AVAILABLE|INITIALISING|INITIALISATION_FAILED
    statusMessage?  string                                        What the state means, when Bitbucket explains it.
    origin?         object                                        Repository this one was forked from.
      projectKey    string                                        Project key the repository belongs to.
      slug          string                                        Repository slug.

bb repo get

Show a repository's details and its README

Aliases: bb repo view

bb repo get [flags]

Show a repository's description, state and clone URLs, followed by its README.

The README is the file Bitbucket picks from the default branch, printed as raw markup: bb does not render it. A repository without a README says so rather than failing. --readme=false leaves the README out and skips the request for it.

bb repo view is the gh spelling of the same command. To open the repository in a browser, use bb browse.

# Describe a repository and print its README
bb repo get --repo PROJ/repo

# Only the details
bb repo get --repo PROJ/repo --readme=false
--readme
Include the README; --readme=false leaves it out (default true)
--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Runs as usual: this command changes nothing, so there is nothing to hold back

Output with --json, where ? marks a field that can be absent
data
  repository        object
    id?             integer                                       Repository identifier.
    projectKey?     string                                        Project the repository belongs to.
    slug?           string                                        Repository slug, as it appears in URLs.
    name?           string                                        Display name, which may differ from the slug.
    description?    string                                        Description, when one was given.
    defaultBranch?  string                                        Branch a clone checks out, when the instance reports
                                                                  it.
    public          boolean                                       Whether the repository is readable without
                                                                  authentication.
    forkable        boolean                                       Whether users may fork it.
    archived        boolean                                       Whether it is archived and therefore read-only.
    scmId?          string                                        Source control system. git on every supported
                                                                  instance.
    state?          AVAILABLE|INITIALISING|INITIALISATION_FAILED
    statusMessage?  string                                        What the state means, when Bitbucket explains it.
    origin?         object                                        Repository this one was forked from.
      projectKey    string                                        Project key the repository belongs to.
      slug          string                                        Repository slug.
  cloneUrls         list of object or null                        Where the repository can be cloned from, one entry per
                                                                  protocol the instance serves.
    name            string                                        Protocol, as Bitbucket names it: http or ssh.
    url             string                                        The URL git clones from.
  readme?           object                                        The README.
    encoding        string                                        How content is encoded: utf-8 for text, base64 for
                                                                  anything that is not valid UTF-8.
    content         string                                        The README as raw markup.

bb repo label

Add, list and remove a repository's labels

add
Add a repository label
list
List repository labels
remove
Remove a repository label

bb repo label add

Add a repository label

bb repo label add <label>
# Label a repository
bb repo label add backend --repo PROJ/repo

Inherited from bb repo label:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Predicts the outcome from what it can read, without changing anything (predicted)

Output with --json, where ? marks a field that can be absent
data
  status        string  Outcome of the command.
  repository    object
    projectKey  string  Project key the repository belongs to.
    slug        string  Repository slug.
  label         string  The label that was added or removed.

bb repo label list

List repository labels

bb repo label list
# A repository's labels
bb repo label list --repo PROJ/repo

Inherited from bb repo label:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Runs as usual: this command changes nothing, so there is nothing to hold back

Output with --json, where ? marks a field that can be absent
data
  repository    object
    projectKey  string                  Project key the repository belongs to.
    slug        string                  Repository slug.
  labels        list of string or null  Labels on the repository.

bb repo label remove

Remove a repository label

bb repo label remove <label> [flags]
# Take a label off a repository
bb repo label remove backend --repo PROJ/repo
-y, --yes
Confirm without being asked; applies only when the target is named with --repo PROJECT/slug

Inherited from bb repo label:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Predicts the outcome from what it can read, without changing anything (predicted)

Output with --json, where ? marks a field that can be absent
data
  status        string  Outcome of the command.
  repository    object
    projectKey  string  Project key the repository belongs to.
    slug        string  Repository slug.
  label         string  The label that was added or removed.

bb repo list

List repositories

bb repo list [flags]
# The repositories you can see
bb repo list

# Every repository of one project
bb repo list --project PROJ --all
--all
Return every result rather than the first --limit
--limit int
Maximum number of results to return (default 25)
--project string
Filter by project key
--start int
Start offset for list operations

Also takes the global flags.

Dry run: Runs as usual: this command changes nothing, so there is nothing to hold back

Output with --json, where ? marks a field that can be absent
data          list of object
  projectKey  string          Project key the repository belongs to.
  slug        string          Repository slug, as it appears in URLs.
  name?       string          Display name, which may differ from the slug.
  public      boolean         Whether the repository is readable without authentication.

bb repo permissions

Grant, list and revoke repository permissions

grant
Grant a repository permission to a user or group
list
List users or groups with repository permissions
revoke
Revoke a repository permission from a user or group
show
Show the caller's effective permissions on a repository

bb repo permissions grant

Grant a repository permission to a user or group

bb repo permissions grant <user-or-group> <permission> [flags]

Grant a repository permission to a user, or to a group with --group.

Shallow alias for bb repo settings security permissions {users,groups} grant.

# Let a user push to a repository
bb repo permissions grant alice REPO_WRITE --repo PROJ/repo

# A group instead
bb repo permissions grant backend-team REPO_WRITE --group --repo PROJ/repo
--group
Treat the argument as a group rather than a user

Inherited from bb repo permissions:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Predicts the outcome from what it can read, without changing anything (predicted)

Output with --json, where ? marks a field that can be absent
data
  status        string                           Outcome of the command.
  repository    object
    projectKey  string                           Project key the repository belongs to.
    slug        string                           Repository slug.
  subject       user|group                       user or group, matching what name refers to.
  name          string                           Username or group name that was granted the permission.
  permission    REPO_READ|REPO_WRITE|REPO_ADMIN

bb repo permissions list

List users or groups with repository permissions

bb repo permissions list [flags]

List users with repository permissions, or groups with --group.

Shallow alias for bb repo settings security permissions {users,groups} list.

# The users with a permission on a repository
bb repo permissions list --repo PROJ/repo

# The groups
bb repo permissions list --group --repo PROJ/repo
--all
Return every result rather than the first --limit
--group
List groups instead of users
--limit int
Maximum number of results to return (default 100)

Inherited from bb repo permissions:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Runs as usual: this command changes nothing, so there is nothing to hold back

Output with --json, where ? marks a field that can be absent
data
  repository      object
    projectKey    string                           Project key the repository belongs to.
    slug          string                           Repository slug.
  subject         user|group                       user when the entries are users, group when they are groups.
  entries         list of object or null           Holders of a repository permission.
    name          string                           Username for a user, group name for a group.
    displayName?  string                           Human-readable name.
    permission?   REPO_READ|REPO_WRITE|REPO_ADMIN

bb repo permissions revoke

Revoke a repository permission from a user or group

bb repo permissions revoke <user-or-group> [flags]

Revoke a repository permission from a user, or from a group with --group.

Shallow alias for bb repo settings security permissions {users,groups} revoke.

# Take a user's permission on a repository away
bb repo permissions revoke alice --repo PROJ/repo

# A group's
bb repo permissions revoke backend-team --group --repo PROJ/repo
--group
Treat the argument as a group rather than a user
-y, --yes
Confirm without being asked; applies only when the target is named with --repo PROJECT/slug

Inherited from bb repo permissions:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Predicts the outcome from what it can read, without changing anything (predicted)

Output with --json, where ? marks a field that can be absent
data
  status        string      Outcome of the command.
  repository    object
    projectKey  string      Project key the repository belongs to.
    slug        string      Repository slug.
  subject       user|group  user or group, matching what name refers to.
  name          string      Username or group name the permission was revoked from.

bb repo permissions show

Show the caller's effective permissions on a repository

bb repo permissions show
# What you yourself may do in a repository
bb repo permissions show --repo PROJ/repo

Inherited from bb repo permissions:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Runs as usual: this command changes nothing, so there is nothing to hold back

Output with --json, where ? marks a field that can be absent
data
  repository    object
    projectKey  string                           Project key the repository belongs to.
    slug        string                           Repository slug.
  permissions   list of object or null           One entry per permission level, in increasing order of privilege.
    permission  REPO_READ|REPO_WRITE|REPO_ADMIN
    granted     boolean                          Whether the caller holds it.

bb repo settings

Read and change a repository's pull request, security and webhook settings

auto-decline delete
Delete repository auto-decline settings
auto-decline get
Get repository auto-decline settings
auto-decline set
Set repository auto-decline settings
auto-merge delete
Delete repository auto-merge settings
auto-merge get
Get repository auto-merge settings
auto-merge set
Set repository auto-merge settings
pull-requests get
Get repository pull-request settings
pull-requests merge-checks list
List configured merge checks
pull-requests set-strategy
Set default merge strategy
pull-requests update
Update repository pull-request settings
pull-requests update-approvers
Update required approvers count
security permissions groups grant
Grant a repository permission to a group
security permissions groups list
List groups with repository permissions
security permissions groups revoke
Revoke a repository permission from a group
security permissions users grant
Grant a repository permission to a user
security permissions users list
List users with repository permissions
security permissions users revoke
Revoke a repository permission from a user
workflow webhooks create
Create a repository webhook
workflow webhooks delete
Delete a repository webhook
workflow webhooks list
List repository webhooks

bb repo settings auto-decline

Read, set or remove when inactive pull requests are declined

bb repo settings auto-decline delete

Delete repository auto-decline settings

bb repo settings auto-decline delete [flags]
# Remove the repository's own auto-decline setting
bb repo settings auto-decline delete --repo PROJ/repo
-y, --yes
Confirm without being asked; applies only when the target is named with --repo PROJECT/slug

Inherited from bb repo settings auto-decline:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Predicts the outcome from what it can read, without changing anything (predicted)

Output with --json, where ? marks a field that can be absent
data
  status        string       Outcome of the command.
  repository    object
    projectKey  string       Project key the repository belongs to.
    slug        string       Repository slug.
  setting       autoDecline  Which setting was cleared: autoMerge or autoDecline.

bb repo settings auto-decline get

Get repository auto-decline settings

bb repo settings auto-decline get
# Whether inactive pull requests are declined, and after how long
bb repo settings auto-decline get --repo PROJ/repo

Inherited from bb repo settings auto-decline:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Runs as usual: this command changes nothing, so there is nothing to hold back

Output with --json, where ? marks a field that can be absent
data
  repository        object
    projectKey      string   Project key the repository belongs to.
    slug            string   Repository slug.
  enabled           boolean  Whether inactive pull requests are declined automatically.
  inactivityWeeks?  integer  How many weeks of inactivity trigger it.

bb repo settings auto-decline set

Set repository auto-decline settings

bb repo settings auto-decline set [flags]
# Decline pull requests nobody has touched for four weeks
bb repo settings auto-decline set --enabled --inactivity-weeks 4 --repo PROJ/repo

# Switch it off
bb repo settings auto-decline set --enabled=false --repo PROJ/repo
--enabled
Enable or disable auto-decline
--inactivity-weeks int32
Number of inactivity weeks before auto-decline

Inherited from bb repo settings auto-decline:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Predicts the outcome from what it can read, without changing anything (predicted)

Output with --json, where ? marks a field that can be absent
data
  repository        object
    projectKey      string   Project key the repository belongs to.
    slug            string   Repository slug.
  enabled           boolean  Whether inactive pull requests are declined automatically.
  inactivityWeeks?  integer  How many weeks of inactivity trigger it.

bb repo settings auto-merge

Read, set or remove whether the repository allows auto-merge

bb repo settings auto-merge delete

Delete repository auto-merge settings

bb repo settings auto-merge delete [flags]
# Remove the repository's own auto-merge setting
bb repo settings auto-merge delete --repo PROJ/repo
-y, --yes
Confirm without being asked; applies only when the target is named with --repo PROJECT/slug

Inherited from bb repo settings auto-merge:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Predicts the outcome from what it can read, without changing anything (predicted)

Output with --json, where ? marks a field that can be absent
data
  status        string     Outcome of the command.
  repository    object
    projectKey  string     Project key the repository belongs to.
    slug        string     Repository slug.
  setting       autoMerge  Which setting was cleared: autoMerge or autoDecline.

bb repo settings auto-merge get

Get repository auto-merge settings

bb repo settings auto-merge get
# Whether pull requests may be set to merge on their own
bb repo settings auto-merge get --repo PROJ/repo

Inherited from bb repo settings auto-merge:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Runs as usual: this command changes nothing, so there is nothing to hold back

Output with --json, where ? marks a field that can be absent
data
  repository         object
    projectKey       string                                         Project key the repository belongs to.
    slug             string                                         Repository slug.
  enabled            boolean                                        Whether auto-merge may be armed on this repository.
  restrictionState?  UNRESTRICTED|RESTRICTED|RESTRICTED_MODIFIABLE  Whether the project allows the repository to decide:
                                                                    UNRESTRICTED, RESTRICTED or RESTRICTED_MODIFIABLE.

bb repo settings auto-merge set

Set repository auto-merge settings

bb repo settings auto-merge set [flags]
# Let pull requests be set to merge once their checks pass
bb repo settings auto-merge set --enabled --repo PROJ/repo
--enabled
Enable or disable auto-merge

Inherited from bb repo settings auto-merge:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Predicts the outcome from what it can read, without changing anything (predicted)

Output with --json, where ? marks a field that can be absent
data
  repository         object
    projectKey       string                                         Project key the repository belongs to.
    slug             string                                         Repository slug.
  enabled            boolean                                        Whether auto-merge may be armed on this repository.
  restrictionState?  UNRESTRICTED|RESTRICTED|RESTRICTED_MODIFIABLE  Whether the project allows the repository to decide:
                                                                    UNRESTRICTED, RESTRICTED or RESTRICTED_MODIFIABLE.

bb repo settings pull-requests

Read and change merge strategies, merge checks and required approvers

bb repo settings pull-requests get

Get repository pull-request settings

bb repo settings pull-requests get
# A repository's merge strategies and the checks a merge must pass
bb repo settings pull-requests get --repo PROJ/repo

Inherited from bb repo settings:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Runs as usual: this command changes nothing, so there is nothing to hold back

Output with --json, where ? marks a field that can be absent
data
  repository                 object
    projectKey               string          Project key the repository belongs to.
    slug                     string          Repository slug.
  requiredApprovers?         integer         How many approvals a merge needs.
  requiredApproversEnabled?  boolean         Whether the approval check is on at all.
  requiredAllTasksComplete?  boolean         Whether every task must be resolved before a merge.
  defaultMergeStrategy?      string          Strategy a merge uses when none is named.
  mergeStrategies?           list of object  Strategies the repository offers.
    id                       string          Strategy id, which set-strategy takes: no-ff, ff, ff-only, rebase-no-ff,
                                             rebase-ff-only, squash or squash-ff-only.
    name?                    string          Human-readable name.
    enabled                  boolean         Whether it is offered on this repository.

bb repo settings pull-requests merge-checks

List a repository's merge checks

bb repo settings pull-requests merge-checks list

List configured merge checks

bb repo settings pull-requests merge-checks list
# The checks a pull request must pass before it merges
bb repo settings pull-requests merge-checks list --repo PROJ/repo

Inherited from bb repo settings:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Runs as usual: this command changes nothing, so there is nothing to hold back

Output with --json, where ? marks a field that can be absent
data
  repository                object
    projectKey              string                                                             Project key the repository belongs to.
    slug                    string                                                             Repository slug.
  checks                    list of object or null                                             Required-build merge checks on the
                                                                                               repository.
    id?                     integer                                                            Check identifier, which update and
                                                                                               delete address.
    buildParentKeys?        list of string                                                     Build keys that must be green before a
                                                                                               pull request can merge.
    refMatcher?             object                                                             Which target branches the check is
                                                                                               enforced on.
      id?                   string                                                             Matcher value: a branch name, a pattern,
                                                                                               or a model branch id depending on type.
      displayId?            string                                                             Human-readable form of the same thing.
      type?                 ANY_REF|BRANCH|PATTERN|MODEL_BRANCH|MODEL_CATEGORY|DEFAULT_BRANCH  ANY_REF, BRANCH, PATTERN, MODEL_BRANCH,
                                                                                               MODEL_CATEGORY or DEFAULT_BRANCH, which
                                                                                               decides how id is read.
    exemptRefMatcher?       object                                                             Which source branches are exempt from
                                                                                               the check.
      id?                   string                                                             Matcher value: a branch name, a pattern,
                                                                                               or a model branch id depending on type.
      displayId?            string                                                             Human-readable form of the same thing.
      type?                 ANY_REF|BRANCH|PATTERN|MODEL_BRANCH|MODEL_CATEGORY|DEFAULT_BRANCH  ANY_REF, BRANCH, PATTERN, MODEL_BRANCH,
                                                                                               MODEL_CATEGORY or DEFAULT_BRANCH, which
                                                                                               decides how id is read.
    requiredForPullRequest  boolean                                                            Whether the check is enforced on pull
                                                                                               requests.
    requiredForMergeQueue   boolean                                                            Whether the check is enforced on
                                                                                               merge-queue merges.

bb repo settings pull-requests set-strategy

Set default merge strategy

bb repo settings pull-requests set-strategy <strategy-id>
# Squash by default when a pull request merges
bb repo settings pull-requests set-strategy squash --repo PROJ/repo

Inherited from bb repo settings:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Checks your permission and the current state this depends on, without changing anything (preconditions-checked)

Output with --json, where ? marks a field that can be absent
data
  repository                 object
    projectKey               string          Project key the repository belongs to.
    slug                     string          Repository slug.
  requiredApprovers?         integer         How many approvals a merge needs.
  requiredApproversEnabled?  boolean         Whether the approval check is on at all.
  requiredAllTasksComplete?  boolean         Whether every task must be resolved before a merge.
  defaultMergeStrategy?      string          Strategy a merge uses when none is named.
  mergeStrategies?           list of object  Strategies the repository offers.
    id                       string          Strategy id, which set-strategy takes: no-ff, ff, ff-only, rebase-no-ff,
                                             rebase-ff-only, squash or squash-ff-only.
    name?                    string          Human-readable name.
    enabled                  boolean         Whether it is offered on this repository.

bb repo settings pull-requests update

Update repository pull-request settings

bb repo settings pull-requests update [flags]
# Refuse a merge while a task is open
bb repo settings pull-requests update --required-all-tasks-complete --repo PROJ/repo
--required-all-tasks-complete
Require all pull-request tasks to be completed before merge

Inherited from bb repo settings:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Checks your permission and the current state this depends on, without changing anything (preconditions-checked)

Output with --json, where ? marks a field that can be absent
data
  repository                 object
    projectKey               string          Project key the repository belongs to.
    slug                     string          Repository slug.
  requiredApprovers?         integer         How many approvals a merge needs.
  requiredApproversEnabled?  boolean         Whether the approval check is on at all.
  requiredAllTasksComplete?  boolean         Whether every task must be resolved before a merge.
  defaultMergeStrategy?      string          Strategy a merge uses when none is named.
  mergeStrategies?           list of object  Strategies the repository offers.
    id                       string          Strategy id, which set-strategy takes: no-ff, ff, ff-only, rebase-no-ff,
                                             rebase-ff-only, squash or squash-ff-only.
    name?                    string          Human-readable name.
    enabled                  boolean         Whether it is offered on this repository.

bb repo settings pull-requests update-approvers

Update required approvers count

bb repo settings pull-requests update-approvers [flags]
# Require two approvals before a merge
bb repo settings pull-requests update-approvers --count 2 --repo PROJ/repo
--count int
Required approvers count (0 disables check)

Inherited from bb repo settings:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Checks your permission and the current state this depends on, without changing anything (preconditions-checked)

Output with --json, where ? marks a field that can be absent
data
  repository                 object
    projectKey               string          Project key the repository belongs to.
    slug                     string          Repository slug.
  requiredApprovers?         integer         How many approvals a merge needs.
  requiredApproversEnabled?  boolean         Whether the approval check is on at all.
  requiredAllTasksComplete?  boolean         Whether every task must be resolved before a merge.
  defaultMergeStrategy?      string          Strategy a merge uses when none is named.
  mergeStrategies?           list of object  Strategies the repository offers.
    id                       string          Strategy id, which set-strategy takes: no-ff, ff, ff-only, rebase-no-ff,
                                             rebase-ff-only, squash or squash-ff-only.
    name?                    string          Human-readable name.
    enabled                  boolean         Whether it is offered on this repository.

bb repo settings security

Grant, list and revoke repository permissions

bb repo settings security permissions

Grant, list and revoke repository permissions of users and groups

bb repo settings security permissions groups

Grant, list and revoke the repository permissions of a group

bb repo settings security permissions groups grant

Grant a repository permission to a group

bb repo settings security permissions groups grant <group> <permission>

Also available as bb repo permissions grant --group, one level shallower.

# Let a group push to a repository
bb repo settings security permissions groups grant backend-team REPO_WRITE --repo PROJ/repo

Inherited from bb repo settings:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Predicts the outcome from what it can read, without changing anything (predicted)

Output with --json, where ? marks a field that can be absent
data
  status        string                           Outcome of the command.
  repository    object
    projectKey  string                           Project key the repository belongs to.
    slug        string                           Repository slug.
  subject       user|group                       user or group, matching what name refers to.
  name          string                           Username or group name that was granted the permission.
  permission    REPO_READ|REPO_WRITE|REPO_ADMIN

bb repo settings security permissions groups list

List groups with repository permissions

bb repo settings security permissions groups list [flags]

Also available as bb repo permissions list --group, one level shallower.

# The groups with a permission on a repository
bb repo settings security permissions groups list --repo PROJ/repo
--all
Return every result rather than the first --limit
--limit int
Maximum number of results to return (default 100)

Inherited from bb repo settings:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Runs as usual: this command changes nothing, so there is nothing to hold back

Output with --json, where ? marks a field that can be absent
data
  repository      object
    projectKey    string                           Project key the repository belongs to.
    slug          string                           Repository slug.
  subject         user|group                       user when the entries are users, group when they are groups.
  entries         list of object or null           Holders of a repository permission.
    name          string                           Username for a user, group name for a group.
    displayName?  string                           Human-readable name.
    permission?   REPO_READ|REPO_WRITE|REPO_ADMIN

bb repo settings security permissions groups revoke

Revoke a repository permission from a group

bb repo settings security permissions groups revoke <group> [flags]

Also available as bb repo permissions revoke --group, one level shallower.

# Take a group's permission on a repository away
bb repo settings security permissions groups revoke backend-team --repo PROJ/repo
-y, --yes
Confirm without being asked; applies only when the target is named with --repo PROJECT/slug

Inherited from bb repo settings:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Predicts the outcome from what it can read, without changing anything (predicted)

Output with --json, where ? marks a field that can be absent
data
  status        string      Outcome of the command.
  repository    object
    projectKey  string      Project key the repository belongs to.
    slug        string      Repository slug.
  subject       user|group  user or group, matching what name refers to.
  name          string      Username or group name the permission was revoked from.

bb repo settings security permissions users

Grant, list and revoke the repository permissions of a user

bb repo settings security permissions users grant

Grant a repository permission to a user

bb repo settings security permissions users grant <username> <permission>

Also available as bb repo permissions grant, one level shallower.

# Let a user push to a repository
bb repo settings security permissions users grant alice REPO_WRITE --repo PROJ/repo

Inherited from bb repo settings:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Predicts the outcome from what it can read, without changing anything (predicted)

Output with --json, where ? marks a field that can be absent
data
  status        string                           Outcome of the command.
  repository    object
    projectKey  string                           Project key the repository belongs to.
    slug        string                           Repository slug.
  subject       user|group                       user or group, matching what name refers to.
  name          string                           Username or group name that was granted the permission.
  permission    REPO_READ|REPO_WRITE|REPO_ADMIN

bb repo settings security permissions users list

List users with repository permissions

bb repo settings security permissions users list [flags]

Also available as bb repo permissions list, one level shallower.

# The users with a permission on a repository
bb repo settings security permissions users list --repo PROJ/repo
--all
Return every result rather than the first --limit
--limit int
Maximum number of results to return (default 100)

Inherited from bb repo settings:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Runs as usual: this command changes nothing, so there is nothing to hold back

Output with --json, where ? marks a field that can be absent
data
  repository      object
    projectKey    string                           Project key the repository belongs to.
    slug          string                           Repository slug.
  subject         user|group                       user when the entries are users, group when they are groups.
  entries         list of object or null           Holders of a repository permission.
    name          string                           Username for a user, group name for a group.
    displayName?  string                           Human-readable name.
    permission?   REPO_READ|REPO_WRITE|REPO_ADMIN

bb repo settings security permissions users revoke

Revoke a repository permission from a user

bb repo settings security permissions users revoke <username> [flags]

Also available as bb repo permissions revoke, one level shallower.

# Take a user's permission on a repository away
bb repo settings security permissions users revoke alice --repo PROJ/repo
-y, --yes
Confirm without being asked; applies only when the target is named with --repo PROJECT/slug

Inherited from bb repo settings:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Predicts the outcome from what it can read, without changing anything (predicted)

Output with --json, where ? marks a field that can be absent
data
  status        string      Outcome of the command.
  repository    object
    projectKey  string      Project key the repository belongs to.
    slug        string      Repository slug.
  subject       user|group  user or group, matching what name refers to.
  name          string      Username or group name the permission was revoked from.

bb repo settings workflow

Create, list and delete repository webhooks

bb repo settings workflow webhooks

Create, list and delete repository webhooks

bb repo settings workflow webhooks create

Create a repository webhook

bb repo settings workflow webhooks create <name> <url> [flags]
# Call an endpoint when anything is pushed to the repository
bb repo settings workflow webhooks create ci https://ci.example.com/hooks/bitbucket \
  --repo PROJ/repo

# On pull request events, signed with a shared secret read from stdin
printf '%s' "$WEBHOOK_SECRET" | bb repo settings workflow webhooks create reviews \
  https://ci.example.com/hooks/reviews --repo PROJ/repo \
  --event pr:opened --event pr:merged --secret-stdin
--active
Whether the webhook is active (default true)
--credentials-password-stdin
Read the endpoint password from stdin (or set BB_WEBHOOK_PASSWORD)
--credentials-username string
Username Bitbucket authenticates to the endpoint with
--event strings
Webhook event(s) to subscribe to (default [repo:refs_changed])
--secret-stdin
Read the shared secret from stdin (or set BB_WEBHOOK_SECRET)
--ssl-verification string
Whether Bitbucket verifies the endpoint's TLS certificate, left as the server has it when omitted (one of: true, false)

Inherited from bb repo settings:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Checks your permission and the current state this depends on, without changing anything (preconditions-checked)

Output with --json, where ? marks a field that can be absent
data
  status                      string          Outcome of the command.
  repository                  object
    projectKey                string          Project key the repository belongs to.
    slug                      string          Repository slug.
  webhook                     object
    id?                       integer         Webhook identifier, which get, update and delete address.
    name?                     string          Webhook name.
    url?                      string          Endpoint Bitbucket posts to.
    active                    boolean         Whether the webhook currently fires.
    events?                   list of string  Event keys the webhook subscribes to, for example repo:refs_changed.
    sslVerificationRequired?  boolean         Whether Bitbucket verifies the endpoint's TLS certificate.
    scopeType?                string          Where the webhook is configured: repository or project.
    secretConfigured          boolean         Whether a shared secret is configured.
    credentialsUsername?      string          Username Bitbucket authenticates to the endpoint with.
    secret?                   string          The shared secret in plaintext.
  created                     boolean         Whether a webhook was created.

bb repo settings workflow webhooks delete

Delete a repository webhook

bb repo settings workflow webhooks delete <webhook-id> [flags]
# By the id bb repo settings workflow webhooks list prints
bb repo settings workflow webhooks delete 12 --repo PROJ/repo
-y, --yes
Confirm without being asked; applies only when the target is named with --repo PROJECT/slug

Inherited from bb repo settings:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Checks your permission and the current state this depends on, without changing anything (preconditions-checked)

Output with --json, where ? marks a field that can be absent
data
  status        string  Outcome of the command.
  repository    object
    projectKey  string  Project key the repository belongs to.
    slug        string  Repository slug.
  webhookId     string  Identifier of the webhook that was deleted, as it was given on the command line.

bb repo settings workflow webhooks list

List repository webhooks

bb repo settings workflow webhooks list
# A repository's webhooks
bb repo settings workflow webhooks list --repo PROJ/repo

Inherited from bb repo settings:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Runs as usual: this command changes nothing, so there is nothing to hold back

Output with --json, where ? marks a field that can be absent
data
  repository                  object
    projectKey                string                  Project key the repository belongs to.
    slug                      string                  Repository slug.
  count                       integer                 How many webhooks are configured.
  webhooks                    list of object or null  The webhooks.
    id?                       integer                 Webhook identifier, which get, update and delete address.
    name?                     string                  Webhook name.
    url?                      string                  Endpoint Bitbucket posts to.
    active                    boolean                 Whether the webhook currently fires.
    events?                   list of string          Event keys the webhook subscribes to, for example
                                                      repo:refs_changed.
    sslVerificationRequired?  boolean                 Whether Bitbucket verifies the endpoint's TLS certificate.
    scopeType?                string                  Where the webhook is configured: repository or project.
    secretConfigured          boolean                 Whether a shared secret is configured.
    credentialsUsername?      string                  Username Bitbucket authenticates to the endpoint with.
    secret?                   string                  The shared secret in plaintext.

bb repo ssh-key

Add, list and remove the SSH access keys of a project or repository

add
Add a project or repository SSH access key
list
List project or repository SSH access keys
remove
Remove a project or repository SSH access key by ID

bb repo ssh-key add

Add a project or repository SSH access key

bb repo ssh-key add <key-file-or-text> [flags]
# Give a deploy key read access to one repository
bb repo ssh-key add deploy-key.pub --repo PROJ/repo --label "CI deploy key"

# Read and write access to every repository of a project
bb repo ssh-key add deploy-key.pub --project PROJ --permission read-write
--label string
Label/comment for the SSH key
--permission string
Permission level (one of: read-only, read-write) (default "read-only")
--read-only
Add as read-only access key
--read-write
Add as read-write access key

Inherited from bb repo ssh-key:

--project string
Project key for project-level SSH keys
--repo string
Repository reference (projectKey/repositorySlug) for repository-level SSH keys

Also takes the global flags.

Dry run: Shows the change it would make, without making it; nothing is checked first (predicted)

Output with --json, where ? marks a field that can be absent
data
  key             object
    id?           integer               Key identifier, which remove takes.
    label?        string                Label the key was registered under.
    fingerprint?  string                Fingerprint of the public key.
    text?         string                The public key itself.
    permission?   REPO_READ|REPO_WRITE  REPO_READ or REPO_WRITE, the access the key is granted.

bb repo ssh-key list

List project or repository SSH access keys

bb repo ssh-key list [flags]
# The access keys of a repository
bb repo ssh-key list --repo PROJ/repo

# Of a project
bb repo ssh-key list --project PROJ
--all
Return every result rather than the first --limit
--limit int
Maximum number of results to return (default 25)

Inherited from bb repo ssh-key:

--project string
Project key for project-level SSH keys
--repo string
Repository reference (projectKey/repositorySlug) for repository-level SSH keys

Also takes the global flags.

Dry run: Runs as usual: this command changes nothing, so there is nothing to hold back

Output with --json, where ? marks a field that can be absent
data
  keys            list of object or null  Access keys in scope.
    id?           integer                 Key identifier, which remove takes.
    label?        string                  Label the key was registered under.
    fingerprint?  string                  Fingerprint of the public key.
    text?         string                  The public key itself.
    permission?   REPO_READ|REPO_WRITE    REPO_READ or REPO_WRITE, the access the key is granted.

bb repo ssh-key remove

Remove a project or repository SSH access key by ID

bb repo ssh-key remove <access-key-id> [flags]
# By the id bb repo ssh-key list prints
bb repo ssh-key remove 31 --repo PROJ/repo
-y, --yes
Confirm without being asked; applies only when the target is named with --repo PROJECT/slug or --project

Inherited from bb repo ssh-key:

--project string
Project key for project-level SSH keys
--repo string
Repository reference (projectKey/repositorySlug) for repository-level SSH keys

Also takes the global flags.

Dry run: Shows the change it would make, without making it; nothing is checked first (predicted)

Output with --json, where ? marks a field that can be absent
data
  status  string  Outcome of the command.

bb repo sync

Bring a fork up to date with its origin, and turn automatic syncing on or off

bb repo sync [flags]
# Bring a fork's default branch up to date with the repository it was forked from
bb repo sync --repo SANDBOX/repo-experiment

# One branch, throwing away what the fork has that upstream lacks
bb repo sync --repo SANDBOX/repo-experiment --ref release/1.2 --action DISCARD
--action string
How to reconcile the ref (one of: MERGE, DISCARD, REBASE) (default "MERGE")
--ref string
Ref to synchronize (defaults to the repository default branch)
--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Predicts the outcome from what it can read, without changing anything (predicted)

Output with --json, where ? marks a field that can be absent
data
  status        string                Outcome of the command.
  repository    object
    projectKey  string                Project key the repository belongs to.
    slug        string                Repository slug.
  ref           string                Ref that was synchronised.
  action        MERGE|DISCARD|REBASE  How the ref was reconciled with upstream, which decides what happens to local
                                      commits.
disable
Disable automatic background synchronization
enable
Enable automatic background synchronization
status
Query synchronization status, divergence, and settings

bb repo sync disable

Disable automatic background synchronization

bb repo sync disable
# Stop keeping a fork up to date automatically
bb repo sync disable --repo SANDBOX/repo-experiment

Inherited from bb repo sync:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Predicts the outcome from what it can read, without changing anything (predicted)

Output with --json, where ? marks a field that can be absent
data
  repository    object
    projectKey  string                   Project key the repository belongs to.
    slug        string                   Repository slug.
  available     boolean                  Whether the repository can be synchronised at all, which needs it to be a fork.
  enabled       boolean                  Whether automatic synchronisation is on.
  lastSync?     integer                  When it last synchronised, in milliseconds since the epoch.
  aheadRefs     list of object or null   Refs the fork is ahead of upstream on.
    id          string                   Full ref name, for example refs/heads/main.
    displayId   string                   Short ref name.
    state?      AHEAD|DIVERGED|ORPHANED  AHEAD, DIVERGED or ORPHANED, matching the list it came from.
    tag         boolean                  Whether the ref is a tag rather than a branch.
  divergedRefs  list of object or null   Refs that have diverged and cannot fast-forward.
    id          string                   Full ref name, for example refs/heads/main.
    displayId   string                   Short ref name.
    state?      AHEAD|DIVERGED|ORPHANED  AHEAD, DIVERGED or ORPHANED, matching the list it came from.
    tag         boolean                  Whether the ref is a tag rather than a branch.
  orphanedRefs  list of object or null   Refs that no longer exist upstream.
    id          string                   Full ref name, for example refs/heads/main.
    displayId   string                   Short ref name.
    state?      AHEAD|DIVERGED|ORPHANED  AHEAD, DIVERGED or ORPHANED, matching the list it came from.
    tag         boolean                  Whether the ref is a tag rather than a branch.

bb repo sync enable

Enable automatic background synchronization

bb repo sync enable
# Keep a fork up to date with its upstream automatically
bb repo sync enable --repo SANDBOX/repo-experiment

Inherited from bb repo sync:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Predicts the outcome from what it can read, without changing anything (predicted)

Output with --json, where ? marks a field that can be absent
data
  repository    object
    projectKey  string                   Project key the repository belongs to.
    slug        string                   Repository slug.
  available     boolean                  Whether the repository can be synchronised at all, which needs it to be a fork.
  enabled       boolean                  Whether automatic synchronisation is on.
  lastSync?     integer                  When it last synchronised, in milliseconds since the epoch.
  aheadRefs     list of object or null   Refs the fork is ahead of upstream on.
    id          string                   Full ref name, for example refs/heads/main.
    displayId   string                   Short ref name.
    state?      AHEAD|DIVERGED|ORPHANED  AHEAD, DIVERGED or ORPHANED, matching the list it came from.
    tag         boolean                  Whether the ref is a tag rather than a branch.
  divergedRefs  list of object or null   Refs that have diverged and cannot fast-forward.
    id          string                   Full ref name, for example refs/heads/main.
    displayId   string                   Short ref name.
    state?      AHEAD|DIVERGED|ORPHANED  AHEAD, DIVERGED or ORPHANED, matching the list it came from.
    tag         boolean                  Whether the ref is a tag rather than a branch.
  orphanedRefs  list of object or null   Refs that no longer exist upstream.
    id          string                   Full ref name, for example refs/heads/main.
    displayId   string                   Short ref name.
    state?      AHEAD|DIVERGED|ORPHANED  AHEAD, DIVERGED or ORPHANED, matching the list it came from.
    tag         boolean                  Whether the ref is a tag rather than a branch.

bb repo sync status

Query synchronization status, divergence, and settings

bb repo sync status
# Whether a fork is kept up to date, and how far it has diverged
bb repo sync status --repo SANDBOX/repo-experiment

Inherited from bb repo sync:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Runs as usual: this command changes nothing, so there is nothing to hold back

Output with --json, where ? marks a field that can be absent
data
  repository    object
    projectKey  string                   Project key the repository belongs to.
    slug        string                   Repository slug.
  available     boolean                  Whether the repository can be synchronised at all, which needs it to be a fork.
  enabled       boolean                  Whether automatic synchronisation is on.
  lastSync?     integer                  When it last synchronised, in milliseconds since the epoch.
  aheadRefs     list of object or null   Refs the fork is ahead of upstream on.
    id          string                   Full ref name, for example refs/heads/main.
    displayId   string                   Short ref name.
    state?      AHEAD|DIVERGED|ORPHANED  AHEAD, DIVERGED or ORPHANED, matching the list it came from.
    tag         boolean                  Whether the ref is a tag rather than a branch.
  divergedRefs  list of object or null   Refs that have diverged and cannot fast-forward.
    id          string                   Full ref name, for example refs/heads/main.
    displayId   string                   Short ref name.
    state?      AHEAD|DIVERGED|ORPHANED  AHEAD, DIVERGED or ORPHANED, matching the list it came from.
    tag         boolean                  Whether the ref is a tag rather than a branch.
  orphanedRefs  list of object or null   Refs that no longer exist upstream.
    id          string                   Full ref name, for example refs/heads/main.
    displayId   string                   Short ref name.
    state?      AHEAD|DIVERGED|ORPHANED  AHEAD, DIVERGED or ORPHANED, matching the list it came from.
    tag         boolean                  Whether the ref is a tag rather than a branch.

bb repo unwatch

Unwatch repository

bb repo unwatch [flags]
# Stop notifications for a repository
bb repo unwatch --repo PROJ/repo
--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Predicts the outcome from what it can read, without changing anything (predicted)

Output with --json, where ? marks a field that can be absent
data
  status        string   Outcome of the command.
  repository    object
    projectKey  string   Project key the repository belongs to.
    slug        string   Repository slug.
  watching      boolean  Whether you are now watching the repository.

bb repo watch

Watch repository

bb repo watch [flags]
# Get notified of changes to a repository
bb repo watch --repo PROJ/repo
--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Predicts the outcome from what it can read, without changing anything (predicted)

Output with --json, where ? marks a field that can be absent
data
  status        string   Outcome of the command.
  repository    object
    projectKey  string   Project key the repository belongs to.
    slug        string   Repository slug.
  watching      boolean  Whether you are now watching the repository.