github

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

GitHub with orbit CLI

使用orbit CLI管理GitHub

Manage GitHub repositories, pull requests, issues, releases, branches, tags, commits, workflow runs, secrets, and users through the
orbit
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密钥解析功能。

Prerequisites

前置条件

  1. orbit
    binary built and accessible
  2. A profile with a
    github
    service configured in
    ~/.config/orbit/config.yaml
  3. Valid credentials (Personal Access Token) — can be stored in 1Password with
    op://
    prefix
  1. 已构建并可访问
    orbit
    二进制文件
  2. ~/.config/orbit/config.yaml
    中配置了带有
    github
    服务的配置文件
  3. 有效的凭据(个人访问令牌)——可使用
    op://
    前缀存储在1Password中

Quick Reference

快速参考

All commands follow the pattern:
orbit -p <profile> github <command> [flags]
Alias:
orbit -p <profile> gh <command> [flags]
All commands support
-o json
for JSON output. For full command details and all flags, see
references/commands.md
.
所有命令遵循以下格式:
orbit -p <profile> github <command> [flags]
别名:
orbit -p <profile> gh <command> [flags]
所有命令都支持
-o json
参数以输出JSON格式内容。有关完整的命令详情和所有参数,请参阅
references/commands.md

Repository Identification

仓库标识

Repositories are always referenced as
owner/repo
:
  • orbit -p myprofile gh repo octocat/hello-world
  • orbit -p myprofile gh repo kubernetes/kubernetes
仓库始终以
owner/repo
格式引用:
  • orbit -p myprofile gh repo octocat/hello-world
  • orbit -p myprofile gh repo kubernetes/kubernetes

Core Workflows

核心工作流

Exploring Repositories

浏览仓库

bash
undefined
bash
undefined

View 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
undefined
orbit -p myprofile gh repos --limit 10
undefined

Working with Pull Requests

处理拉取请求(PR)

bash
undefined
bash
undefined

List 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"
orbit -p myprofile gh pr create octocat/hello-world
--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
undefined
orbit -p myprofile gh pr comments octocat/hello-world 42
undefined

GitHub Actions Workflow Runs

GitHub Actions工作流运行

bash
undefined
bash
undefined

List 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
undefined
bash
undefined

List 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
undefined
bash
undefined

List 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
undefined
orbit -p myprofile gh tag list octocat/hello-world
undefined

Commits

提交记录

bash
undefined
bash
undefined

List 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
undefined
orbit -p myprofile gh commit view octocat/hello-world abc1234
undefined

Issues

议题

bash
undefined
bash
undefined

List 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"
undefined
orbit -p myprofile gh issue comment octocat/hello-world 1 --body "Working on this"
undefined

Releases

发布版本

bash
undefined
bash
undefined

List 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
undefined
orbit -p myprofile gh release latest octocat/hello-world
undefined

Users

用户

bash
undefined
bash
undefined

Show 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
undefined
orbit -p myprofile gh user view octocat
undefined

Common Patterns

常见用法

Get JSON for scripting: Any command supports
-o json
for machine-readable output:
bash
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 1
Monitor a release pipeline:
bash
orbit -p myprofile gh run watch octocat/hello-world
Set 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 json
参数以输出机器可读的格式:
bash
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
undefined

View 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"
undefined
orbit -p myprofile gh pr comment octocat/hello-world 42 --body "Approved, looks good"
undefined

Important Notes

重要说明

  • Profile required — Always pass
    -p <profile>
    to select the GitHub connection. The profile must have a service of type
    github
    configured.
  • Service flag — If a profile has multiple GitHub services, use
    --service <name>
    to disambiguate.
  • Cloud vs Enterprise — Works with both. For GitHub.com the base_url defaults to
    https://api.github.com
    . For GitHub Enterprise, set the base_url in your profile config.
  • 1Password integration — Auth tokens in config can use
    op://vault/item/field
    and are resolved at runtime. Run
    orbit auth
    once to resolve and cache all secrets for 8 hours (single biometric prompt). Use
    orbit auth clear
    to wipe the cache.
  • Pagination — Most list commands default to 20-50 results. Use
    --limit N
    to adjust.
  • 必须指定配置文件 —— 始终通过
    -p <profile>
    参数选择GitHub连接。配置文件必须配置有类型为
    github
    的服务。
  • 服务参数 —— 如果一个配置文件包含多个GitHub服务,请使用
    --service <name>
    参数来区分。
  • 公有云与企业版 —— 两者均支持。对于GitHub.com,base_url默认值为
    https://api.github.com
    。对于GitHub Enterprise,请在配置文件中设置base_url。
  • 1Password集成 —— 配置文件中的认证令牌可使用
    op://vault/item/field
    格式,会在运行时解析。运行
    orbit auth
    一次即可解析并缓存所有密钥,有效期8小时(仅需一次生物识别验证)。使用
    orbit auth clear
    可清除缓存。
  • 分页 —— 大多数列表命令默认返回20-50条结果。可使用
    --limit N
    参数调整数量。