github
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGitHub with orbit CLI
使用orbit CLI管理GitHub
Manage GitHub repositories, pull requests, issues, releases, branches, tags, commits, workflow runs, secrets, and users through the CLI. Works with both GitHub.com and GitHub Enterprise via REST API, with multi-profile support and 1Password secret resolution.
orbit通过 CLI管理GitHub仓库、拉取请求(PR)、议题、发布版本、分支、标签、提交、工作流运行、密钥和用户。通过REST API支持GitHub.com和GitHub Enterprise,具备多配置文件支持和1Password密钥解析功能。
orbitPrerequisites
前置条件
- binary built and accessible
orbit - A profile with a service configured in
github~/.config/orbit/config.yaml - Valid credentials (Personal Access Token) — can be stored in 1Password with prefix
op://
- 已构建并可访问二进制文件
orbit - 在中配置了带有
~/.config/orbit/config.yaml服务的配置文件github - 有效的凭据(个人访问令牌)——可使用前缀存储在1Password中
op://
Quick Reference
快速参考
All commands follow the pattern:
orbit -p <profile> github <command> [flags]Alias:
orbit -p <profile> gh <command> [flags]All commands support for JSON output. For full command details and all flags, see .
-o jsonreferences/commands.md所有命令遵循以下格式:
orbit -p <profile> github <command> [flags]别名:
orbit -p <profile> gh <command> [flags]所有命令都支持参数以输出JSON格式内容。有关完整的命令详情和所有参数,请参阅。
-o jsonreferences/commands.mdRepository Identification
仓库标识
Repositories are always referenced as :
owner/repoorbit -p myprofile gh repo octocat/hello-worldorbit -p myprofile gh repo kubernetes/kubernetes
仓库始终以格式引用:
owner/repoorbit -p myprofile gh repo octocat/hello-worldorbit -p myprofile gh repo kubernetes/kubernetes
Core Workflows
核心工作流
Exploring Repositories
浏览仓库
bash
undefinedbash
undefinedView repo details
查看仓库详情
orbit -p myprofile gh repo octocat/hello-world
orbit -p myprofile gh repo octocat/hello-world
List your repos (sorted by most recently pushed)
列出你的仓库(按最近推送时间排序)
orbit -p myprofile gh repos
orbit -p myprofile gh repos
List repos in an organization
列出组织中的仓库
orbit -p myprofile gh repos --org kubernetes
orbit -p myprofile gh repos --org kubernetes
List repos with limit
列出指定数量的仓库
orbit -p myprofile gh repos --limit 10
undefinedorbit -p myprofile gh repos --limit 10
undefinedWorking with Pull Requests
处理拉取请求(PR)
bash
undefinedbash
undefinedList open PRs
列出开放的PR
orbit -p myprofile gh pr list octocat/hello-world
orbit -p myprofile gh pr list octocat/hello-world
List closed PRs
列出已关闭的PR
orbit -p myprofile gh pr list octocat/hello-world --state closed
orbit -p myprofile gh pr list octocat/hello-world --state closed
View PR details (shows head/base branch, labels, comments)
查看PR详情(显示源分支/目标分支、标签、评论)
orbit -p myprofile gh pr view octocat/hello-world 42
orbit -p myprofile gh pr view octocat/hello-world 42
Create a PR
创建PR
orbit -p myprofile gh pr create octocat/hello-world
--head feature/login --base main --title "Add login page"
--head feature/login --base main --title "Add login page"
orbit -p myprofile gh pr create octocat/hello-world
--head feature/login --base main --title "Add login page"
--head feature/login --base main --title "Add login page"
Merge a PR (with optional method: merge, squash, rebase)
合并PR(可选合并方式:merge、squash、rebase)
orbit -p myprofile gh pr merge octocat/hello-world 42 --method squash
orbit -p myprofile gh pr merge octocat/hello-world 42 --method squash
Add a comment
添加评论
orbit -p myprofile gh pr comment octocat/hello-world 42 --body "LGTM!"
orbit -p myprofile gh pr comment octocat/hello-world 42 --body "LGTM!"
List comments
列出评论
orbit -p myprofile gh pr comments octocat/hello-world 42
undefinedorbit -p myprofile gh pr comments octocat/hello-world 42
undefinedGitHub Actions Workflow Runs
GitHub Actions工作流运行
bash
undefinedbash
undefinedList recent workflow runs
列出最近的工作流运行记录
orbit -p myprofile gh run list octocat/hello-world
orbit -p myprofile gh run list octocat/hello-world
Filter by branch and status
按分支和状态筛选
orbit -p myprofile gh run list octocat/hello-world --branch main --status completed
orbit -p myprofile gh run list octocat/hello-world --branch main --status completed
View workflow run details
查看工作流运行详情
orbit -p myprofile gh run view octocat/hello-world 12345
orbit -p myprofile gh run view octocat/hello-world 12345
Watch a run in real-time (polls and shows job/step progress until completion)
实时监控运行记录(轮询并显示任务/步骤进度,直到完成)
orbit -p myprofile gh run watch octocat/hello-world
orbit -p myprofile gh run watch octocat/hello-world 12345 --interval 10
orbit -p myprofile gh run watch octocat/hello-world
orbit -p myprofile gh run watch octocat/hello-world 12345 --interval 10
Cancel a running workflow
取消正在运行的工作流
orbit -p myprofile gh run cancel octocat/hello-world 12345
orbit -p myprofile gh run cancel octocat/hello-world 12345
Re-run a workflow
重新运行工作流
orbit -p myprofile gh run rerun octocat/hello-world 12345
Run aliases: `run`, `actions` — so `orbit gh actions list octocat/hello-world` works too.
The `watch` command auto-discovers the most recent in-progress run if no run-id is given. It shows live job and step status with elapsed time, and exits with an error if the run fails.orbit -p myprofile gh run rerun octocat/hello-world 12345
运行记录的别名:`run`、`actions`——因此`orbit gh actions list octocat/hello-world`同样可用。
如果未指定run-id,`watch`命令会自动发现最近的进行中的运行记录。它会显示任务和步骤的实时状态及耗时,如果运行失败则会以错误状态退出。GitHub Actions Secrets
GitHub Actions密钥
bash
undefinedbash
undefinedList repository secrets
列出仓库密钥
orbit -p myprofile gh secret list octocat/hello-world
orbit -p myprofile gh secret list octocat/hello-world
Create or update a secret
创建或更新密钥
orbit -p myprofile gh secret set octocat/hello-world MY_SECRET "secret-value"
orbit -p myprofile gh secret set octocat/hello-world MY_SECRET "secret-value"
Delete a secret
删除密钥
orbit -p myprofile gh secret delete octocat/hello-world MY_SECRET
Secrets are encrypted client-side using the repository's public key before being sent to the API.orbit -p myprofile gh secret delete octocat/hello-world MY_SECRET
密钥在发送到API之前会通过仓库的公钥在客户端进行加密。Branches and Tags
分支与标签
bash
undefinedbash
undefinedList branches
列出分支
orbit -p myprofile gh branch list octocat/hello-world
orbit -p myprofile gh branch list octocat/hello-world
View branch details (includes latest commit)
查看分支详情(包含最新提交)
orbit -p myprofile gh branch view octocat/hello-world main
orbit -p myprofile gh branch view octocat/hello-world main
List tags
列出标签
orbit -p myprofile gh tag list octocat/hello-world
undefinedorbit -p myprofile gh tag list octocat/hello-world
undefinedCommits
提交记录
bash
undefinedbash
undefinedList recent commits (default branch)
列出最近的提交记录(默认分支)
orbit -p myprofile gh commit list octocat/hello-world
orbit -p myprofile gh commit list octocat/hello-world
List commits on a specific branch
列出指定分支的提交记录
orbit -p myprofile gh commit list octocat/hello-world --ref feature/login
orbit -p myprofile gh commit list octocat/hello-world --ref feature/login
View commit details
查看提交详情
orbit -p myprofile gh commit view octocat/hello-world abc1234
undefinedorbit -p myprofile gh commit view octocat/hello-world abc1234
undefinedIssues
议题
bash
undefinedbash
undefinedList open issues
列出开放的议题
orbit -p myprofile gh issue list octocat/hello-world --state open
orbit -p myprofile gh issue list octocat/hello-world --state open
Filter by labels
按标签筛选
orbit -p myprofile gh issue list octocat/hello-world --labels bug,urgent
orbit -p myprofile gh issue list octocat/hello-world --labels bug,urgent
View issue details
查看议题详情
orbit -p myprofile gh issue view octocat/hello-world 1
orbit -p myprofile gh issue view octocat/hello-world 1
Create an issue
创建议题
orbit -p myprofile gh issue create octocat/hello-world --title "Fix login bug" --labels bug,urgent
orbit -p myprofile gh issue create octocat/hello-world --title "Fix login bug" --labels bug,urgent
Close an issue
关闭议题
orbit -p myprofile gh issue close octocat/hello-world 1
orbit -p myprofile gh issue close octocat/hello-world 1
Add a comment to an issue
为议题添加评论
orbit -p myprofile gh issue comment octocat/hello-world 1 --body "Working on this"
undefinedorbit -p myprofile gh issue comment octocat/hello-world 1 --body "Working on this"
undefinedReleases
发布版本
bash
undefinedbash
undefinedList releases
列出发布版本
orbit -p myprofile gh release list octocat/hello-world
orbit -p myprofile gh release list octocat/hello-world
View a specific release
查看指定发布版本
orbit -p myprofile gh release view octocat/hello-world 12345
orbit -p myprofile gh release view octocat/hello-world 12345
View the latest release
查看最新发布版本
orbit -p myprofile gh release latest octocat/hello-world
undefinedorbit -p myprofile gh release latest octocat/hello-world
undefinedUsers
用户
bash
undefinedbash
undefinedShow current authenticated user
显示当前已认证用户
orbit -p myprofile gh user me
orbit -p myprofile gh user me
View a user profile
查看用户资料
orbit -p myprofile gh user view octocat
undefinedorbit -p myprofile gh user view octocat
undefinedCommon Patterns
常见用法
Get JSON for scripting:
Any command supports for machine-readable output:
-o jsonbash
orbit -p myprofile gh pr list octocat/hello-world -o json | jq '.[].title'Check CI status for a branch:
bash
orbit -p myprofile gh run list octocat/hello-world --branch main --limit 1Monitor a release pipeline:
bash
orbit -p myprofile gh run watch octocat/hello-worldSet a deployment secret:
bash
orbit -p myprofile gh secret set octocat/hello-world DEPLOY_TOKEN "ghp_xxxxx"Review a PR end-to-end:
bash
undefined获取JSON格式用于脚本编写:
任何命令都支持参数以输出机器可读的格式:
-o jsonbash
orbit -p myprofile gh pr list octocat/hello-world -o json | jq '.[].title'检查分支的CI状态:
bash
orbit -p myprofile gh run list octocat/hello-world --branch main --limit 1监控发布流水线:
bash
orbit -p myprofile gh run watch octocat/hello-world设置部署密钥:
bash
orbit -p myprofile gh secret set octocat/hello-world DEPLOY_TOKEN "ghp_xxxxx"完整审核PR:
bash
undefinedView PR details
查看PR详情
orbit -p myprofile gh pr view octocat/hello-world 42
orbit -p myprofile gh pr view octocat/hello-world 42
Check its workflow runs
检查其工作流运行记录
orbit -p myprofile gh run list octocat/hello-world --branch feature/login --limit 1
orbit -p myprofile gh run list octocat/hello-world --branch feature/login --limit 1
Read discussion
查看讨论内容
orbit -p myprofile gh pr comments octocat/hello-world 42
orbit -p myprofile gh pr comments octocat/hello-world 42
Approve with comment
添加评论并批准
orbit -p myprofile gh pr comment octocat/hello-world 42 --body "Approved, looks good"
undefinedorbit -p myprofile gh pr comment octocat/hello-world 42 --body "Approved, looks good"
undefinedImportant Notes
重要说明
- Profile required — Always pass to select the GitHub connection. The profile must have a service of type
-p <profile>configured.github - Service flag — If a profile has multiple GitHub services, use to disambiguate.
--service <name> - Cloud vs Enterprise — Works with both. For GitHub.com the base_url defaults to . For GitHub Enterprise, set the base_url in your profile config.
https://api.github.com - 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 - Pagination — Most list commands default to 20-50 results. Use to adjust.
--limit N
- 必须指定配置文件 —— 始终通过参数选择GitHub连接。配置文件必须配置有类型为
-p <profile>的服务。github - 服务参数 —— 如果一个配置文件包含多个GitHub服务,请使用参数来区分。
--service <name> - 公有云与企业版 —— 两者均支持。对于GitHub.com,base_url默认值为。对于GitHub Enterprise,请在配置文件中设置base_url。
https://api.github.com - 1Password集成 —— 配置文件中的认证令牌可使用格式,会在运行时解析。运行
op://vault/item/field一次即可解析并缓存所有密钥,有效期8小时(仅需一次生物识别验证)。使用orbit auth可清除缓存。orbit auth clear - 分页 —— 大多数列表命令默认返回20-50条结果。可使用参数调整数量。
--limit N