github-cli

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

GitHub 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

核心参考内容

TopicDescriptionReference
CLI StructureFull command tree for discoverycore-cli-structure
Install & VerifyInstall on macOS, Linux, Windows; verifycore-install
Auth & ConfigLogin, token, config, env vars, browse, global flags, JSON/template outputcore-auth-config
Repos, Issues, PRsCreate/list/view/edit repo, issue, PR; merge, review, checkoutcore-repo-issues-prs
Repo ExtrasAutolinks, deploy keys, gitignore/license, rename, archivecore-repo-extras
Issue & PR AdvancedStatus, pin, lock, transfer, delete, review types, merge optionscore-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与密钥

TopicDescriptionReference
Runs, Workflows, CacheList/watch/rerun/delete runs, run workflows, manage cachesfeatures-actions-secrets
Secrets & VariablesRepository, environment, org secrets/variablesfeatures-actions-secrets
主题描述参考链接
工作流运行、工作流、缓存列出/监控/重新运行/删除工作流运行、触发工作流、管理缓存features-actions-secrets
密钥与变量仓库、环境、组织级别的密钥/变量features-actions-secrets

Projects, Releases & More

项目、发布及更多功能

TopicDescriptionReference
ProjectsFields, items, link/unlink, copy, mark-templatefeatures-projects-releases-gists
ReleasesCreate, upload, download, verify, verify-assetfeatures-projects-releases-gists
Gists & CodespacesGist rename/multi-file; codespace cp, jupyter, logs, portsfeatures-projects-releases-gists
OrgsList, view, JSON outputfeatures-projects-releases-gists
Preview & Agent Tasksgh preview, gh agent-taskfeatures-preview-agent-task
Search, API, MiscSearch, labels, SSH/GPG keys, gh api, aliases, extensions, rulesets, attestationfeatures-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-taskfeatures-preview-agent-task
搜索、API及其他功能搜索、标签、SSH/GPG密钥、gh api、别名、扩展、规则集、认证features-search-api-misc

Best Practices

最佳实践

TopicDescriptionReference
Environment SetupShell completion, aliases, git credential helperbest-practices-workflows
Workflows & PracticesAutomation tips, bulk ops, repo setup, CI/CD, fork sync, helpbest-practices-workflows
主题描述参考链接
环境配置Shell补全、别名、Git凭据助手best-practices-workflows
工作流与实践技巧自动化技巧、批量操作、仓库配置、CI/CD、同步复刻、帮助信息best-practices-workflows

Quick Tips

快速提示

  • Use
    GH_TOKEN
    and
    GH_REPO
    for non-interactive use.
  • Prefer
    --json
    +
    --jq
    for scripting.
  • Use
    gh repo set-default owner/repo
    to avoid repeating
    --repo
    .
  • 非交互式场景下使用
    GH_TOKEN
    GH_REPO
  • 脚本编写时优先使用
    --json
    +
    --jq
    组合。
  • 使用
    gh repo set-default owner/repo
    来避免重复输入
    --repo
    参数。