К основному содержанию
правило CX Codex

pr — правило для Claude Code: PR в Bitbucket через bkt

Справочник по bkt pr для агента: создать, посмотреть, одобрить и смержить pull request в Bitbucket Data Center или Cloud.

MIT ★ 1 596 обновлён 2026-10-29

Установить в Claude Code · Вручную: положить файлы Все способы и платформы ↓
.claude/rules/pr.md
Открыть на GitHub

Что делает pr

Правило кладёт в контекст агента разбор CLI bkt pr: подкоманды list, view, create, diff, approve, merge, decline и остальные, их флаги и примеры вызовов. Спрашивать «какой там синтаксис» больше не нужно — агент сам собирает bkt pr list или bkt pr view 42.

Внутри — таблица подкоманд с ключевыми флагами и короткие примеры: bkt pr create --title "Add user authentication", bkt pr approve 42, bkt pr merge 42. Общие флаги вывода (--json, --yaml, --jq, --template) тоже описаны, так что ответ агент может отдать в разборе для скрипта.

auto-merge, reaction, reviewer-group и suggestion есть только в Bitbucket Data Center. На Cloud эти вызовы не сработают, и автоматический мерж после апрувов там так не настроить. Само правило команд не выполняет: нужен установленный bkt и выбранный контекст Bitbucket через --context.

Какие задачи решает

  • посмотреть открытые PR в текущем репозитории
  • одобрить и смержить pull request по номеру
  • дождаться зелёных сборок перед мержем
  • оставить комментарий к строке диффа
  • перевести драфт в статус готового к ревью

Примеры запросов агенту

  • Покажи открытые PR в этом репозитории.
  • Проверь сборки у PR 42 и смержи, если всё зелёное.
  • Оставь комментарий к строке 12 в диффе PR 42.

Как установить pr

Вручную: положить файлы

.claude/rules/pr.md

Поле paths во frontmatter ограничивает файлы

По шагам, с командами для каждой платформы: AGENTS.md и CLAUDE.md: что это, кто читает и какой выбрать

Вопросы о pr

Как установить правило pr в Claude Code?

Скопируйте файл правила в .claude/rules/pr.md в проекте. Других шагов нет.

Что делает pr?

Описывает агенту CLI bkt pr: подкоманды для создания, просмотра, ревью и мержа pull request в Bitbucket Data Center и Cloud, их флаги и примеры вызовов.

Работает ли правило с Bitbucket Cloud?

Большая часть подкоманд работает на обеих платформах. auto-merge, reaction, reviewer-group и suggestion есть только в Data Center.

Исходный текст

pr.md · MIT
<!-- auto-generated by cmd/docgen — do not edit -->

# bkt pr

Create, list, review, merge, and manage pull requests on Bitbucket Data Center
and Bitbucket Cloud. Most subcommands work on both platforms; platform-specific
limitations are noted in each subcommand's help.

```
bkt pr <command> [flags]
```

### Examples

```bash
# List open pull requests in the current repository
  bkt pr list

  # View details of a specific pull request
  bkt pr view 42

  # Create a pull request from the current branch
  bkt pr create --title "Add user authentication"

  # Approve and merge a pull request
  bkt pr approve 42
  bkt pr merge 42
```

## Subcommands

| Subcommand | Description | Key Flags |
|---|---|---|
| [approve](#bkt-pr-approve) | Approve a pull request | `--project`, `--repo`, `--workspace` |
| [auto-merge](#bkt-pr-auto-merge) | Manage pull request auto-merge *(DC)* | — |
| [checkout](#bkt-pr-checkout) | Check out the pull request branch | `--branch`, `--project`, `--remote`, `--repo` |
| [checks](#bkt-pr-checks) | Show build/CI status for a pull request | `--fail-fast`, `--interval`, `--max-interval`, `--project` |
| [comment](#bkt-pr-comment) | Comment on a pull request | `--file`, `--from-line`, `--parent`, `--pending` |
| [comments](#bkt-pr-comments) | List comments on a pull request | `--details`, `--project`, `--repo`, `--state` |
| [create](#bkt-pr-create) | Create a new pull request | `--body`, `--close-source`, `--description`, `--destination` |
| [decline](#bkt-pr-decline) | Decline a pull request | `--body`, `--comment`, `--delete-source`, `--project` |
| [diff](#bkt-pr-diff) | Show the diff for a pull request | `--project`, `--repo`, `--stat`, `--workspace` |
| [edit](#bkt-pr-edit) | Edit a pull request | `--body`, `--description`, `--project`, `--remove-reviewer` |
| [list](#bkt-pr-list) | List pull requests | `--limit`, `--mine`, `--project`, `--repo` |
| [merge](#bkt-pr-merge) | Merge a pull request | `--close-source`, `--message`, `--project`, `--repo` |
| [publish](#bkt-pr-publish) | Mark a draft pull request as ready for review | `--project`, `--repo`, `--undo`, `--workspace` |
| [reaction](#bkt-pr-reaction) | Manage comment reactions *(DC)* | — |
| [reopen](#bkt-pr-reopen) | Reopen a declined pull request | `--project`, `--repo`, `--workspace` |
| [reviewer-group](#bkt-pr-reviewer-group) | Manage default reviewer groups *(DC)* | — |
| [suggestion](#bkt-pr-suggestion) | Apply or preview a code suggestion *(DC)* | `--preview`, `--project`, `--repo` |
| [task](#bkt-pr-task) | Manage pull request tasks (DC and Cloud) | — |
| [view](#bkt-pr-view) | Show details for a pull request | `--project`, `--repo`, `--web`, `--workspace` |

## bkt pr approve

Approve a pull request as the authenticated user. This adds your approval to
the pull request, which may satisfy merge checks that require reviewer
approvals.

Works on both Data Center and Cloud.

### Usage

```
bkt pr approve <id> [flags]
```

### Flags

| Flag | Short | Description |
|---|---|---|
| `--project` |  | Bitbucket project key override |
| `--repo` |  | Repository slug override |
| `--workspace` |  | Bitbucket Cloud workspace override |

### Inherited Flags

| Flag | Short | Description |
|---|---|---|
| `--context` | `-c` | Active Bitbucket context name |
| `--format` |  | Output format: json or yaml (alias for --json/--yaml) |
| `--jq` |  | Apply a jq expression to JSON output (requires --json or --format json) |
| `--json` |  | Output in JSON format when supported |
| `--template` |  | Render output using Go templates |
| `--yaml` |  | Output in YAML format when supported |

### Examples

```bash
# Approve a pull request
  bkt pr approve 42

  # Approve a pull request in a specific repository
  bkt pr approve 42 --repo my-service
```

## bkt pr auto-merge

Enable, disable, or check the status of auto-merge for a pull request.
When auto-merge is enabled, the pull request is merged automatically once
all required conditions (approvals, build checks) are met.

Data Center only. Not yet supported on Cloud.

```
bkt pr auto-merge <command> [flags]
```

### Examples

```bash
# Enable auto-merge for a pull request
  bkt pr auto-merge enable 42

  # Check auto-merge status
  bkt pr auto-merge status 42

  # Disable auto-merge
  bkt pr auto-merge disable 42
```

| Subcommand | Description |
|---|---|
| disable | Disable auto-merge (DC only) |
| enable | Enable auto-merge for a pull request (DC only) |
| status | Show auto-merge configuration (DC only) |

## bkt pr auto-merge disable

Disable auto-merge for a pull request on Data Center. The pull request will no longer merge automatically.

### Usage

```
bkt pr auto-merge disable <id> [flags]
```

### Flags

| Flag | Short | Description |
|---|---|---|
| `--project` |  | Bitbucket project key override |
| `--repo` |  | Repository slug override |

### Inherited Flags

| Flag | Short | Description |
|---|---|---|
| `--context` | `-c` | Active Bitbucket context name |
| `--format` |  | Output format: json or yaml (alias for --json/--yaml) |
| `--jq` |  | Apply a jq expression to JSON output (requires --json or --format json) |
| `--json` |  | Output in JSON format when supported |
| `--template` |  | Render output using Go templates |
| `--yaml` |  | Output in YAML format when supported |

### Examples

```bash
# Disable auto-merge
  bkt pr auto-merge disable 42
```

## bkt pr auto-merge enable

Enable auto-merge for a pull request on Data Center. The pull request will be
merged automatically when all preconditions are satisfied. You can optionally
specify a merge strategy, a custom merge commit message, and whether the
source branch should be closed after merge.

### Usage

```
bkt pr auto-merge enable <id> [flags]
```

### Flags

| Flag | Short | Description |
|---|---|---|
| `--close-source` |  | Close source branch when auto-merge completes |
| `--message` |  | Custom merge commit message |
| `--project` |  | Bitbucket project key override |
| `--repo` |  | Repository slug override |
| `--strategy` |  | Merge strategy ID (leave empty for default) |

### Inherited Flags

| Flag | Short | Description |
|---|---|---|
| `--context` | `-c` | Active Bitbucket context name |
| `--format` |  | Output format: json or yaml (alias for --json/--yaml) |
| `--jq` |  | Apply a jq expression to JSON output (requires --json or --format json) |
| `--json` |  | Output in JSON format when supported |
| `--template` |  | Render output using Go templates |
| `--yaml` |  | Output in YAML format when supported |

### Examples

```bash
# Enable auto-merge with defaults
  bkt pr auto-merge enable 42

  # Enable with a specific merge strategy and message
  bkt pr auto-merge enable 42 --strategy squash --message "Squash merge feature X"

  # Enable but keep the source branch
  bkt pr auto-merge enable 42 --close-source=false
```

## bkt pr auto-merge status

Show the current auto-merge configuration for a pull request on Data Center, including whether it is enabled, the merge strategy, commit message, and close-source-branch setting.

### Usage

```
bkt pr auto-merge status <id> [flags]
```

### Flags

| Flag | Short | Description |
|---|---|---|
| `--project` |  | Bitbucket project key override |
| `--repo` |  | Repository slug override |

### Inherited Flags

| Flag | Short | Description |
|---|---|---|
| `--context` | `-c` | Active Bitbucket context name |
| `--format` |  | Output format: json or yaml (alias for --json/--yaml) |
| `--jq` |  | Apply a jq expression to JSON output (requires --json or --format json) |
| `--json` |  | Output in JSON format when supported |
| `--template` |  | Render output using Go templates |
| `--yaml` |  | Output in YAML format when supported |

### Examples

```bash
# Check auto-merge status
  bkt pr auto-merge status 42
```

## bkt pr checkout

Fetch and check out the source branch of a pull request into a local branch.
By default the local branch is named pr/<id>.

On Data Center, the PR head is fetched via the refs/pull-requests/<id>/from
ref. On Cloud, the source branch name is resolved from the API and fetched
directly. For fork-based Cloud pull requests, a remote is automatically
added (or reused) for the fork repository.

### Usage

```
bkt pr checkout <id> [flags]
```

### Flags

| Flag | Short | Description |
|---|---|---|
| `--branch` |  | Local branch name (defaults to pr/<id>) |
| `--project` |  | Bitbucket project key override |
| `--remote` |  | Git remote name to fetch from |
| `--repo` |  | Repository slug override |
| `--workspace` |  | Bitbucket Cloud workspace override |

### Inherited Flags

| Flag | Short | Description |
|---|---|---|
| `--context` | `-c` | Active Bitbucket context name |
| `--format` |  | Output format: json or yaml (alias for --json/--yaml) |
| `--jq` |  | Apply a jq expression to JSON output (requires --json or --format json) |
| `--json` |  | Output in JSON format when supported |
| `--template` |  | Render output using Go templates |
| `--yaml` |  | Output in YAML format when supported |

### Examples

```bash
# Check out pull request #42
  bkt pr checkout 42

  # Check out into a custom branch name
  bkt pr checkout 42 --branch feature-review

  # Check out from a specific remote
  bkt pr checkout 42 --remote upstream
```

## bkt pr checks

Display CI/build statuses for the head commit of a pull request. Use --wait to
poll until all builds complete, with exponential backoff and jitter. The
--fail-fast flag exits on the first failure. Use --web to open the first
build's URL in your browser.

On Data Center, statuses are fetched from the commit build-status API using
the source branch's latest commit. On Cloud, the source commit hash from the
pull request is used.

Exit codes in --wait mode: 0 = all passed, 1 = a build failed,
8 = timed out with builds still pending.

**Alias:** `builds`

### Usage

```
bkt pr checks <id> [flags]
```

### Flags

| Flag | Short | Description |
|---|---|---|
| `--fail-fast` |  | Exit immediately when a check fails (requires --wait) |
| `--interval` |  | Initial polling interval when using --wait |
| `--max-interval` |  | Maximum polling interval (backoff cap) |
| `--project` |  | Bitbucket project key override |
| `--repo` |  | Repository slug override |
| `--timeout` |  | Maximum time to wait for builds (0 for no timeout) |
| `--wait` |  | Wait for all builds to complete |
| `--web` |  | Open the build URL in your browser (first build) |
| `--workspace` |  | Bitbucket workspace override (Cloud) |

### Inherited Flags

| Flag | Short | Description |
|---|---|---|
| `--context` | `-c` | Active Bitbucket context name |
| `--format` |  | Output format: json or yaml (alias for --json/--yaml) |
| `--jq` |  | Apply a jq expression to JSON output (requires --json or --format json) |
| `--json` |  | Output in JSON format when supported |
| `--template` |  | Render output using Go templates |
| `--yaml` |  | Output in YAML format when supported |

### Examples

```bash
# Show current build status
  bkt pr checks 42

  # Wait for all builds to finish
  bkt pr checks 42 --wait

  # Wait with fail-fast and a custom timeout
  bkt pr checks 42 --wait --fail-fast --timeout 10m

  # Open the first build URL in a browser
  bkt pr checks 42 --web
```

## bkt pr comment

Add a comment to a pull request. Comments can be general (activity-level),
threaded replies (via --parent), or inline on a specific file and line in the
diff (via --file with --from-line or --to-line). Use --pending to create a
draft review comment that is not visible until submitted.

Works on both Data Center and Cloud.

### Usage

```
bkt pr comment <id> --text <message> [flags]
```

### Flags

| Flag | Short | Description |
|---|---|---|
| `--file` |  | File path in the diff (requires --from-line or --to-line) |
| `--from-line` |  | Line in the old file (removed/source side) |
| `--parent` |  | Parent comment ID for threaded replies |
| `--pending` |  | Create the comment as pending (draft review feedback) |
| `--project` |  | Bitbucket project key override |
| `--repo` |  | Repository slug override |
| `--text` |  | Comment text |
| `--to-line` |  | Line in the new file (added/destination side) |
| `--workspace` |  | Bitbucket Cloud workspace override |

### Inherited Flags

| Flag | Short | Description |
|---|---|---|
| `--context` | `-c` | Active Bitbucket context name |
| `--format` |  | Output format: json or yaml (alias for --json/--yaml) |
| `--jq` |  | Apply a jq expression to JSON output (requires --json or --format json) |
| `--json` |  | Output in JSON format when supported |
| `--template` |  | Render output using Go templates |
| `--yaml` |  | Output in YAML format when supported |

### Examples

```bash
# Add a general comment
  bkt pr comment 42 --text "Looks good to me"

  # Reply to an existing comment thread
  bkt pr comment 42 --text "Fixed in the latest push" --parent 1001

  # Add an inline comment on a specific line in the new file
  bkt pr comment 42 --text "Nit: rename this variable" --file src/main.go --to-line 55

  # Add a pending (draft) inline comment
  bkt pr comment 42 --text "Consider error handling here" --file api.go --to-line 30 --pending
```

## bkt pr comments

List all comments on a pull request. On Cloud, use --state to filter by
resolution status (resolved, unresolved, or deleted). The --state flag is not supported
on Data Center because the DC API does not expose resolution status.

Works on both Data Center and Cloud.

Resolve and reopen subcommands require the top-level thread comment ID, not a
reply ID. Use --details when listing comments to inspect thread structure before
changing thread state.

```
bkt pr comments <id> [flags]
bkt pr comments <command> [flags]
```

### Flags

| Flag | Short | Description |
|---|---|---|
| `--details` |  | Show full comment details (file, resolved, task status) |
| `--project` |  | Bitbucket project key override |
| `--repo` |  | Repository slug override |
| `--state` |  | Filter by state: all, resolved, unresolved, deleted (Cloud only) |
| `--workspace` |  | Bitbucket Cloud workspace override |

### Inherited Flags

| Flag | Short | Description |
|---|---|---|
| `--context` | `-c` | Active Bitbucket context name |
| `--format` |  | Output format: json or yaml (alias for --json/--yaml) |
| `--jq` |  | Apply a jq expression to JSON output (requires --json or --format json) |
| `--json` |  | Output in JSON format when supported |
| `--template` |  | Render output using Go templates |
| `--yaml` |  | Output in YAML format when supported |

### Examples

```bash
# List all comments
  bkt pr comments 42

  # List only unresolved comments (Cloud only)
  bkt pr comments 42 --state unresolved

  # List resolved comments (Cloud only)
  bkt pr comments 42 --state resolved

  # List deleted comments (Cloud only)
  bkt pr comments 42 --state deleted

  # View one comment thread with its file/line anchor
  bkt pr comments view 42 1001

  # Delete a comment
  bkt pr comments delete 42 1001

  # Resolve a comment thread
  bkt pr comments resolve 42 1001

  # Reopen a resolved comment thread
  bkt pr comments reopen 42 1001
```

| Subcommand | Description |
|---|---|
| delete | Delete a pull request comment |
| reopen | Reopen a resolved pull request comment thread |
| resolve | Resolve a pull request comment thread |
| view | View one pull request comment thread |

## bkt pr comments delete

Delete a pull request comment on Bitbucket Cloud or Data Center.

Use bkt pr comments <id> or bkt pr comments <id> --details to find the comment
ID before deleting it. On Bitbucket Cloud, deleted comments can still be listed
with --state deleted when the API returns them. On Data Center, bkt fetches the
current comment version before deleting because the API requires it.

**Alias:** `rm`

### Usage

```
bkt pr comments delete <id> <comment-id> [flags]
```

### Flags

| Flag | Short | Description |
|---|---|---|
| `--project` |  | Bitbucket project key override |
| `--repo` |  | Repository slug override |
| `--workspace` |  | Bitbucket Cloud workspace override |

### Inherited Flags

| Flag | Short | Description |
|---|---|---|
| `--context` | `-c` | Active Bitbucket context name |
| `--format` |  | Output format: json or yaml (alias for --json/--yaml) |
| `--jq` |  | Apply a jq expression to JSON output (requires --json or --format json) |
| `--json` |  | Output in JSON format when supported |
| `--template` |  | Render output using Go templates |
| `--yaml` |  | Output in YAML format when supported |

### Examples

```bash
# Delete comment 1001 from pull request 42
  bkt pr comments delete 42 1001

  # Delete a comment in a specific repository
  bkt pr comments delete 42 1001 --repo platform-api
```

## bkt pr comments reopen

Reopen a resolved pull request comment thread on Bitbucket Cloud or Data Center.

The comment-id must be the top-level comment for the thread. Replies cannot be
reopened directly; pass the parent comment ID instead. Deleted comments cannot
be reopened.

### Usage

```
bkt pr comments reopen <id> <comment-id> [flags]
```

### Flags

| Flag | Short | Description |
|---|---|---|
| `--project` |  | Bitbucket project key override |
| `--repo` |  | Repository slug override |
| `--workspace` |  | Bitbucket Cloud workspace override |

### Inherited Flags

| Flag | Short | Description |
|---|---|---|
| `--context` | `-c` | Active Bitbucket context name |
| `--format` |  | Output format: json or yaml (alias for --json/--yaml) |
| `--jq` |  | Apply a jq expression to JSON output (requires --json or --format json) |
| `--json` |  | Output in JSON format when supported |
| `--template` |  | Render output using Go templates |
| `--yaml` |  | Output in YAML format when supported |

### Examples

```bash
# Reopen thread 1001 on pull request 42
  bkt pr comments reopen 42 1001

  # Reopen a thread in a specific repository
  bkt pr comments reopen 42 1001 --repo platform-api
```

## bkt pr comments resolve

Resolve a pull request comment thread on Bitbucket Cloud or Data Center.

The comment-id must be the top-level comment for the thread. Replies cannot be
resolved directly; pass the parent comment ID instead. Deleted comments cannot
be resolved.

### Usage

```
bkt pr comments resolve <id> <comment-id> [flags]
```

### Flags

| Flag | Short | Description |
|---|---|---|
| `--project` |  | Bitbucket project key override |
| `--repo` |  | Repository slug override |
| `--workspace` |  | Bitbucket Cloud workspace override |

### Inherited Flags

| Flag | Short | Description |
|---|---|---|
| `--context` | `-c` | Active Bitbucket context name |
| `--format` |  | Output format: json or yaml (alias for --json/--yaml) |
| `--jq` |  | Apply a jq expression to JSON output (requires --json or --format json) |
| `--json` |  | Output in JSON format when supported |
| `--template` |  | Render output using Go templates |
| `--yaml` |  | Output in YAML format when supported |

### Examples

```bash
# Resolve thread 1001 on pull request 42
  bkt pr comments resolve 42 1001

  # Resolve a thread in a specific repository
  bkt pr comments resolve 42 1001 --repo platform-api
```

## bkt pr comments view

Show the comment thread that contains a comment: the root comment, its
replies, and the inline anchor (file, line, orphaned). The comment-id can be the
root comment or any reply; the requested comment is marked in the output.

On Data Center, the output also includes a few lines of diff around the
anchored line when Bitbucket returns them. --json returns the root comment as
"thread" with replies nested under "comments" and the diff lines as
"diff_context". On Cloud, --json returns the thread as a flat "comments" list,
root first.

### Usage

```
bkt pr comments view <id> <comment-id> [flags]
```

### Flags

| Flag | Short | Description |
|---|---|---|
| `--project` |  | Bitbucket project key override |
| `--repo` |  | Repository slug override |
| `--workspace` |  | Bitbucket Cloud workspace override |

### Inherited Flags

| Flag | Short | Description |
|---|---|---|
| `--context` | `-c` | Active Bitbucket context name |
| `--format` |  | Output format: json or yaml (alias for --json/--yaml) |
| `--jq` |  | Apply a jq expression to JSON output (requires --json or --format json) |
| `--json` |  | Output in JSON format when supported |
| `--template` |  | Render output using Go templates |
| `--yaml` |  | Output in YAML format when supported |

### Examples

```bash
# View the thread that contains comment 1001 on pull request 42
  bkt pr comments view 42 1001

  # Get the thread as JSON
  bkt pr comments view 42 1001 --json
```

## bkt pr create

Create a new pull request. The source branch defaults to the current git branch,
and the target branch defaults to the remote's default branch (e.g. main).
The title defaults to the first unique commit subject on the source branch.

Reviewers can be added with repeatable --reviewer flags.
--with-default-reviewers merges the repository's configured default reviewers
into the reviewer list. On Cloud, the current user is automatically excluded.

On Data Center, --source-project and --source-repo select a fork repository for
the source branch. Each defaults to the destination project or repository when
omitted. These flags are rejected on Bitbucket Cloud.

Draft pull requests are supported on Cloud (always) and on Data Center 8.18+
via the --draft flag.

### Usage

```
bkt pr create [flags]
```

### Flags

| Flag | Short | Description |
|---|---|---|
| `--body` | `-b` | Pull request description (alias for --description) |
| `--close-source` |  | Close source branch on merge |
| `--description` |  | Pull request description |
| `--destination` |  | Target branch (alias for --target) |
| `--draft` | `-d` | Create pull request as a draft (DC 8.18+, Cloud always supported) |
| `--project` |  | Bitbucket project key override |
| `--repo` |  | Repository slug override |
| `--reviewer` |  | Reviewer username or {UUID} (repeatable) |
| `--source` |  | Source branch (defaults to the current branch) |
| `--source-project` |  | Source project key (Data Center only; defaults to --project) |
| `--source-repo` |  | Source repository slug (Data Center only; defaults to --repo) |
| `--target` |  | Target branch (defaults to the remote's default branch) |
| `--title` |  | Pull request title (defaults to the first unique commit subject) |
| `--with-default-reviewers` |  | Add repository default reviewers |
| `--workspace` |  | Bitbucket workspace override (Cloud) |

### Inherited Flags

| Flag | Short | Description |
|---|---|---|
| `--context` | `-c` | Active Bitbucket context name |
| `--format` |  | Output format: json or yaml (alias for --json/--yaml) |
| `--jq` |  | Apply a jq expression to JSON output (requires --json or --format json) |
| `--json` |  | Output in JSON format when supported |
| `--template` |  | Render output using Go templates |
| `--yaml` |  | Output in YAML format when supported |

### Examples

```bash
# Create a pull request with auto-detected title
  bkt pr create

  # Create with an explicit title and description
  bkt pr create --title "Add OAuth2 support" --description "Implements RFC 6749"

  # Create with reviewers and close source branch on merge
  bkt pr create -t "Fix login bug" --reviewer alice --reviewer bob --close-source

  # Create a draft pull request
  bkt pr create --title "WIP: new feature" --draft

  # Create from a Data Center fork into an upstream repository
  bkt pr create --source-project FORK --source-repo contributor-fork \
    --project DEST --repo upstream --source feature --target main
```

## bkt pr decline

Decline (close without merging) a pull request. On Data Center, the optional
--delete-source flag also deletes the source branch after declining. This flag
is not supported on Cloud.

Works on both Data Center and Cloud.

**Alias:** `close`

### Usage

```
bkt pr decline <id> [flags]
```

### Flags

| Flag | Short | Description |
|---|---|---|
| `--body` |  | Alias for --comment; use --comment instead |
| `--comment` | `-m` | Comment explaining why the pull request was declined |
| `--delete-source` |  | Delete the source branch after declining |
| `--project` |  | Bitbucket project key override |
| `--repo` |  | Repository slug override |
| `--text` |  | Alias for --comment; use --comment instead |
| `--workspace` |  | Bitbucket workspace override (Cloud) |

### Inherited Flags

| Flag | Short | Description |
|---|---|---|
| `--context` | `-c` | Active Bitbucket context name |
| `--format` |  | Output format: json or yaml (alias for --json/--yaml) |
| `--jq` |  | Apply a jq expression to JSON output (requires --json or --format json) |
| `--json` |  | Output in JSON format when supported |
| `--template` |  | Render output using Go templates |
| `--yaml` |  | Output in YAML format when supported |

### Examples

```bash
# Decline a pull request
  bkt pr decline 42

  # Decline with a comment explaining the reason
  bkt pr decline 42 --comment "Needs more work before we can merge"

  # Same using the close alias
  bkt pr close 42

  # Decline and delete the source branch (Data Center only)
  bkt pr decline 42 --delete-source
```

## bkt pr diff

Display the full unified diff for a pull request, streamed through the
configured pager when available. Use --stat for a compact summary of changed
files, additions, and deletions instead of the full patch.

Works on both Data Center and Cloud. On Cloud, --stat also lists per-file
change counts.

### Usage

```
bkt pr diff <id> [flags]
```

### Flags

| Flag | Short | Description |
|---|---|---|
| `--project` |  | Bitbucket project key override |
| `--repo` |  | Repository slug override |
| `--stat` |  | Show diff statistics instead of full patch |
| `--workspace` |  | Bitbucket Cloud workspace override |

### Inherited Flags

| Flag | Short | Description |
|---|---|---|
| `--context` | `-c` | Active Bitbucket context name |
| `--format` |  | Output format: json or yaml (alias for --json/--yaml) |
| `--jq` |  | Apply a jq expression to JSON output (requires --json or --format json) |
| `--json` |  | Output in JSON format when supported |
| `--template` |  | Render output using Go templates |
| `--yaml` |  | Output in YAML format when supported |

### Examples

```bash
# Show the full diff
  bkt pr diff 42

  # Show diff statistics only
  bkt pr diff 42 --stat
```

## bkt pr edit

Edit a pull request's title, description, and/or reviewers. Also available as 'pr update'.

**Alias:** `update`

### Usage

```
bkt pr edit <id> [flags]
```

### Flags

| Flag | Short | Description |
|---|---|---|
| `--body` | `-b` | Set the new body (alias for --description). |
| `--description` |  | Set the new description. |
| `--project` |  | Bitbucket project key override. |
| `--remove-reviewer` |  | Reviewer username or {UUID} to remove (repeatable) |
| `--repo` |  | Repository slug override. |
| `--reviewer` |  | Reviewer username or {UUID} to add (repeatable) |
| `--title` | `-t` | Set the new title. |
| `--with-default-reviewers` |  | Add repository default reviewers |
| `--workspace` |  | Bitbucket workspace override (Cloud). |

### Inherited Flags

| Flag | Short | Description |
|---|---|---|
| `--context` | `-c` | Active Bitbucket context name |
| `--format` |  | Output format: json or yaml (alias for --json/--yaml) |
| `--jq` |  | Apply a jq expression to JSON output (requires --json or --format json) |
| `--json` |  | Output in JSON format when supported |
| `--template` |  | Render output using Go templates |
| `--yaml` |  | Output in YAML format when supported |

### Examples

```bash
# Update pull request title
  bkt pr edit 123 --title "New feature: user authentication"

  # Update pull request description
  bkt pr edit 123 --body "This PR adds OAuth2 support"

  # Update both title and description
  bkt pr edit 123 -t "Fix login bug" -b "Resolves issue with session timeout"

  # Add reviewers
  bkt pr edit 123 --reviewer alice --reviewer bob

  # Remove a reviewer
  bkt pr edit 123 --remove-reviewer alice

  # Add repository default reviewers
  bkt pr edit 123 --with-default-reviewers

  # Add and remove reviewers in one call
  bkt pr edit 123 --reviewer charlie --remove-reviewer alice
```

## bkt pr list

List pull requests for a repository, filtered by state. On Data Center, the
project and repo are resolved from the active context (or --project/--repo).
On Cloud, the workspace and repo are used instead.

When --mine is set without a specific repository, the command lists pull
requests authored by the authenticated user across all repositories. On Data
Center this uses the dashboard API; on Cloud it queries the workspace.

--reviewer is the reviewer-facing counterpart: it shows pull requests where the
authenticated user is a requested reviewer. Without a repository, Data Center
lists them across all repositories via the dashboard API; Bitbucket Cloud has
no workspace-wide reviewer endpoint, so --reviewer there requires a repository.
--mine and --reviewer cannot be combined.

**Alias:** `ls`

### Usage

```
bkt pr list [flags]
```

### Flags

| Flag | Short | Description |
|---|---|---|
| `--limit` |  | Maximum pull requests to list (0 for all) |
| `--mine` |  | Show pull requests authored by the authenticated user |
| `--project` |  | Bitbucket project key override |
| `--repo` |  | Repository slug override |
| `--reviewer` |  | Show pull requests where the authenticated user is a requested reviewer |
| `--state` |  | Filter by state (OPEN, MERGED, DECLINED) |
| `--workspace` |  | Bitbucket workspace override (Cloud) |

### Inherited Flags

| Flag | Short | Description |
|---|---|---|
| `--context` | `-c` | Active Bitbucket context name |
| `--format` |  | Output format: json or yaml (alias for --json/--yaml) |
| `--jq` |  | Apply a jq expression to JSON output (requires --json or --format json) |
| `--json` |  | Output in JSON format when supported |
| `--template` |  | Render output using Go templates |
| `--ya...

© Aviv Sinai · MIT · hashgraph-online/awesome-codex-plugins

Похожие правила IDE

Все правила IDE по теме «Код-ревью и рефакторинг» →
bkt avivsinai Скилл учит агента работать с Bitbucket Cloud и Data Center через утилиту bkt. Помогает просматривать пуллреквесты, ветки, пайплайны и безопасно выполнять слияния. CX Codex +1 2 100установок bitbucket-workflow Mindrally Скилл bitbucket-workflow задаёт агенту правила работы с Bitbucket: оформление пул-реквестов, конфигурация Pipelines, связка с Jira и ветвление по Gitflow. CX Codex +1 808установок github openclaw Скилл для работы с GitHub через CLI на Claude Code: просмотр и создание PR, управление issues, проверка статуса CI. Доступен также на Codex, Cursor, GitHub Copilot, Gemini CLI и OpenCode. CX Codex +1 6 100установок attach-review-to-pr NeoLabHQ Скилл attach-review-to-pr для Claude Code добавляет в пул-реквесты комментарии к конкретным строкам кода через GitHub CLI или MCP-инструмент. Проводит ревью из терминала. CX Codex +1 1 200установок creating-pr spencerpauly Скилл creating-pr проводит агента по шагам создания пул-реквеста: подготовка ветки, заголовок, описание, самопроверка и запрос ревьюеров. CX Codex +1 505установок resolve-human-reviews pbakaus Скилл resolve-human-reviews проходит по неотвеченным комментариям людей в текущем пул-реквесте, оценивает каждый, вносит правки и отвечает с результатом. CX Codex +1 401установок

Из того же набора391

Весь набор →
game Скилл game помогает создавать и менять многопользовательские веб-игры в студии Homie. Он пригодится и для игровых решений на основе ИИ, и для оформления страницы игры. CX Codex +1 ★ 1 596звёзд репо webly Скилл webly публикует сайт или папку с файлами по живой ссылке без аккаунта: анонимная копия держится 24 часа, потом сайт можно забрать в аккаунт и править через MCP. CX Codex +1 ★ 1 596звёзд репо amazon-ads-marketing-cloud Скилл amazon-ads-marketing-cloud помогает строить SQL-запросы к Amazon Marketing Cloud, настраивать сегменты аудиторий и запускать аналитику атрибуции рекламы прямо в диалоге с агентом. CX Codex +1 ★ 1 596звёзд репо ship Скилл ship разбивает проект на фазы и проводит каждую от вопросов и плана до сборки, проверки и отчёта. Продолжает работу по сохранённому состоянию после остановки или /clear. CX Codex +1 ★ 1 596звёзд репо maintaining-modding-environments Скилл maintaining-modding-environments помогает обновлять базы знаний, очищать кэш пакетов и обслуживать CLI переводчика xtl для моддинга игр Bethesda. CX Codex +1 ★ 1 596звёзд репо review Скилл review запускает проверку изменений несколькими агентами: в быстром режиме работают 5 агентов, а флаг --deep включает полный конвейер проверки. CX Codex +1 ★ 1 596звёзд репо codiris-agentizer Скилл codiris-agentizer разбирает сайт по страницам, выясняет, что компания продаёт, и собирает из Next.js-шаблона интерактивный agentfront под этот бизнес. CX Codex +1 ★ 1 596звёзд репо zotero-research-tools Плагин zotero-research-tools для Claude Code и Codex подключает Zotero Desktop через Zotero MCP: агент ищет и читает записи библиотеки, готовит цитаты и разбирает коллекции с тегами. CX Codex ★ 1 596звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой