github-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGitHub CLI (gh)
GitHub CLI (gh)
Use this skill when working with GitHub from the command line: repos, issues, PRs, Actions, projects, releases, gists, codespaces, search, secrets, and API. Content is based on gh 2.85.0 (January 2026).
当你需要通过命令行操作GitHub时使用本技能:包括仓库、议题、PR、Actions、项目、发布、Gist、代码空间、搜索、密钥及API。内容基于gh 2.85.0版本(2026年1月)。
Core References
核心参考内容
| Topic | Description | Reference |
|---|---|---|
| CLI Structure | Full command tree for discovery | core-cli-structure |
| Install & Verify | Install on macOS, Linux, Windows; verify | core-install |
| Auth & Config | Login, token, config, env vars, browse, global flags, JSON/template output | core-auth-config |
| Repos, Issues, PRs | Create/list/view/edit repo, issue, PR; merge, review, checkout | core-repo-issues-prs |
| Repo Extras | Autolinks, deploy keys, gitignore/license, rename, archive | core-repo-extras |
| Issue & PR Advanced | Status, pin, lock, transfer, delete, review types, merge options | core-issue-pr-advanced |
| 主题 | 描述 | 参考链接 |
|---|---|---|
| CLI结构 | 用于功能探索的完整命令树 | core-cli-structure |
| 安装与验证 | 在macOS、Linux、Windows系统上安装并验证 | core-install |
| 认证与配置 | 登录、令牌、配置、环境变量、浏览、全局标志、JSON/模板输出 | core-auth-config |
| 仓库、议题、拉取请求 | 创建/列出/查看/编辑仓库、议题、拉取请求;合并、评审、检出 | core-repo-issues-prs |
| 仓库扩展功能 | 自动链接、部署密钥、gitignore/许可证、重命名、归档 | core-repo-extras |
| 议题与拉取请求进阶操作 | 状态设置、固定、锁定、转移、删除、评审类型、合并选项 | core-issue-pr-advanced |
Features
功能特性
Actions & Secrets
Actions与密钥
| Topic | Description | Reference |
|---|---|---|
| Runs, Workflows, Cache | List/watch/rerun/delete runs, run workflows, manage caches | features-actions-secrets |
| Secrets & Variables | Repository, environment, org secrets/variables | features-actions-secrets |
| 主题 | 描述 | 参考链接 |
|---|---|---|
| 工作流运行、工作流、缓存 | 列出/监控/重新运行/删除工作流运行、触发工作流、管理缓存 | features-actions-secrets |
| 密钥与变量 | 仓库、环境、组织级别的密钥/变量 | features-actions-secrets |
Projects, Releases & More
项目、发布及更多功能
| Topic | Description | Reference |
|---|---|---|
| Projects | Fields, items, link/unlink, copy, mark-template | features-projects-releases-gists |
| Releases | Create, upload, download, verify, verify-asset | features-projects-releases-gists |
| Gists & Codespaces | Gist rename/multi-file; codespace cp, jupyter, logs, ports | features-projects-releases-gists |
| Orgs | List, view, JSON output | features-projects-releases-gists |
| Preview & Agent Tasks | gh preview, gh agent-task | features-preview-agent-task |
| Search, API, Misc | Search, labels, SSH/GPG keys, gh api, aliases, extensions, rulesets, attestation | features-search-api-misc |
| 主题 | 描述 | 参考链接 |
|---|---|---|
| 项目 | 字段、项目项、关联/取消关联、复制、标记为模板 | features-projects-releases-gists |
| 发布 | 创建、上传、下载、验证、验证资产 | features-projects-releases-gists |
| Gist与代码空间 | Gist重命名/多文件管理;代码空间复制、Jupyter、日志、端口管理 | features-projects-releases-gists |
| 组织 | 列出、查看、JSON输出 | features-projects-releases-gists |
| 预览功能与Agent任务 | gh preview、gh agent-task | features-preview-agent-task |
| 搜索、API及其他功能 | 搜索、标签、SSH/GPG密钥、gh api、别名、扩展、规则集、认证 | features-search-api-misc |
Best Practices
最佳实践
| Topic | Description | Reference |
|---|---|---|
| Environment Setup | Shell completion, aliases, git credential helper | best-practices-workflows |
| Workflows & Practices | Automation tips, bulk ops, repo setup, CI/CD, fork sync, help | best-practices-workflows |
| 主题 | 描述 | 参考链接 |
|---|---|---|
| 环境配置 | Shell补全、别名、Git凭据助手 | best-practices-workflows |
| 工作流与实践技巧 | 自动化技巧、批量操作、仓库配置、CI/CD、同步复刻、帮助信息 | best-practices-workflows |
Quick Tips
快速提示
- Use and
GH_TOKENfor non-interactive use.GH_REPO - Prefer +
--jsonfor scripting.--jq - Use to avoid repeating
gh repo set-default owner/repo.--repo
- 非交互式场景下使用和
GH_TOKEN。GH_REPO - 脚本编写时优先使用+
--json组合。--jq - 使用来避免重复输入
gh repo set-default owner/repo参数。--repo