gh

Configure gh CLI with GITHUB_TOKEN and -R repository targeting.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/HyperDev1/hx-ai --skill gh-hyperdev1
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gh
Source: https://github.com/HyperDev1/hx-ai/tree/main/src/resources/skills/github-workflows/references/gh
Command: npx skills add https://github.com/HyperDev1/hx-ai --skill gh-hyperdev1

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires typer, PyGithub, and includes scripts (resource) and references (resource) components.

What problem does it solve?

AI agents often operate in environments where gh is not installed or properly authenticated. This Skill ensures gh is installed, authenticated via GITHUB_TOKEN, and that all commands explicitly target the correct repository with -R, enabling reliable GitHub automation.

Core Features & Use Cases

  • Install and configure gh with a consistent -R repository target for all commands.
  • Provide templates and examples for common workflows: PRs, issues, labels, milestones, and Projects V2.
  • Include reference scripts and docs to simplify setup in automation pipelines and Claude Code hooks.

Quick Start

Install gh, export GITHUB_TOKEN, and run the included scripts to begin performing repository operations with a consistent -R target.

Frequently Asked Questions about gh

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

FAQPage Schema
How do I automate GitHub issues and PRs in an environment where gh CLI is missing?

Automate GitHub issues and PRs in restricted environments by ensuring gh CLI is installed and authenticated via GITHUB_TOKEN. This Skill uses PyGithub and GraphQL alongside gh commands to enable robust automation for typical workflows like PRs and issues.

Do I need a GITHUB_TOKEN to use gh CLI for repository automation?

Yes, a GITHUB_TOKEN is required to authenticate gh CLI for repository automation. The token ensures all gh-based GitHub operations, including managing milestones, labels, and Projects V2, are correctly authenticated and can execute reliably.

How do I target a specific repository when running gh commands for automation?

Target a specific repository by enforcing the -R flag on all gh commands. This Skill ensures repository targeting with -R to explicitly scope operations like PRs, issues, and Projects V2 automation to the correct repository.

Can I manage GitHub Projects V2 using gh CLI and GraphQL?

Yes, you can manage GitHub Projects V2 using gh CLI, PyGithub, and GraphQL. This combination provides robust automation capabilities across typical workflows, handling Projects V2 alongside standard repository operations like labels and milestones.

What is the best way to configure gh for automated workflows in CI pipelines?

The best way to configure gh for automated workflows is to install gh, export GITHUB_TOKEN, and use reference scripts with consistent -R repository targeting. This ensures reliable GitHub automation across CI pipelines and restricted environments.

Why do my GitHub automation scripts fail in restricted environments?

GitHub automation scripts fail in restricted environments when gh is not installed or properly authenticated. This Skill solves the problem by ensuring gh is installed, authenticated via GITHUB_TOKEN, and targeting the correct repository with -R.