| name | gh-2-92-0 |
| description | GitHub CLI v2.92.0 for managing repositories, pull requests, issues, releases, workflows, codespaces, and more from the terminal. Use when automating GitHub workflows, scripting API calls, managing PRs/issues/releases from the command line, or integrating GitHub into CI/CD pipelines. |
GitHub CLI v2.92.0
Overview
gh is GitHub's official command-line tool that brings pull requests, issues, releases, workflows, codespaces, and other GitHub concepts to the terminal. It is a standalone tool (not a git proxy) written in Go, supporting macOS, Windows, and Linux. Version 2.92.0 adds GHEC support for the skill commandset and --allow-hidden-dirs flag for skill preview.
Supported platforms: GitHub.com, GitHub Enterprise Cloud, and GitHub Enterprise Server 2.20+.
When to Use
- Managing pull requests from the terminal (create, review, merge, checkout)
- Creating, listing, editing, and closing issues without leaving the shell
- Automating GitHub Actions workflows and run management
- Scripting GitHub API calls with
gh api for custom automation
- Managing releases, secrets, variables, and repository settings from CLI
- Working with GitHub Codespaces (create, manage, SSH, ports)
- Installing and managing AI agent skills via
gh skill
- Authenticating to GitHub.com or GitHub Enterprise Server
- Searching across code, issues, PRs, commits, and repositories
Installation / Setup
macOS
brew install gh
Linux & Unix
Windows
winget install GitHub.cli
GitHub Codespaces
Add to your devcontainer configuration:
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {}
}
GitHub Actions
GitHub-hosted runners have gh pre-installed and updated weekly. For a specific version, install it using the platform-specific instructions above.
Build from Source
See the install_source.md in the cli/cli repository for building from source.
Binary Verification
Since v2.50.0, gh produces Build Provenance Attestation via Sigstore:
gh attestation verify -R cli/cli gh_2.92.0_macOS_arm64.zip
gh attestation verify -R cli/cli gh_2.92.0_macOS_arm64.zip
Core Concepts
Authentication: gh authenticates via OAuth device flow or personal access tokens. Use gh auth login to begin interactive setup, or gh auth login --with-token for non-interactive token-based authentication.
Repository Context: Commands operate on the current repository by default (detected from git remote). Override with -R OWNER/REPO or set GH_REPO.
Output Formatting: All list/view commands support --json for structured output, --jq for filtering with jq syntax, and --template for Go template rendering.
Aliases: Create shortcuts for frequently used command combinations with gh alias set.
Extensions: Extend gh with community or custom extensions installed via gh extension install.
Skills (v2.92): Install AI agent skills from GitHub repositories using gh skill install, supporting multiple agent hosts (Claude Code, pi, Codex, etc.), hidden directory discovery (--allow-hidden-dirs), and GHEC hosts with data residency.
Usage Examples
Pull Requests
gh pr list
gh pr create
gh pr create --title "Fix bug" --body "Fixed the login issue"
gh pr create --reviewer monalisa,hubot
gh pr create --fill
gh pr checkout 321
gh pr status
gh pr checks
gh pr merge 123 --delete-branch
gh pr review 123 --comment --body "Looks good!"
Issues
gh issue list
gh issue create --label bug
gh issue view 123
gh issue close 123
gh issue comment 123 --body "Working on this"
Repositories
gh repo create my-project --private --source=.
gh repo clone cli/cli
gh repo view
gh repo fork cli/cli
gh repo archive owner/repo
gh repo unarchive owner/repo
GitHub Actions
gh run list
gh run view 12345
gh run watch 12345
gh run download 12345
gh run rerun 12345 --job build
gh workflow list
gh workflow disable ci.yml
gh workflow enable ci.yml
API Access
gh api repos/{owner}/{repo}/releases
gh api repos/{owner}/{repo}/issues/123/comments -f body='Hi from CLI'
gh api repos/{owner}/{repo}/issues --jq '.[].title'
gh api graphql -f query='
query {
viewer {
repositories(first: 10) {
nodes { nameWithOwner }
}
}
}
'
gh api graphql --paginate -f query='
query($endCursor: String) {
viewer {
repositories(first: 100, after: $endCursor) {
nodes { nameWithOwner }
pageInfo { hasNextPage endCursor }
}
}
}
'
Skills (v2.92)
gh skill search terraform
gh skill install github/awesome-copilot
gh skill install github/awesome-copilot git-commit
gh skill install github/awesome-copilot git-commit@v1.2.0
gh skill install ./my-skills --from-local
gh skill install github/awesome-copilot git-commit --agent claude-code --scope user
gh skill install owner/repo --allow-hidden-dirs
gh skill update --all
gh skill preview github/awesome-copilot git-commit
gh skill preview github/awesome-copilot git-commit --allow-hidden-dirs
Aliases
gh alias set bugs 'issue list --label="bug"'
gh alias list
gh alias import aliases.json
gh alias delete bugs
Advanced Topics
Authentication and Enterprise: OAuth flows, token management, GitHub Enterprise Server setup, SSH key integration → Authentication
Output Formatting: JSON output, jq filtering, Go templates, helper functions (tablerow, timeago, hyperlink) → Output Formatting
Extensions and Skills: Extension system architecture, creating extensions, skill installation across agent hosts → Extensions and Skills
GitHub Actions Automation: Workflow management, run control, secrets, variables, cache operations → GitHub Actions
Codespaces Management: Creating, managing, SSH access, port forwarding, Jupyter integration → Codespaces
Search and API: Full-text search across code/issues/PRs/repos, REST and GraphQL API patterns → Search and API
Configuration and Environment: Config keys, environment variables, shell completion, telemetry → Configuration