gh_pr_view

Check GitHub PR state and merge data across repositories via gh CLI JSON output.

1|Updated Oct 19, 2025
One-click install
npx skills add https://github.com/acartine/osterman --skill gh-pr-view
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gh_pr_view
Source: https://github.com/acartine/osterman/tree/main/skills/gh_pr_view
Command: npx skills add https://github.com/acartine/osterman --skill gh-pr-view

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

View PR state and merge data across repositories using the GitHub CLI, enabling automated monitoring and decision-making in CI/CD pipelines.

Core Features & Use Cases

  • Retrieve PR state (OPEN, CLOSED, MERGED) along with mergedAt and mergedBy in a structured JSON format for easy consumption by automation workflows.
  • Works across multiple repositories to provide consistent PR visibility in large projects and organizations.
  • Use cases include status checks in CI pipelines, dashboards, and alerting when PRs reach MERGED or need attention based on their state.

Quick Start

Use gh pr view <pr_number> --json state,mergedAt,mergedBy to fetch the PR state and merged data for integration.

Frequently Asked Questions about gh_pr_view

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check the state of a pull request using the GitHub CLI?

To check pull request state, use the GitHub CLI to fetch the OPEN, CLOSED, or MERGED status along with mergedAt and mergedBy data. The command outputs structured JSON, making it easy to consume in automated workflows and CI/CD pipelines.

Can I retrieve mergedAt and mergedBy data for a GitHub pull request in JSON format?

Yes, you can retrieve mergedAt and mergedBy data in structured JSON format by running the gh pr view command. This provides specific merge details for integration into dashboards, alerting systems, or automated monitoring.

Do I need the gh CLI installed to check PR state across multiple repositories?

Yes, the gh CLI is required to check PR state across multiple repositories. It provides consistent PR visibility across large projects and organizations, enabling automated monitoring and decision-making in CI/CD pipelines.

What happens if I query a missing pull request or encounter permission issues with gh CLI?

When querying a missing pull request or facing permission issues, the gh CLI gracefully handles these common errors. Instead of crashing, it manages the exceptions so your automated workflow or CI pipeline can continue executing smoothly.

How does viewing PR state in structured JSON help with CI/CD pipelines?

Viewing PR state in structured JSON helps CI/CD pipelines by enabling automated monitoring and decision-making. You can trigger status checks, generate dashboards, or set up alerting when pull requests reach the MERGED state or need attention.