ワンクリックで
github-cli
"GitHub CLI (gh) 自动化操作。管理仓库、Issues、Pull Requests、Workflows、Releases 等。支持所有 gh 命令。"
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
"GitHub CLI (gh) 自动化操作。管理仓库、Issues、Pull Requests、Workflows、Releases 等。支持所有 gh 命令。"
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
"自动化论文检索、翻译、导入和学习闭环系统。每日从 arXiv 检索论文、自动翻译标题和摘要、导入 Zotero、生成 Obsidian 笔记和学习报告。"
"生成各种类型的图表和流程图:流程图、时序图、类图、甘特图、思维导图等。支持 Mermaid、PlantUML、Graphviz 等格式。"
"深度反思学习过程,巩固知识,发现盲点,优化学习策略。基于笔记内容生成反思报告、学习建议、知识图谱。"
"从 arXiv 自动检索论文、翻译标题摘要、导入 Zotero、生成 Obsidian 笔记。支持关键词检索、自动去重、中文翻译。"
"生成论文学习报告:每日总结、每周总结、月度报告、季度报告、年度总结。统计学习进度、分析研究方向、追踪知识积累。"
"深度阅读和分析 PDF 论文。支持 PDF 转 Markdown、智能摘要、关键信息提取、问答式学习、笔记生成。"
| name | GitHub CLI |
| description | "GitHub CLI (gh) 自动化操作。管理仓库、Issues、Pull Requests、Workflows、Releases 等。支持所有 gh 命令。" |
Use this skill when you want to:
Triggers:
创建一个名为 my-project 的 GitHub 仓库
克隆 username/repo 到本地
在 username/repo 创建一个 Issue: 添加登录功能
为 feature-branch 创建一个 PR
# 创建公开仓库
gh repo create my-project --public
# 创建私有仓库
gh repo create my-project --private
# 带描述创建
gh repo create my-project --description "My awesome project"
# 从模板创建
gh repo create my-project --template username/template-repo
Usage:
创建一个私有仓库,名称为 my-app
创建一个公开仓库,描述为 "A demo project"
# 克隆仓库
gh repo clone username/repo
# 克隆到指定目录
gh repo clone username/repo my-local-dir
Usage:
克隆 facebook/react
克隆 username/repo 到 D:\projects\repo
# 列出我的仓库
gh repo list
# 列出指定用户的仓库
gh repo list username
# 限制数量
gh repo list --limit 30
Usage:
列出我的所有仓库
列出 microsoft 的前 20 个仓库
# 查看仓库信息
gh repo view username/repo
# 在浏览器中打开
gh repo view username/repo --web
Usage:
查看 facebook/react 的信息
在浏览器中打开我的仓库
# 删除仓库(需要确认)
gh repo delete username/repo
Usage:
删除 my-old-project 仓库
# 创建 Issue
gh issue create --title "Bug in login" --body "Description here"
# 带标签创建
gh issue create --title "Feature request" --label "enhancement"
# 分配给某人
gh issue create --title "Task" --assignee username
Usage:
创建一个 Issue: 标题 "修复登录Bug",内容 "用户无法登录"
创建一个带 bug 标签的 Issue
# 列出所有 Issues
gh issue list
# 按状态过滤
gh issue list --state open
gh issue list --state closed
# 按标签过滤
gh issue list --label bug
# 按分配者过滤
gh issue list --assignee username
Usage:
列出所有未关闭的 Issues
列出所有带 bug 标签的 Issues
# 查看 Issue 详情
gh issue view 123
# 在浏览器中打开
gh issue view 123 --web
Usage:
查看 Issue #123 的详细信息
# 关闭 Issue
gh issue close 123
# 重新打开 Issue
gh issue reopen 123
Usage:
关闭 Issue #123
重新打开 Issue #456
# 创建 PR(自动检测当前分支)
gh pr create
# 指定标题和描述
gh pr create --title "Add feature X" --body "Description"
# 指定基础分支
gh pr create --base main
# 指定审查者
gh pr create --reviewer username
# 指定分配者
gh pr create --assignee username
# 指定标签
gh pr create --label "enhancement"
Usage:
为当前分支创建 PR
创建一个 PR,标题 "添加登录功能",审查者 @reviewer
# 列出所有 PRs
gh pr list
# 按状态过滤
gh pr list --state open
gh pr list --state closed
gh pr list --state merged
# 按作者过滤
gh pr list --author username
# 按标签过滤
gh pr list --label bug
Usage:
列出所有未合并的 PRs
列出我创建的所有 PRs
# 查看 PR 详情
gh pr view 123
# 在浏览器中打开
gh pr view 123 --web
# 查看 PR 的 checks
gh pr view 123 --checks
Usage:
查看 PR #123 的详细信息
查看 PR #123 的 CI 状态
# 批准 PR
gh pr review 123 --approve
# 请求修改
gh pr review 123 --request-changes
# 评论
gh pr review 123 --comment "Looks good!"
# 添加审查评论
gh pr review 123 --body "Please fix the typo"
Usage:
批准 PR #123
请求修改 PR #456
对 PR #789 添加评论
# 合并 PR
gh pr merge 123
# Squash 并合并
gh pr merge 123 --squash
# Rebase 并合并
gh pr merge 123 --rebase
# 自动删除分支
gh pr merge 123 --delete-branch
Usage:
合并 PR #123
Squash 并合并 PR #456,然后删除分支
# 列出所有 workflows
gh workflow list
Usage:
列出所有 GitHub Actions workflows
# 运行 workflow
gh workflow run workflow-name
# 带参数运行
gh workflow run workflow-name -f param1=value1
# 指定分支
gh workflow run workflow-name --ref branch-name
Usage:
运行 CI workflow
运行 deploy workflow,参数 environment=production
# 查看 workflow 运行状态
gh run view
# 查看特定运行
gh run view run-id
# 实时查看日志
gh run watch
Usage:
查看最新的 workflow 运行状态
实时查看当前运行的 workflow 日志
# 创建 release
gh release create v1.0.0
# 带标题和描述
gh release create v1.0.0 --title "Version 1.0.0" --notes "Release notes"
# 上传文件
gh release create v1.0.0 --title "v1.0.0" dist/*
# 从标签创建
gh release create v1.0.0 --target main
Usage:
创建 v1.0.0 release
创建 v2.0.0 release,标题 "Major Update",上传 build/ 目录
# 列出所有 releases
gh release list
Usage:
列出所有 releases
# 查看 release 详情
gh release view v1.0.0
# 在浏览器中打开
gh release view v1.0.0 --web
Usage:
查看 v1.0.0 release 的详细信息
# 设置 secret
gh secret set SECRET_NAME
# 从文件读取
gh secret set SECRET_NAME < secret.txt
# 从环境变量
gh secret set SECRET_NAME --body "$MY_SECRET"
Usage:
设置 API_KEY secret
设置 DATABASE_URL secret
# 列出所有 secrets
gh secret list
Usage:
列出所有 secrets
# 删除 secret
gh secret delete SECRET_NAME
Usage:
删除 OLD_API_KEY secret
# 从文件批量创建
while read title; do
gh issue create --title "$title" --body "Auto-created"
done < issues.txt
Usage:
批量创建 10 个 Issues
# 批量关闭
gh issue list --label "wontfix" --json number --jq '.[].number' | \
xargs -I {} gh issue close {}
Usage:
关闭所有带 wontfix 标签的 Issues
#!/bin/bash
# .git/hooks/post-push
branch=$(git rev-parse --abbrev-ref HEAD)
if [[ $branch == feature/* ]]; then
gh pr create --title "$branch" --body "Auto-created PR"
fi
# 生成日报
echo "## Daily Report - $(date)"
echo "### Issues Closed"
gh issue list --state closed --limit 10
echo "### PRs Merged"
gh pr list --state merged --limit 10
# 登录 GitHub
gh auth login
# 检查认证状态
gh auth status
# 刷新 token
gh auth refresh
# 在仓库目录下自动设置
cd /path/to/repo
# 或手动设置
gh repo set-default username/repo
# 设置默认编辑器
gh config set editor "code --wait"
Problem: gh: authentication required
Solution:
gh auth login
Problem: Could not resolve to a Repository
Solution: Check repository name and your access permissions
Problem: API rate limit exceeded
Solution: Wait or authenticate for higher limits
Problem: gh: command not found
Solution:
# Windows
winget install GitHub.cli
# macOS
brew install gh
# Linux
sudo apt install gh
git-operations - Git commandsci-cd - Continuous integrationcode-review - Code review automation