npx skills add https://github.com/odyssey4me/agent-skills --skill github此技能使用官方的 gh CLI 工具提供 GitHub 集成。一个 Python 包装脚本为读取/查看操作生成 Markdown 格式的输出。操作命令(创建、合并、关闭、评论)应直接使用 gh。
安装 gh CLI : 安装指南
# 使用 GitHub 进行身份验证
gh auth login
# 验证身份验证
gh auth status
详情请参阅 GitHub CLI 身份验证。
包装脚本 (scripts/github.py) 将输出格式化为 Markdown。将其用于读取/查看操作以获得代理可用的输出。对于操作命令(创建、合并、关闭、评论),请直接使用 gh。有关每个命令的读/写分类,请参阅 permissions.md。
# 检查 gh CLI 是否已安装并完成身份验证
$SKILL_DIR/scripts/github.py check
# 议题
$SKILL_DIR/scripts/github.py issues list --repo OWNER/REPO
$SKILL_DIR/scripts/github.py issues view 123 --repo OWNER/REPO
# 拉取请求
$SKILL_DIR/scripts/github.py prs list --repo OWNER/REPO
$SKILL_DIR/scripts/github.py prs view 456 --repo OWNER/REPO
$SKILL_DIR/scripts/github.py prs checks 456 --repo OWNER/REPO
$SKILL_DIR/scripts/github.py prs status --repo OWNER/REPO
# 工作流运行
$SKILL_DIR/scripts/github.py runs list --repo OWNER/REPO
$SKILL_DIR/scripts/github.py runs view 12345 --repo OWNER/REPO
# 仓库
$SKILL_DIR/scripts/github.py repos list
$SKILL_DIR/scripts/github.py repos view OWNER/REPO
# 搜索
$SKILL_DIR/scripts/github.py search repos "machine learning"
$SKILL_DIR/scripts/github.py search issues "label:bug is:open"
$SKILL_DIR/scripts/github.py search prs "is:open review:required"
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
所有列表命令都支持 --limit N(默认 30)。
对于操作命令,请直接使用 gh:
gh issue list # 列出议题
gh issue view 123 # 查看议题详情
gh issue create # 创建新议题
gh issue comment 123 # 添加评论
gh issue close 123 # 关闭议题
gh issue edit 123 --add-label bug # 编辑议题
完整参考:gh issue
gh pr list # 列出 PR
gh pr view 456 # 查看 PR 详情
gh pr create # 创建新 PR
gh pr review 456 --approve # 批准 PR
gh pr merge 456 --squash # 合并 PR
gh pr checkout 456 # 检出 PR 分支
gh pr diff 456 # 查看 PR 差异
gh pr checks 456 # 查看 CI 状态
完整参考:gh pr
gh workflow list # 列出工作流
gh workflow run "CI" # 触发工作流
gh run list # 列出工作流运行
gh run view 123456 # 查看运行详情
gh run watch 123456 # 监视运行进度
gh run download 123456 # 下载制品
gh run rerun 123456 --failed # 重新运行失败的作业
完整参考:
gh repo list # 列出仓库
gh repo view OWNER/REPO # 查看仓库
gh repo create # 创建仓库
gh repo clone OWNER/REPO # 克隆仓库
gh repo fork OWNER/REPO # 复刻仓库
完整参考:gh repo
gh search repos "machine learning" # 搜索仓库
gh search issues "is:open label:bug" # 搜索议题
gh search prs "is:open" # 搜索拉取请求
gh search code "function auth" # 搜索代码
完整参考:gh search
# 显示需要您关注的 PR
$SKILL_DIR/scripts/github.py prs status
# 审查特定 PR
$SKILL_DIR/scripts/github.py prs view 456
$SKILL_DIR/scripts/github.py prs checks 456
gh pr diff 456
gh pr review 456 --approve
# 验证批准是否已记录
$SKILL_DIR/scripts/github.py prs view 456 # 检查审查状态
# 创建议题
gh issue create --title "Bug: Login fails" --body "Description" --label bug
# 验证:记下输出中的议题编号
# 创建修复该问题的 PR(使用上面的议题编号)
gh pr create --title "Fix login bug (#123)" --body "Fixes #123"
# 验证 PR 已创建并关联
$SKILL_DIR/scripts/github.py prs view <number>
# 监视最新的工作流运行
gh run watch $(gh run list --limit 1 --json databaseId --jq '.[0].databaseId')
# 检查失败的运行
gh run list --status failure
# 重新运行失败的作业
gh run rerun RUNID --failed
# 验证重新运行已启动
$SKILL_DIR/scripts/github.py runs view RUNID
更多示例请参阅 common-workflows.md。
# 获取特定字段
gh issue list --json number,title,author
# 使用 jq 处理
gh pr list --json number,title | jq '.[] | "\(.number): \(.title)"'
# 导出到 CSV
gh issue list --json number,title,author | jq -r '.[] | @csv'
对于 gh 命令未涵盖的操作:
# 发出经过身份验证的 API 请求
gh api repos/OWNER/REPO/issues
# POST 请求
gh api repos/OWNER/REPO/issues -X POST -f title="Issue" -f body="Text"
# 处理响应
gh api repos/OWNER/REPO | jq '.stargazers_count'
完整参考:gh api
# 创建快捷方式
gh alias set prs 'pr list --author @me'
gh alias set issues 'issue list --assignee @me'
gh alias set review 'pr list --search "review-requested:@me"'
# 使用它们
gh prs
gh issues
gh review
# 查看配置
gh config list
# 设置默认编辑器
gh config set editor vim
# 设置 git 协议
gh config set git_protocol ssh
配置存储在 ~/.config/gh/config.yml
此技能包装了一个官方 CLI。一个快速、轻量级的模型就足够了。
# 检查身份验证
gh auth status
# 重新进行身份验证
gh auth login
# 启用调试日志
GH_DEBUG=1 gh issue list
# 检查 gh 版本
gh --version
GitHub 技能使用官方的 gh CLI,并通过 Python 包装脚本为读取/查看命令提供 Markdown 格式的输出。
快速开始:
brew install gh(或适用于您操作系统的等效命令)gh auth login$SKILL_DIR/scripts/github.py check$SKILL_DIR/scripts/github.py issues list --repo OWNER/REPOgh issue create、gh pr create 等(直接使用 gh)有关详细的命令参考,请使用 gh <command> --help 或访问 https://cli.github.com/manual/。
每周安装数
85
仓库
GitHub Stars
2
首次出现
2026年1月25日
安全审计
安装于
opencode76
cursor74
gemini-cli72
codex71
github-copilot68
cline67
This skill provides GitHub integration using the official gh CLI tool. A Python wrapper script produces markdown-formatted output for read/view operations. Action commands (create, merge, close, comment) should use gh directly.
Install gh CLI : installation guide
# Authenticate with GitHub
gh auth login
# Verify authentication
gh auth status
See GitHub CLI Authentication for details.
The wrapper script (scripts/github.py) formats output as markdown. Use it for read/view operations to get agent-consumable output. Use gh directly for action commands (create, merge, close, comment). See permissions.md for read/write classification of each command.
# Check gh CLI is installed and authenticated
$SKILL_DIR/scripts/github.py check
# Issues
$SKILL_DIR/scripts/github.py issues list --repo OWNER/REPO
$SKILL_DIR/scripts/github.py issues view 123 --repo OWNER/REPO
# Pull Requests
$SKILL_DIR/scripts/github.py prs list --repo OWNER/REPO
$SKILL_DIR/scripts/github.py prs view 456 --repo OWNER/REPO
$SKILL_DIR/scripts/github.py prs checks 456 --repo OWNER/REPO
$SKILL_DIR/scripts/github.py prs status --repo OWNER/REPO
# Workflow Runs
$SKILL_DIR/scripts/github.py runs list --repo OWNER/REPO
$SKILL_DIR/scripts/github.py runs view 12345 --repo OWNER/REPO
# Repositories
$SKILL_DIR/scripts/github.py repos list
$SKILL_DIR/scripts/github.py repos view OWNER/REPO
# Search
$SKILL_DIR/scripts/github.py search repos "machine learning"
$SKILL_DIR/scripts/github.py search issues "label:bug is:open"
$SKILL_DIR/scripts/github.py search prs "is:open review:required"
All commands support --limit N for list commands (default 30).
For action commands, use gh directly:
gh issue list # List issues
gh issue view 123 # View issue details
gh issue create # Create new issue
gh issue comment 123 # Add comment
gh issue close 123 # Close issue
gh issue edit 123 --add-label bug # Edit issue
Full reference: gh issue
gh pr list # List PRs
gh pr view 456 # View PR details
gh pr create # Create new PR
gh pr review 456 --approve # Approve PR
gh pr merge 456 --squash # Merge PR
gh pr checkout 456 # Checkout PR branch
gh pr diff 456 # View PR diff
gh pr checks 456 # View CI status
Full reference: gh pr
gh workflow list # List workflows
gh workflow run "CI" # Trigger workflow
gh run list # List workflow runs
gh run view 123456 # View run details
gh run watch 123456 # Watch run progress
gh run download 123456 # Download artifacts
gh run rerun 123456 --failed # Rerun failed jobs
Full references:
gh repo list # List repositories
gh repo view OWNER/REPO # View repository
gh repo create # Create repository
gh repo clone OWNER/REPO # Clone repository
gh repo fork OWNER/REPO # Fork repository
Full reference: gh repo
gh search repos "machine learning" # Search repositories
gh search issues "is:open label:bug" # Search issues
gh search prs "is:open" # Search pull requests
gh search code "function auth" # Search code
Full reference: gh search
# Show PRs needing your attention
$SKILL_DIR/scripts/github.py prs status
# Review a specific PR
$SKILL_DIR/scripts/github.py prs view 456
$SKILL_DIR/scripts/github.py prs checks 456
gh pr diff 456
gh pr review 456 --approve
# Verify approval was recorded
$SKILL_DIR/scripts/github.py prs view 456 # check review status
# Create issue
gh issue create --title "Bug: Login fails" --body "Description" --label bug
# Verify: note the issue number from output
# Create PR that fixes it (use issue number from above)
gh pr create --title "Fix login bug (#123)" --body "Fixes #123"
# Verify PR was created and linked
$SKILL_DIR/scripts/github.py prs view <number>
# Watch latest workflow run
gh run watch $(gh run list --limit 1 --json databaseId --jq '.[0].databaseId')
# Check failed runs
gh run list --status failure
# Rerun failed jobs
gh run rerun RUNID --failed
# Verify rerun started
$SKILL_DIR/scripts/github.py runs view RUNID
See common-workflows.md for more examples.
# Get specific fields
gh issue list --json number,title,author
# Process with jq
gh pr list --json number,title | jq '.[] | "\(.number): \(.title)"'
# Export to CSV
gh issue list --json number,title,author | jq -r '.[] | @csv'
For operations not covered by gh commands:
# Make authenticated API request
gh api repos/OWNER/REPO/issues
# POST request
gh api repos/OWNER/REPO/issues -X POST -f title="Issue" -f body="Text"
# Process response
gh api repos/OWNER/REPO | jq '.stargazers_count'
Full reference: gh api
# Create shortcuts
gh alias set prs 'pr list --author @me'
gh alias set issues 'issue list --assignee @me'
gh alias set review 'pr list --search "review-requested:@me"'
# Use them
gh prs
gh issues
gh review
# View configuration
gh config list
# Set default editor
gh config set editor vim
# Set git protocol
gh config set git_protocol ssh
Configuration stored in ~/.config/gh/config.yml
This skill wraps an official CLI. A fast, lightweight model is sufficient.
# Check authentication
gh auth status
# Re-authenticate
gh auth login
# Enable debug logging
GH_DEBUG=1 gh issue list
# Check gh version
gh --version
The GitHub skill uses the official gh CLI with a Python wrapper for markdown-formatted output on read/view commands.
Quick start:
brew install gh (or equivalent for your OS)gh auth login$SKILL_DIR/scripts/github.py check$SKILL_DIR/scripts/github.py issues list --repo OWNER/REPOgh issue create, gh pr create, etc. (use gh directly)For detailed command reference, use gh <command> --help or visit https://cli.github.com/manual/.
Weekly Installs
85
Repository
GitHub Stars
2
First Seen
Jan 25, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
opencode76
cursor74
gemini-cli72
codex71
github-copilot68
cline67
Azure 升级评估与自动化工具 - 轻松迁移 Functions 计划、托管层级和 SKU
104,900 周安装
Remotion视频制作技能:使用React生成高质量宣传片、教程和SNS短视频
132 周安装
阿里云媒体处理服务MPS自动化管理工具 - 支持管道、模板、工作流与任务操作
128 周安装
Swift专家 | iOS/macOS/visionOS原生开发与Swift 6并发性能优化
128 周安装
GitHub Actions CI/CD 流水线模式:自动化构建、测试与部署全指南
129 周安装
Vercel部署与构建指南:自动化构建流水线、预览部署、发布控制与即时回滚
129 周安装
阿里云CDN OpenAPI自动化操作指南 - 域名管理、缓存刷新、HTTPS证书配置
129 周安装