Skip to content

bb search

Search for repositories, commits, and pull requests

3 commands.

bb search commits
Search for commits within a repository
bb search prs
Search for pull requests globally or within a repository
bb search repos
Search for repositories

bb search commits

Search for commits within a repository

bb search commits [flags]
# The latest commits of a repository
bb search commits --repo PROJ/repo

# What main has that the last release lacks, without merge commits
bb search commits --repo PROJ/repo --since v1.2.0 --until main --merges exclude

# The commits that touched a file
bb search commits --repo PROJ/repo --path src/main.go
--all
Return every result rather than the first --limit
--limit int
Maximum number of results to return (default 25)
--merges string
Filter merge commits (one of: exclude, include, only)
--path string
Filter by file path
--repo string
Repository as PROJECT/slug (required)
--since string
Commit ID or ref to search after (exclusive)
--start int
Start offset for list operations
--until string
Commit ID or ref to search before (inclusive)

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.
  commits                list of object or null  Matching commits, 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 search prs

Search for pull requests globally or within a repository

bb search prs [flags]

Without --repo this is every pull request you are involved in, across every repository, as Bitbucket's dashboard lists them: the ones you wrote, the ones you are a reviewer on, and the ones you took part in, by commenting for one. --role narrows it to one of the three.

--since and --until bound the listing to a period, on the date --date-field names. Each takes an ISO 8601 date: a day (2026-07-20), a time on it (2026-07-20T09:00), or either with an offset (2026-07-20T09:00:00+02:00). Without an offset it is local time, and a day given to --until runs to its end. With --since the listing holds the whole period rather than the first --limit.

# Every open pull request you are involved in
bb search prs

# The ones you are a reviewer on
bb search prs --role reviewer

# What you wrote in a period, whatever became of it, week by week
bb search prs --role author --state all --since 2026-07-20 --until 2026-09-27 --group-by week

# What was merged in one repository this month
bb search prs --repo PROJ/repo --state merged --date-field closed --since 2026-09-01
--all
Return every result rather than the first --limit
--date-field string
Which date --since and --until apply to (one of: created, updated, closed) (default "created")
--group-by string
Group the text output by the week of the date, or by repository (one of: week, repo)
--limit int
Maximum number of results to return (default 25)
--repo string
Optional repository as PROJECT/slug to scope search
--role string
Only the pull requests you wrote (author), are a reviewer on, or took part in (participant); all three when left out. Dashboard only, so it cannot be combined with --repo (one of: author, reviewer, participant)
--since string
Only pull requests dated on or after this ISO 8601 date, such as 2026-07-20 or 2026-07-20T09:00; lists the whole period unless --limit is given
--start int
Start offset for list operations
--state string
Filter by state; closed is merged and declined together (one of: open, merged, declined, closed, all) (default "open")
--until string
Only pull requests dated on or before this ISO 8601 date, such as 2026-09-27; a day runs to its end

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
  pullRequests          list of object or null          Matching pull requests.
    id                  integer                         Pull request number, unique within the repository.
    title               string                          Pull request title.
    description?        string                          Body text, when one was written.
    state               OPEN|MERGED|DECLINED
    open                boolean                         Whether the pull request is still open.
    closed              boolean                         Whether the pull request is merged or declined.
    draft?              boolean                         Whether it is marked as a draft.
    repository?         object                          Repository the pull request merges into.
      projectKey        string                          Project key the repository belongs to.
      slug              string                          Repository slug.
    sourceRepository?   object                          Repository the source branch lives in.
      projectKey        string                          Project key the repository belongs to.
      slug              string                          Repository slug.
    version             integer                         Optimistic-locking version.
    author?             string                          Display name of whoever opened it.
    authorUsername?     string                          Username of whoever opened it.
    sourceBranch?       string                          Branch being merged from.
    targetBranch?       string                          Branch being merged into.
    sourceCommit?       string                          Head commit of the source branch when this was read.
    createdDate?        integer                         When it was opened, in milliseconds since the epoch.
    updatedDate?        integer                         When it last changed, in milliseconds since the epoch.
    closedDate?         integer                         When it was merged or declined, in milliseconds since the epoch.
    url?                string                          Where the pull request is in Bitbucket, as the server links to
                                                        it.
    issueKeys?          list of string                  Issue keys the title and source branch mention, such as
                                                        PROJ-123, in the order they appear.
    reviewers?          list of object                  Everyone asked to review, with where they got to.
      name?             string                          Username.
      displayName?      string                          Human-readable name.
      email?            string                          Email address, when the instance exposes it.
      role?             AUTHOR|REVIEWER|PARTICIPANT     REVIEWER or PARTICIPANT.
      status?           UNAPPROVED|NEEDS_WORK|APPROVED
      approved          boolean                         Whether this reviewer has approved.
    mergeability?       object                          Whether it can merge.
      mergeable         boolean                         Whether Bitbucket would accept a merge right now.
      outcome?          CLEAN|CONFLICTED|UNKNOWN
      conflicted        boolean                         Whether the merge would conflict.
      blockers?         list of object                  Merge checks currently refusing.
        summary?        string                          Short reason, as Bitbucket phrases it.
        detail?         string                          Longer explanation, when the instance gives one.
    commentCount?       integer                         Comments on the pull request.
    openTaskCount?      integer                         Unresolved tasks.
    resolvedTaskCount?  integer                         Resolved tasks.

bb search repos

Search for repositories

bb search repos [name] [flags]
# Repositories whose name matches
bb search repos billing

# Within one project
bb search repos billing --project PROJ
--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.