bitbucket-helper
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBitbucket Helper
Bitbucket 助手
Auto-detects Bitbucket Cloud or Server from configured git remote.
The helper script lives at relative to this skill's directory (the harness resolves it). Run it from the user's repo with the script's absolute or skill-relative path:
scripts/bitbucket_server_pr.pybash
python3 <skill-dir>/scripts/bitbucket_server_pr.py从已配置的 git remote 自动检测 Bitbucket Cloud 或 Server。
辅助脚本位于 (相对于此 skill 的目录,由 harness 解析)。使用脚本的绝对路径或相对于 skill 的路径,在用户的 repo 中运行:
scripts/bitbucket_server_pr.pybash
python3 <skill-dir>/scripts/bitbucket_server_pr.pySteps
步骤
- Run helper with no args to detect type and PR context. Done when source, target, project, repo known.
- PR body needed: use first. Done when body has Description, Test Plan, Test Result, Links.
/pr-writing - Before live create/update/approve: confirm unless user explicitly asked.
- For review: start with , then targeted
review-contextordiff --path.file - For updates: read PR version first, send only mutable fields (title, description, version, fromRef, toRef, reviewers). Never send .
author
Completion: operation scoped to detected repo and PR, mutations authorized.
- 无参数运行 helper,以检测类型和 PR context。完成条件:已知 source、target、project 和 repo。
- 需要 PR body 时:先使用 。完成条件:body 包含 Description、Test Plan、Test Result 和 Links。
/pr-writing - 实际执行 create/update/approve 前:除非用户已明确要求,否则先确认。
- 进行 review 时:先运行 ,然后有针对性地运行
review-context或diff --path。file - 进行 update 时:先读取 PR version,仅发送可变字段(title、description、version、fromRef、toRef、reviewers)。绝不发送 。
author
完成条件:操作范围限定于检测到的 repo 和 PR,且变更操作已获授权。
Commands
命令
bash
undefinedbash
undefinedRead
Read
list --repo-dir . [--state OPEN] [--limit 25] [--page-start 0]
get <pr_id> --repo-dir . [--body]
review-context <pr_id> --repo-dir .
files <pr_id> --repo-dir .
diff <pr_id> --repo-dir . --path <path>
file <path> --repo-dir . --at refs/heads/main
commits <pr_id> --repo-dir .
commit <sha> --repo-dir .
list --repo-dir . [--state OPEN] [--limit 25] [--page-start 0]
get <pr_id> --repo-dir . [--body]
review-context <pr_id> --repo-dir .
files <pr_id> --repo-dir .
diff <pr_id> --repo-dir . --path <path>
file <path> --repo-dir . --at refs/heads/main
commits <pr_id> --repo-dir .
commit <sha> --repo-dir .
Mutate
Mutate
approve <pr_id> --repo-dir .
create --repo-dir . --target main --title "PROJ-123: title" [--draft]
update <pr_id> --repo-dir . [--refresh-description | --ready]
Flags: `--full`, `--body`, `--format text`, `--cloud`, `--base-url`.approve <pr_id> --repo-dir .
create --repo-dir . --target main --title "PROJ-123: title" [--draft]
update <pr_id> --repo-dir . [--refresh-description | --ready]
参数:`--full`、`--body`、`--format text`、`--cloud`、`--base-url`。Auth
身份认证
BB_USERBB_PASSWORDBB_CLOUD_*BB_SERVER_*SSH clone remotes are supported for repo detection. SSH keys authenticate Git transport only; REST API calls still need Bitbucket user/token credentials.
使用 / ,或使用限定范围的凭据: / (限定范围的凭据优先)。Cloud:使用具有 Repositories 和 Pull Requests Read/Write 权限的 App Password。
BB_USERBB_PASSWORDBB_CLOUD_*BB_SERVER_*检测 repo 时支持 SSH clone remote。SSH key 仅用于 Git transport 身份认证;REST API 调用仍需要 Bitbucket user/token 凭据。
Detection
检测
| Remote | Type |
|---|---|
| Cloud |
| Server |
Override: or .
--cloud--base-url| Remote | 类型 |
|---|---|
URL 中包含 | Cloud |
| Server |
覆盖方式: 或 。
--cloud--base-url