搜索

PythonReactSEOPDF
GitHub Skill

github-cli-operations

Use GitHub CLI (gh) to interact with GitHub repositories, pull requests, issues, and workflows. Use when: (1) Reading PR details, diffs, or metadata, (2) Listing or filtering PRs and issues, (3) Creating PR comments or linking to issues, (4) Checking CI status or mergeability, (5) Extracting issue references from PR descriptions, or (6) Any GitHub repository operation via command line. Requires GitHub CLI installed and authenticated.

lambda-curry☆ 3 仓库 Stars1 仓库 Forks

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

查看来源 ↗使用指南

技能说明

GitHub CLI Operations

Use GitHub CLI (gh) to interact with GitHub repositories, pull requests, issues, and workflows.

Prerequisites

  • GitHub CLI installed: brew install gh (macOS) or see cli.github.com
  • Authenticated: gh auth login (one-time setup)
  • Repository context: Run commands from within a git repository or specify --repo owner/repo

Quick Start

Get PR details:

gh pr view <pr-number> --json title,body,author,state

Get PR diff:

gh pr diff <pr-number>

Extract Linear issue references:

gh pr view <pr-number> --json body --jq '.body' | grep -oE 'LIN-[0-9]+'

Usage Patterns for PR Review

Get PR Context

Get PR title, description, and metadata:

gh pr view <pr-number> --json title,body,author,state,baseRefName,headRefName

Get changed files:

gh pr view <pr-number> --json files --jq '.files[].path'

Get diff for specific file:

gh pr diff <pr-number> -- path/to/file
Check PR Status

Check CI status:

gh pr checks <pr-number>

Check if PR is mergeable:

gh pr view <pr-number> --json mergeable,mergeStateStatus
Link to Linear Issues

Extract issue references from PR body:

gh pr view <pr-number> --json body --jq '.body' | grep -oE 'LIN-[0-9]+'

Integration with Linear

When reviewing PRs, extract Linear issue references from:

  • PR title: Look for LIN-123 or [LIN-123] patterns
  • PR body: Search for Linear issue links or IDs
  • PR comments: Check for issue mentions

Then use Linear MCP functions to fetch issue details and requirements.

Reference Documentation

使用示例

查看来源仓库中的使用示例与配置说明。

查看来源 ↗

来源历史

收录时间
2026-01-20
索引更新时间
2026-01-26
Branch
main

收录与同步日期属于本站记录。源码修改历史请查看来源仓库。

GitHub ↗

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!