bitbucket
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBitbucket with orbit CLI
使用orbit CLI管理Bitbucket
Manage Bitbucket repositories, pull requests, branches, tags, commits, projects, and users through the CLI. Works with both Bitbucket Server/Data Center and Cloud, with multi-profile support and 1Password secret resolution.
orbit通过 CLI管理Bitbucket仓库、拉取请求(PR)、分支、标签、提交、项目和用户。支持Bitbucket Server/Data Center和Cloud版本,具备多配置文件支持和1Password密钥解析功能。
orbitPrerequisites
前提条件
- binary built and accessible
orbit - A profile with a service configured in
bitbucket~/.config/orbit/config.yaml - Valid credentials (Personal Access Token or Bearer token for Server; app password for Cloud) — can be stored in 1Password with prefix
op://
- 已构建并可访问二进制文件
orbit - 在中配置了带有
~/.config/orbit/config.yaml服务的配置文件bitbucket - 有效凭据(Server版本使用个人访问令牌或Bearer令牌;Cloud版本使用应用密码)——可存储在1Password中,前缀为
op://
Quick Reference
快速参考
All commands follow the pattern:
orbit -p <profile> bitbucket <command> [flags]Alias:
orbit -p <profile> bb <command> [flags]All commands support for JSON output. For full command details and all flags, see .
-o jsonreferences/commands.md所有命令遵循以下格式:
orbit -p <profile> bitbucket <command> [flags]别名:
orbit -p <profile> bb <command> [flags]所有命令支持参数以输出JSON格式。有关完整命令详情和所有标志,请参阅。
-o jsonreferences/commands.mdAddressing Convention
地址约定
Bitbucket Server/Data Center uses project-key + repo-slug to identify repositories. These are the two positional arguments most commands require:
- Project key: uppercase short code (e.g., ,
L3SUP)MYPROJ - Repo slug: lowercase hyphenated name (e.g., ,
agents-sre)my-service
You can extract these from a Bitbucket Server URL:
https://git.example.com/projects/L3SUP/repos/agents-sre/
^^^^^ ^^^^^^^^^^
project-key repo-slugBitbucket Server/Data Center使用项目密钥 + 仓库别名来标识仓库。这是大多数命令所需的两个位置参数:
- 项目密钥:大写短代码(例如、
L3SUP)MYPROJ - 仓库别名:小写连字符分隔的名称(例如、
agents-sre)my-service
你可以从Bitbucket Server URL中提取这些信息:
https://git.example.com/projects/L3SUP/repos/agents-sre/
^^^^^ ^^^^^^^^^^
项目密钥 仓库别名Core Workflows
核心工作流
Exploring Projects and Repos
浏览项目和仓库
bash
undefinedbash
undefinedList all projects
列出所有项目
orbit -p myprofile bb project list
orbit -p myprofile bb project list
View project details
查看项目详情
orbit -p myprofile bb project view L3SUP
orbit -p myprofile bb project view L3SUP
List repositories in a project
列出项目中的仓库
orbit -p myprofile bb repo list L3SUP
orbit -p myprofile bb repo list L3SUP
View repo details (includes clone URLs)
查看仓库详情(包含克隆URL)
orbit -p myprofile bb repo view L3SUP agents-sre
undefinedorbit -p myprofile bb repo view L3SUP agents-sre
undefinedWorking with Pull Requests
处理拉取请求
Bitbucket uses "pull requests" (PR), same as GitHub.
bash
undefinedBitbucket使用“拉取请求”(PR),与GitHub相同。
bash
undefinedList open PRs (default)
列出打开状态的PR(默认)
orbit -p myprofile bb pr list L3SUP agents-sre
orbit -p myprofile bb pr list L3SUP agents-sre
List merged PRs
列出已合并的PR
orbit -p myprofile bb pr list L3SUP agents-sre --state merged
orbit -p myprofile bb pr list L3SUP agents-sre --state merged
List all PRs
列出所有PR
orbit -p myprofile bb pr list L3SUP agents-sre --state all
orbit -p myprofile bb pr list L3SUP agents-sre --state all
View PR details (shows from/to branches, reviewers, approval status)
查看PR详情(显示源分支/目标分支、审核者、批准状态)
orbit -p myprofile bb pr view L3SUP agents-sre 42
orbit -p myprofile bb pr view L3SUP agents-sre 42
Create a PR
创建PR
orbit -p myprofile bb pr create L3SUP agents-sre
--from feature/new --to main --title "Add new feature"
--from feature/new --to main --title "Add new feature"
orbit -p myprofile bb pr create L3SUP agents-sre
--from feature/new --to main --title "添加新功能"
--from feature/new --to main --title "添加新功能"
Create a PR with reviewers
创建带审核者的PR
orbit -p myprofile bb pr create L3SUP agents-sre
--from feature/new --to main --title "Add feature"
--reviewers john.doe,jane.smith
--from feature/new --to main --title "Add feature"
--reviewers john.doe,jane.smith
orbit -p myprofile bb pr create L3SUP agents-sre
--from feature/new --to main --title "添加功能"
--reviewers john.doe,jane.smith
--from feature/new --to main --title "添加功能"
--reviewers john.doe,jane.smith
View PR diff (for code review)
查看PR差异(用于代码审查)
orbit -p myprofile bb pr diff L3SUP agents-sre 42
orbit -p myprofile bb pr diff L3SUP agents-sre 42
View PR diff with more context lines
查看带更多上下文行的PR差异
orbit -p myprofile bb pr diff L3SUP agents-sre 42 --context 10
orbit -p myprofile bb pr diff L3SUP agents-sre 42 --context 10
Merge a PR
合并PR
orbit -p myprofile bb pr merge L3SUP agents-sre 42
orbit -p myprofile bb pr merge L3SUP agents-sre 42
Merge a PR bypassing review checks (requires repo admin)
绕过审查检查合并PR(需要仓库管理员权限)
orbit -p myprofile bb pr merge L3SUP agents-sre 42 --bypass-review
orbit -p myprofile bb pr merge L3SUP agents-sre 42 --bypass-review
Decline a PR
拒绝PR
orbit -p myprofile bb pr decline L3SUP agents-sre 42
orbit -p myprofile bb pr decline L3SUP agents-sre 42
Add a comment to a PR
给PR添加评论
orbit -p myprofile bb pr comment L3SUP agents-sre 42 --body "LGTM!"
orbit -p myprofile bb pr comment L3SUP agents-sre 42 --body "LGTM!"
View PR activity (comments, approvals, status changes)
查看PR活动(评论、批准、状态变更)
orbit -p myprofile bb pr activity L3SUP agents-sre 42
**PR states:** `OPEN`, `MERGED`, `DECLINED`, `ALL`orbit -p myprofile bb pr activity L3SUP agents-sre 42
**PR状态:** `OPEN`、`MERGED`、`DECLINED`、`ALL`Branches and Tags
分支和标签
bash
undefinedbash
undefinedList branches
列出分支
orbit -p myprofile bb branch list L3SUP agents-sre
orbit -p myprofile bb branch list L3SUP agents-sre
Filter branches by name
按名称过滤分支
orbit -p myprofile bb branch list L3SUP agents-sre --filter feature
orbit -p myprofile bb branch list L3SUP agents-sre --filter feature
Show default branch
显示默认分支
orbit -p myprofile bb branch default L3SUP agents-sre
orbit -p myprofile bb branch default L3SUP agents-sre
Create a branch from a ref
从引用创建分支
orbit -p myprofile bb branch create L3SUP agents-sre feature/new-thing main
orbit -p myprofile bb branch create L3SUP agents-sre feature/new-thing main
Delete a branch
删除分支
orbit -p myprofile bb branch delete L3SUP agents-sre feature/old-thing
orbit -p myprofile bb branch delete L3SUP agents-sre feature/old-thing
List tags
列出标签
orbit -p myprofile bb tag list L3SUP agents-sre
orbit -p myprofile bb tag list L3SUP agents-sre
Create a tag
创建标签
orbit -p myprofile bb tag create L3SUP agents-sre v1.0.0 main -m "Release v1.0.0"
undefinedorbit -p myprofile bb tag create L3SUP agents-sre v1.0.0 main -m "Release v1.0.0"
undefinedCommits
提交
bash
undefinedbash
undefinedList recent commits (default branch)
列出最近提交(默认分支)
orbit -p myprofile bb commit list L3SUP agents-sre
orbit -p myprofile bb commit list L3SUP agents-sre
List commits on a specific branch
列出特定分支上的提交
orbit -p myprofile bb commit list L3SUP agents-sre --branch feature/new
orbit -p myprofile bb commit list L3SUP agents-sre --branch feature/new
View commit details
查看提交详情
orbit -p myprofile bb commit view L3SUP agents-sre abc1234def5678
undefinedorbit -p myprofile bb commit view L3SUP agents-sre abc1234def5678
undefinedUsers
用户
bash
undefinedbash
undefinedList users
列出用户
orbit -p myprofile bb user list
orbit -p myprofile bb user list
Filter users by name
按名称过滤用户
orbit -p myprofile bb user list --filter john
undefinedorbit -p myprofile bb user list --filter john
undefinedCommon Patterns
常见模式
Get JSON for scripting:
bash
orbit -p myprofile bb pr list L3SUP agents-sre -o json | jq '.[].title'Review a PR end-to-end:
bash
undefined获取JSON格式用于脚本编写:
bash
orbit -p myprofile bb pr list L3SUP agents-sre -o json | jq '.[].title'端到端审查PR:
bash
undefinedView PR details and reviewers
查看PR详情和审核者
orbit -p myprofile bb pr view L3SUP agents-sre 42
orbit -p myprofile bb pr view L3SUP agents-sre 42
Get the full diff for code review
获取完整差异用于代码审查
orbit -p myprofile bb pr diff L3SUP agents-sre 42
orbit -p myprofile bb pr diff L3SUP agents-sre 42
Check activity (approvals, comments)
检查活动(批准、评论)
orbit -p myprofile bb pr activity L3SUP agents-sre 42
orbit -p myprofile bb pr activity L3SUP agents-sre 42
Add your review comment
添加你的审查评论
orbit -p myprofile bb pr comment L3SUP agents-sre 42 --body "Approved, looks good"
**Extract project key and repo slug from a URL:**
Given `https://git.cnvrmedia.net/projects/L3SUP/repos/agents-sre/pull-requests`:
- Project key: `L3SUP`
- Repo slug: `agents-sre`
Then run: `orbit -p myprofile bb pr list L3SUP agents-sre`
**Check what repos exist in a project:**
```bash
orbit -p myprofile bb repo list L3SUPorbit -p myprofile bb pr comment L3SUP agents-sre 42 --body "Approved, looks good"
**从URL中提取项目密钥和仓库别名:**
给定URL `https://git.cnvrmedia.net/projects/L3SUP/repos/agents-sre/pull-requests`:
- 项目密钥:`L3SUP`
- 仓库别名:`agents-sre`
然后运行:`orbit -p myprofile bb pr list L3SUP agents-sre`
**检查项目中有哪些仓库:**
```bash
orbit -p myprofile bb repo list L3SUPImportant Notes
重要说明
- Profile required — Always pass to select the Bitbucket connection. The profile must have a service of type
-p <profile>configured.bitbucket - Service flag — If a profile has multiple Bitbucket services, use to disambiguate.
--service <name> - Server vs Cloud — The service variant (or
server) in config determines the API prefix. Server usescloud, Cloud uses/rest/api/latest/./2.0/ - 1Password integration — Auth tokens in config can use and are resolved at runtime. Run
op://vault/item/fieldonce to resolve and cache all secrets for 8 hours (single biometric prompt). Useorbit authto wipe the cache.orbit auth clear - PR states are uppercase — Use ,
OPEN,MERGED, orDECLINED(case-insensitive input is accepted).ALL - Pagination — Most list commands default to 25-50 results. Use to adjust.
--limit N - URL parsing — When a user provides a Bitbucket Server URL like , extract the project key and repo slug from the URL path to use with orbit commands.
https://host/projects/KEY/repos/SLUG/...
- 必须指定配置文件 — 始终通过参数选择Bitbucket连接。配置文件必须已配置类型为
-p <profile>的服务。bitbucket - 服务标志 — 如果配置文件包含多个Bitbucket服务,请使用参数来区分。
--service <name> - Server与Cloud版本 — 配置中的服务类型(或
server)决定了API前缀。Server版本使用cloud,Cloud版本使用/rest/api/latest/。/2.0/ - 1Password集成 — 配置中的认证令牌可以使用格式,会在运行时解析。运行
op://vault/item/field一次即可解析并缓存所有密钥8小时(仅需一次生物特征验证)。使用orbit auth清除缓存。orbit auth clear - PR状态为大写 — 使用、
OPEN、MERGED或DECLINED(接受不区分大小写的输入)。ALL - 分页 — 大多数列表命令默认返回25-50条结果。使用参数调整数量。
--limit N - URL解析 — 当用户提供Bitbucket Server URL(例如)时,从URL路径中提取项目密钥和仓库别名,用于orbit命令。
https://host/projects/KEY/repos/SLUG/...