gitlab
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGitLab with orbit CLI
借助orbit CLI管理GitLab
Manage GitLab projects, merge requests, pipelines, issues, branches, tags, commits, members, and users through the CLI. Works with both GitLab Cloud and self-hosted instances via REST API v4, with multi-profile support and 1Password secret resolution.
orbit通过 CLI管理GitLab的项目、合并请求、流水线、问题、分支、标签、提交、成员和用户。支持GitLab Cloud和自托管实例,基于REST API v4,具备多配置文件支持和1Password密钥解析功能。
orbitPrerequisites
前置条件
- binary built and accessible
orbit - A profile with a service configured in
gitlab~/.config/orbit/config.yaml - Valid credentials (Personal Access Token or Bearer token) — can be stored in 1Password with prefix
op://
- 已构建并可访问二进制文件
orbit - 在中配置了包含
~/.config/orbit/config.yaml服务的配置文件gitlab - 有效的凭证(个人访问令牌或Bearer令牌)——可通过前缀存储在1Password中
op://
Quick Reference
快速参考
All commands follow the pattern:
orbit -p <profile> gitlab <command> [flags]Alias:
orbit -p <profile> gl <command> [flags]All commands support for JSON output. For full command details and all flags, see .
-o jsonreferences/commands.md所有命令遵循以下格式:
orbit -p <profile> gitlab <command> [flags]别名:
orbit -p <profile> gl <command> [flags]所有命令支持参数以输出JSON格式。如需完整命令详情及所有参数,请查看。
-o jsonreferences/commands.mdProject Identification
项目标识
Projects can be referenced by numeric ID or full path:
orbit -p myprofile gl project 595orbit -p myprofile gl project schools/frontend/my-app
Groups also accept ID or full path:
schools/frontend项目可通过数字ID或完整路径引用:
orbit -p myprofile gl project 595orbit -p myprofile gl project schools/frontend/my-app
群组同样支持ID或完整路径:
schools/frontendCore Workflows
核心工作流
Exploring Projects and Groups
探索项目与群组
bash
undefinedbash
undefinedView project details
查看项目详情
orbit -p myprofile gl project schools/frontend/my-app
orbit -p myprofile gl project schools/frontend/my-app
List your projects (membership-based)
列出你的项目(基于成员身份)
orbit -p myprofile gl projects --search frontend
orbit -p myprofile gl projects --search frontend
List all projects in a group (includes subgroups)
列出群组中的所有项目(包含子群组)
orbit -p myprofile gl projects --group schools/frontend
orbit -p myprofile gl projects --group schools/frontend
View group info
查看群组信息
orbit -p myprofile gl group view schools/frontend
orbit -p myprofile gl group view schools/frontend
List subgroups
列出子群组
orbit -p myprofile gl group subgroups schools
undefinedorbit -p myprofile gl group subgroups schools
undefinedWorking with Merge Requests
处理合并请求
GitLab calls them "merge requests" (MR), equivalent to GitHub's "pull requests" (PR).
bash
undefinedGitLab中称为“合并请求”(MR),等同于GitHub的“拉取请求”(PR)。
bash
undefinedList open MRs
列出开放的MR
orbit -p myprofile gl mr list 595
orbit -p myprofile gl mr list 595
List merged MRs
列出已合并的MR
orbit -p myprofile gl mr list 595 --state merged
orbit -p myprofile gl mr list 595 --state merged
View MR details (shows source/target branch, conflicts, review status)
查看MR详情(显示源/目标分支、冲突、审核状态)
orbit -p myprofile gl mr view 595 42
orbit -p myprofile gl mr view 595 42
Create an MR
创建MR
orbit -p myprofile gl mr create 595
--source feature/login --target main --title "Add login page"
--source feature/login --target main --title "Add login page"
orbit -p myprofile gl mr create 595
--source feature/login --target main --title "Add login page"
--source feature/login --target main --title "Add login page"
Merge an MR (with optional squash)
合并MR(可选压缩提交)
orbit -p myprofile gl mr merge 595 42 --squash
orbit -p myprofile gl mr merge 595 42 --squash
Add a comment
添加评论
orbit -p myprofile gl mr comment 595 42 --body "LGTM!"
orbit -p myprofile gl mr comment 595 42 --body "LGTM!"
List discussion comments (excludes system notes)
列出讨论评论(排除系统通知)
orbit -p myprofile gl mr notes 595 42
undefinedorbit -p myprofile gl mr notes 595 42
undefinedCI/CD Pipelines
CI/CD流水线
bash
undefinedbash
undefinedList recent pipelines
列出近期流水线
orbit -p myprofile gl pipeline list 595
orbit -p myprofile gl pipeline list 595
Filter by branch and status
按分支和状态筛选
orbit -p myprofile gl pipeline list 595 --ref main --status failed
orbit -p myprofile gl pipeline list 595 --ref main --status failed
View pipeline details
查看流水线详情
orbit -p myprofile gl pipeline view 595 12345
orbit -p myprofile gl pipeline view 595 12345
List jobs in a pipeline (shows stage, status, duration)
列出流水线中的任务(显示阶段、状态、时长)
orbit -p myprofile gl pipeline jobs 595 12345
orbit -p myprofile gl pipeline jobs 595 12345
Retry a failed pipeline
重试失败的流水线
orbit -p myprofile gl pipeline retry 595 12345
orbit -p myprofile gl pipeline retry 595 12345
Cancel a running pipeline
取消运行中的流水线
orbit -p myprofile gl pipeline cancel 595 12345
Pipeline aliases: `pipeline`, `pipe`, `ci` — so `orbit gl ci list 595` works too.orbit -p myprofile gl pipeline cancel 595 12345
流水线别名:`pipeline`、`pipe`、`ci`——因此`orbit gl ci list 595`同样可用。Branches and Tags
分支与标签
bash
undefinedbash
undefinedList branches
列出分支
orbit -p myprofile gl branch list 595 --search feature
orbit -p myprofile gl branch list 595 --search feature
View branch details (includes latest commit)
查看分支详情(包含最新提交)
orbit -p myprofile gl branch view 595 main
orbit -p myprofile gl branch view 595 main
Create a branch from a ref
从指定引用创建分支
orbit -p myprofile gl branch create 595 feature/new-thing main
orbit -p myprofile gl branch create 595 feature/new-thing main
Delete a branch
删除分支
orbit -p myprofile gl branch delete 595 feature/old-thing
orbit -p myprofile gl branch delete 595 feature/old-thing
List tags
列出标签
orbit -p myprofile gl tag list 595
orbit -p myprofile gl tag list 595
Create an annotated tag
创建带注释的标签
orbit -p myprofile gl tag create 595 v1.0.0 main -m "Release v1.0.0"
undefinedorbit -p myprofile gl tag create 595 v1.0.0 main -m "Release v1.0.0"
undefinedCommits
提交
bash
undefinedbash
undefinedList recent commits (default branch)
列出近期提交(默认分支)
orbit -p myprofile gl commit list 595
orbit -p myprofile gl commit list 595
List commits on a specific branch
列出指定分支的提交
orbit -p myprofile gl commit list 595 --ref feature/login
orbit -p myprofile gl commit list 595 --ref feature/login
View commit details
查看提交详情
orbit -p myprofile gl commit view 595 abc1234
undefinedorbit -p myprofile gl commit view 595 abc1234
undefinedIssues
问题
bash
undefinedbash
undefinedList open issues
列出开放的问题
orbit -p myprofile gl issue list 595 --state opened
orbit -p myprofile gl issue list 595 --state opened
Filter by labels
按标签筛选
orbit -p myprofile gl issue list 595 --labels bug,urgent
orbit -p myprofile gl issue list 595 --labels bug,urgent
View issue details
查看问题详情
orbit -p myprofile gl issue view 595 1
orbit -p myprofile gl issue view 595 1
Create an issue
创建问题
orbit -p myprofile gl issue create 595 --title "Fix login bug" --labels bug,urgent
orbit -p myprofile gl issue create 595 --title "Fix login bug" --labels bug,urgent
Close an issue
关闭问题
orbit -p myprofile gl issue close 595 1
undefinedorbit -p myprofile gl issue close 595 1
undefinedMembers and Users
成员与用户
bash
undefinedbash
undefinedList project members (shows access level: Guest/Reporter/Developer/Maintainer/Owner)
列出项目成员(显示权限等级:访客/报告者/开发者/维护者/所有者)
orbit -p myprofile gl member list 595
orbit -p myprofile gl member list 595
Show current authenticated user
显示当前已认证用户
orbit -p myprofile gl user me
orbit -p myprofile gl user me
Search users
搜索用户
orbit -p myprofile gl user list --search john
undefinedorbit -p myprofile gl user list --search john
undefinedCommon Patterns
常见用法
Get JSON for scripting:
Any command supports for machine-readable output:
-o jsonbash
orbit -p myprofile gl mr list 595 -o json | jq '.[].title'Check CI status for a branch:
bash
orbit -p myprofile gl pipeline list 595 --ref main --limit 1Find who's working on a project:
bash
orbit -p myprofile gl member list 595Review an MR end-to-end:
bash
undefined获取JSON格式用于脚本开发:
任何命令都支持参数以输出机器可读的JSON格式:
-o jsonbash
orbit -p myprofile gl mr list 595 -o json | jq '.[].title'检查分支的CI状态:
bash
orbit -p myprofile gl pipeline list 595 --ref main --limit 1查看项目的参与人员:
bash
orbit -p myprofile gl member list 595完整审核MR:
bash
undefinedView MR details
查看MR详情
orbit -p myprofile gl mr view 595 42
orbit -p myprofile gl mr view 595 42
Check its pipeline
检查其关联的流水线
orbit -p myprofile gl pipeline list 595 --ref feature/login --limit 1
orbit -p myprofile gl pipeline list 595 --ref feature/login --limit 1
Read discussion
查看讨论内容
orbit -p myprofile gl mr notes 595 42
orbit -p myprofile gl mr notes 595 42
Approve with comment
附评论批准
orbit -p myprofile gl mr comment 595 42 --body "Approved, looks good"
undefinedorbit -p myprofile gl mr comment 595 42 --body "Approved, looks good"
undefinedImportant Notes
重要说明
- Profile required — Always pass to select the GitLab connection. The profile must have a service of type
-p <profile>configured.gitlab - Service flag — If a profile has multiple GitLab services, use to disambiguate.
--service <name> - Cloud vs Self-hosted — Works with both. The base URL in your profile config determines the GitLab instance.
- 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 - MR = PR — If a user says "pull request" or "PR" in a GitLab context, they mean merge request.
- Pagination — Most list commands default to 20-50 results. Use to adjust.
--limit N
- 必须指定配置文件 — 请始终通过参数选择GitLab连接。该配置文件必须包含类型为
-p <profile>的服务配置。gitlab - 服务参数 — 如果一个配置文件包含多个GitLab服务,请使用参数进行区分。
--service <name> - 云与自托管 — 两者均支持。配置文件中的基础URL将决定使用的GitLab实例。
- 1Password集成 — 配置中的认证令牌可使用格式,会在运行时解析。运行
op://vault/item/field一次即可解析并缓存所有密钥8小时(仅需一次生物识别验证)。使用orbit auth可清除缓存。orbit auth clear - MR等同于PR — 如果用户在GitLab语境下提到“拉取请求”或“PR”,实际指的是合并请求。
- 分页 — 大多数列表命令默认返回20-50条结果。可使用参数调整数量。
--limit N