npx skills add https://github.com/oldwinter/skills --skill github-cli此技能提供使用 GitHub CLI (gh) 管理仓库、CI/CD 工作流、议题、拉取请求和发布的全面指导。
gh CLIgh auth status 以验证身份验证状态# 列出仓库
gh repo list [owner] --limit 50
gh repo list --source # 仅源仓库(非复刻)
gh repo list --fork # 仅复刻仓库
# 查看仓库
gh repo view [repo]
gh repo view --web # 在浏览器中打开
# 创建仓库
gh repo create <name> --public # 公开仓库
gh repo create <name> --private # 私有仓库
gh repo create <name> --clone # 创建并本地克隆
gh repo create <name> --template <repo> # 从模板创建
# 克隆仓库
gh repo clone <repo>
gh repo clone <repo> -- --depth 1 # 浅克隆
# 复刻仓库
gh repo fork <repo>
gh repo fork <repo> --clone # 复刻并克隆
# 删除仓库
gh repo delete <repo> --yes # 需要确认
# 归档/取消归档
gh repo archive <repo>
gh repo unarchive <repo>
# 编辑仓库设置
gh repo edit --default-branch main
gh repo edit --visibility public
gh repo edit --enable-issues=false
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
# 列出 PR
gh pr list
gh pr list --state all # 所有状态
gh pr list --author @me # 我的 PR
gh pr list --search "is:open draft:false"
# 查看 PR
gh pr view [number]
gh pr view --web # 在浏览器中打开
gh pr view --comments # 显示评论
# 创建 PR
gh pr create # 交互式
gh pr create --title "Title" --body "Description"
gh pr create --draft # 创建为草稿
gh pr create --base main --head feature # 指定分支
gh pr create --fill # 根据提交自动填充
# 评审 PR
gh pr review [number] --approve
gh pr review [number] --request-changes --body "Comments"
gh pr review [number] --comment --body "LGTM"
# 合并 PR
gh pr merge [number]
gh pr merge --merge # 合并提交
gh pr merge --squash # 压缩并合并
gh pr merge --rebase # 变基并合并
gh pr merge --auto # 启用自动合并
gh pr merge --delete-branch # 合并后删除分支
# 其他 PR 操作
gh pr checkout [number] # 本地检出 PR
gh pr ready [number] # 标记为准备评审
gh pr close [number]
gh pr reopen [number]
gh pr diff [number]
gh pr checks [number] # 查看 CI 状态
# 列出议题
gh issue list
gh issue list --state all
gh issue list --label "bug"
gh issue list --assignee @me
gh issue list --search "is:open label:urgent"
# 查看议题
gh issue view [number]
gh issue view --web
gh issue view --comments
# 创建议题
gh issue create # 交互式
gh issue create --title "Title" --body "Description"
gh issue create --label "bug,urgent"
gh issue create --assignee "@me,user2"
gh issue create --milestone "v1.0"
# 编辑议题
gh issue edit [number] --title "New title"
gh issue edit [number] --add-label "priority"
gh issue edit [number] --remove-label "wontfix"
gh issue edit [number] --add-assignee "user"
# 关闭/重新打开
gh issue close [number]
gh issue close [number] --reason "not planned"
gh issue reopen [number]
# 转移议题
gh issue transfer [number] <destination-repo>
# 置顶/取消置顶议题
gh issue pin [number]
gh issue unpin [number]
# 列出工作流
gh workflow list
gh workflow list --all # 包含已禁用的
# 查看工作流
gh workflow view [workflow-id|name]
gh workflow view --web
# 手动运行工作流
gh workflow run [workflow]
gh workflow run [workflow] --ref branch-name
gh workflow run [workflow] -f param1=value1 -f param2=value2
# 启用/禁用工作流
gh workflow enable [workflow]
gh workflow disable [workflow]
# 列出工作流运行
gh run list
gh run list --workflow [workflow]
gh run list --branch main
gh run list --status failure
gh run list --user @me
# 查看运行详情
gh run view [run-id]
gh run view --web
gh run view --log # 完整日志
gh run view --log-failed # 仅失败作业日志
# 监视运行进度
gh run watch [run-id]
# 重新运行工作流
gh run rerun [run-id]
gh run rerun [run-id] --failed # 仅失败的作业
gh run rerun [run-id] --debug # 启用调试日志记录
# 取消运行
gh run cancel [run-id]
# 下载制品
gh run download [run-id]
gh run download [run-id] -n artifact-name
# 列出发布
gh release list
gh release list --exclude-drafts
# 查看发布
gh release view [tag]
gh release view --web
# 创建发布
gh release create <tag> # 交互式
gh release create <tag> --title "Title" --notes "Notes"
gh release create <tag> --generate-notes # 自动生成说明
gh release create <tag> --draft # 创建为草稿
gh release create <tag> --prerelease # 标记为预发布
gh release create <tag> ./dist/* # 上传资源
# 编辑发布
gh release edit <tag> --title "New title"
gh release edit <tag> --draft=false # 发布草稿
# 删除发布
gh release delete <tag>
gh release delete <tag> --cleanup-tag # 同时删除标签
# 下载资源
gh release download <tag>
gh release download <tag> -p "*.zip" # 模式匹配
# 上传额外资源
gh release upload <tag> ./file.zip
# 列出 Gist
gh gist list
gh gist list --public
gh gist list --secret
# 查看 Gist
gh gist view [gist-id]
gh gist view --web
# 创建 Gist
gh gist create file.txt # 单个文件
gh gist create file1.txt file2.txt # 多个文件
gh gist create --public file.txt # 公开 Gist
gh gist create -d "Description" file.txt
# 编辑 Gist
gh gist edit [gist-id]
gh gist edit [gist-id] -a newfile.txt # 添加文件
# 删除 Gist
gh gist delete [gist-id]
# 克隆 Gist
gh gist clone [gist-id]
# GET 请求
gh api repos/{owner}/{repo}
gh api /user
gh api orgs/{org}/repos --paginate
# POST 请求
gh api repos/{owner}/{repo}/issues -f title="Bug" -f body="Description"
# 使用 JSON
gh api repos/{owner}/{repo}/labels --input data.json
# GraphQL
gh api graphql -f query='{ viewer { login } }'
# 输出格式化
gh api repos/{owner}/{repo} --jq '.name'
gh api repos/{owner}/{repo} -t '{{.name}}'
# 列出标签
gh label list
# 创建标签
gh label create "priority:high" --color FF0000 --description "High priority"
# 编辑标签
gh label edit "old-name" --name "new-name"
gh label edit "bug" --color 00FF00
# 删除标签
gh label delete "label-name"
# 从其他仓库克隆标签
gh label clone source-repo
# 列出 SSH 密钥
gh ssh-key list
# 添加 SSH 密钥
gh ssh-key add ~/.ssh/id_rsa.pub --title "My Key"
# 删除 SSH 密钥
gh ssh-key delete [key-id]
# 列出 GPG 密钥
gh gpg-key list
# 添加 GPG 密钥
gh gpg-key add key.gpg
# 关闭所有带有特定标签的议题
gh issue list --label "wontfix" --json number --jq '.[].number' | \
xargs -I {} gh issue close {}
# 删除所有草稿发布
gh release list --json tagName,isDraft --jq '.[] | select(.isDraft) | .tagName' | \
xargs -I {} gh release delete {} --yes
# 批准并合并所有 Dependabot PR
gh pr list --author "app/dependabot" --json number --jq '.[].number' | \
xargs -I {} sh -c 'gh pr review {} --approve && gh pr merge {} --squash'
# 获取特定字段
gh pr list --json number,title,author
gh issue list --json number,title,labels --jq '.[] | {num: .number, title: .title}'
# 使用 jq 过滤
gh pr list --json number,title,mergeable --jq '.[] | select(.mergeable == "MERGEABLE")'
# 显式指定仓库
gh pr list -R owner/repo
gh issue create -R owner/repo --title "Title"
gh workflow run -R owner/repo workflow.yml
# 检查身份验证
gh auth status
# 刷新身份验证
gh auth refresh
# 使用特定范围登录
gh auth login --scopes "repo,workflow,admin:org"
# 调试模式
GH_DEBUG=1 gh <command>
# 检查速率限制
gh api rate_limit
有关包含所有标志和选项的详细命令参考,请参阅 references/gh-commands.md。
每周安装量
102
仓库
GitHub 星标数
1
首次出现
2026年1月20日
安全审计
安装于
opencode86
gemini-cli83
codex79
cursor76
github-copilot73
amp66
This skill provides comprehensive guidance for using the GitHub CLI (gh) to manage repositories, CI/CD workflows, issues, pull requests, and releases.
gh CLI installed and authenticatedgh auth status to verify authentication# List repositories
gh repo list [owner] --limit 50
gh repo list --source # Only source repos (not forks)
gh repo list --fork # Only forks
# View repository
gh repo view [repo]
gh repo view --web # Open in browser
# Create repository
gh repo create <name> --public # Public repo
gh repo create <name> --private # Private repo
gh repo create <name> --clone # Create and clone locally
gh repo create <name> --template <repo> # From template
# Clone repository
gh repo clone <repo>
gh repo clone <repo> -- --depth 1 # Shallow clone
# Fork repository
gh repo fork <repo>
gh repo fork <repo> --clone # Fork and clone
# Delete repository
gh repo delete <repo> --yes # Requires confirmation
# Archive/Unarchive
gh repo archive <repo>
gh repo unarchive <repo>
# Edit repository settings
gh repo edit --default-branch main
gh repo edit --visibility public
gh repo edit --enable-issues=false
# List PRs
gh pr list
gh pr list --state all # All states
gh pr list --author @me # My PRs
gh pr list --search "is:open draft:false"
# View PR
gh pr view [number]
gh pr view --web # Open in browser
gh pr view --comments # Show comments
# Create PR
gh pr create # Interactive
gh pr create --title "Title" --body "Description"
gh pr create --draft # Create as draft
gh pr create --base main --head feature # Specify branches
gh pr create --fill # Auto-fill from commits
# Review PR
gh pr review [number] --approve
gh pr review [number] --request-changes --body "Comments"
gh pr review [number] --comment --body "LGTM"
# Merge PR
gh pr merge [number]
gh pr merge --merge # Merge commit
gh pr merge --squash # Squash and merge
gh pr merge --rebase # Rebase and merge
gh pr merge --auto # Enable auto-merge
gh pr merge --delete-branch # Delete branch after merge
# Other PR operations
gh pr checkout [number] # Checkout PR locally
gh pr ready [number] # Mark as ready for review
gh pr close [number]
gh pr reopen [number]
gh pr diff [number]
gh pr checks [number] # View CI status
# List issues
gh issue list
gh issue list --state all
gh issue list --label "bug"
gh issue list --assignee @me
gh issue list --search "is:open label:urgent"
# View issue
gh issue view [number]
gh issue view --web
gh issue view --comments
# Create issue
gh issue create # Interactive
gh issue create --title "Title" --body "Description"
gh issue create --label "bug,urgent"
gh issue create --assignee "@me,user2"
gh issue create --milestone "v1.0"
# Edit issue
gh issue edit [number] --title "New title"
gh issue edit [number] --add-label "priority"
gh issue edit [number] --remove-label "wontfix"
gh issue edit [number] --add-assignee "user"
# Close/Reopen
gh issue close [number]
gh issue close [number] --reason "not planned"
gh issue reopen [number]
# Transfer issue
gh issue transfer [number] <destination-repo>
# Pin/Unpin issue
gh issue pin [number]
gh issue unpin [number]
# List workflows
gh workflow list
gh workflow list --all # Include disabled
# View workflow
gh workflow view [workflow-id|name]
gh workflow view --web
# Run workflow manually
gh workflow run [workflow]
gh workflow run [workflow] --ref branch-name
gh workflow run [workflow] -f param1=value1 -f param2=value2
# Enable/Disable workflow
gh workflow enable [workflow]
gh workflow disable [workflow]
# List workflow runs
gh run list
gh run list --workflow [workflow]
gh run list --branch main
gh run list --status failure
gh run list --user @me
# View run details
gh run view [run-id]
gh run view --web
gh run view --log # Full logs
gh run view --log-failed # Only failed job logs
# Watch run in progress
gh run watch [run-id]
# Rerun workflow
gh run rerun [run-id]
gh run rerun [run-id] --failed # Only failed jobs
gh run rerun [run-id] --debug # With debug logging
# Cancel run
gh run cancel [run-id]
# Download artifacts
gh run download [run-id]
gh run download [run-id] -n artifact-name
# List releases
gh release list
gh release list --exclude-drafts
# View release
gh release view [tag]
gh release view --web
# Create release
gh release create <tag> # Interactive
gh release create <tag> --title "Title" --notes "Notes"
gh release create <tag> --generate-notes # Auto-generate notes
gh release create <tag> --draft # Create as draft
gh release create <tag> --prerelease # Mark as pre-release
gh release create <tag> ./dist/* # Upload assets
# Edit release
gh release edit <tag> --title "New title"
gh release edit <tag> --draft=false # Publish draft
# Delete release
gh release delete <tag>
gh release delete <tag> --cleanup-tag # Also delete tag
# Download assets
gh release download <tag>
gh release download <tag> -p "*.zip" # Pattern match
# Upload additional assets
gh release upload <tag> ./file.zip
# List gists
gh gist list
gh gist list --public
gh gist list --secret
# View gist
gh gist view [gist-id]
gh gist view --web
# Create gist
gh gist create file.txt # Single file
gh gist create file1.txt file2.txt # Multiple files
gh gist create --public file.txt # Public gist
gh gist create -d "Description" file.txt
# Edit gist
gh gist edit [gist-id]
gh gist edit [gist-id] -a newfile.txt # Add file
# Delete gist
gh gist delete [gist-id]
# Clone gist
gh gist clone [gist-id]
# GET request
gh api repos/{owner}/{repo}
gh api /user
gh api orgs/{org}/repos --paginate
# POST request
gh api repos/{owner}/{repo}/issues -f title="Bug" -f body="Description"
# With JSON
gh api repos/{owner}/{repo}/labels --input data.json
# GraphQL
gh api graphql -f query='{ viewer { login } }'
# Output formatting
gh api repos/{owner}/{repo} --jq '.name'
gh api repos/{owner}/{repo} -t '{{.name}}'
# List labels
gh label list
# Create label
gh label create "priority:high" --color FF0000 --description "High priority"
# Edit label
gh label edit "old-name" --name "new-name"
gh label edit "bug" --color 00FF00
# Delete label
gh label delete "label-name"
# Clone labels from another repo
gh label clone source-repo
# List SSH keys
gh ssh-key list
# Add SSH key
gh ssh-key add ~/.ssh/id_rsa.pub --title "My Key"
# Delete SSH key
gh ssh-key delete [key-id]
# List GPG keys
gh gpg-key list
# Add GPG key
gh gpg-key add key.gpg
# Close all issues with specific label
gh issue list --label "wontfix" --json number --jq '.[].number' | \
xargs -I {} gh issue close {}
# Delete all draft releases
gh release list --json tagName,isDraft --jq '.[] | select(.isDraft) | .tagName' | \
xargs -I {} gh release delete {} --yes
# Approve and merge all dependabot PRs
gh pr list --author "app/dependabot" --json number --jq '.[].number' | \
xargs -I {} sh -c 'gh pr review {} --approve && gh pr merge {} --squash'
# Get specific fields
gh pr list --json number,title,author
gh issue list --json number,title,labels --jq '.[] | {num: .number, title: .title}'
# Filter with jq
gh pr list --json number,title,mergeable --jq '.[] | select(.mergeable == "MERGEABLE")'
# Specify repository explicitly
gh pr list -R owner/repo
gh issue create -R owner/repo --title "Title"
gh workflow run -R owner/repo workflow.yml
# Check authentication
gh auth status
# Refresh authentication
gh auth refresh
# Login with specific scopes
gh auth login --scopes "repo,workflow,admin:org"
# Debug mode
GH_DEBUG=1 gh <command>
# Check rate limit
gh api rate_limit
For detailed command reference including all flags and options, see references/gh-commands.md.
Weekly Installs
102
Repository
GitHub Stars
1
First Seen
Jan 20, 2026
Security Audits
Gen Agent Trust HubWarnSocketPassSnykWarn
Installed on
opencode86
gemini-cli83
codex79
cursor76
github-copilot73
amp66
Azure 升级评估与自动化工具 - 轻松迁移 Functions 计划、托管层级和 SKU
96,200 周安装