# gh

> Official GitHub CLI tool for managing pull requests, issues, and repositories from the command line

Stars: 46.8k · Language: Go · License: MIT · Categories: Git

- Repository: https://github.com/cli/cli
- Website: https://cli.github.com
- Page: https://www.trmn.sh/tools/gh

## Install

- Homebrew: `brew install gh`
- WinGet: `winget install GitHub.cli`

## Overview

GitHub CLI (gh) is the official command-line interface for GitHub, allowing developers to interact with GitHub repositories, pull requests, issues, and other GitHub features directly from the terminal. The tool operates alongside git and integrates GitHub workflows into existing development environments without requiring a web browser.

The CLI supports comprehensive GitHub operations including creating and reviewing pull requests, managing issues, handling releases, and repository administration. It works with GitHub.com, GitHub Enterprise Cloud, and GitHub Enterprise Server 2.20+, providing cross-platform support for macOS, Windows, and Linux.

Unlike hub (the previous unofficial GitHub CLI), gh operates as a standalone tool rather than a git proxy, offering a fundamentally different architecture. The tool includes cryptographic verification of binaries through Build Provenance Attestation using Sigstore PKI, and comes pre-installed on GitHub-hosted Actions runners.

### Installation

```bash
# via Homebrew
brew install gh
```

```bash
# via WinGet
winget install GitHub.cli
```

![gh pr status command output](https://media.trmn.sh/cached/abf3ad2cef10cfd70c20ea667750dda0239a0d7d5106bdd60e0c2bfbe6fe2e1f.png)

## Alternatives

- [gitleaks](https://www.trmn.sh/tools/gitleaks.md): Detects secrets like passwords, API keys, and tokens in git repositories, files, and stdin input (Go, 30.6k stars)
- [git-lfs](https://www.trmn.sh/tools/git-lfs.md): Git extension for managing large files by storing them outside the repository with pointer files (Go, 14.6k stars)
- [gh-dash](https://www.trmn.sh/tools/gh-dash.md): Terminal UI for GitHub that lists configurable pull request and issue sections, with vim-style hotkeys, custom actions, and a YAML config file. (Go, 12.7k stars)
- [lazygit](https://www.trmn.sh/tools/lazygit.md): Terminal UI for git commands with visual interface for staging, committing, branching, and repository management (Go, 83.6k stars)
- [soft-serve](https://www.trmn.sh/tools/soft-serve.md): Self-hostable Git server with SSH-accessible TUI for command-line repository management and browsing. (Go, 7.3k stars)

## Guides

- [Best CLI Tools for Working on GitHub Actions](https://www.trmn.sh/best/github-actions-development-tools): Compare act, zizmor, gh: workflows, strengths and tradeoffs.

---

Canonical: https://www.trmn.sh/tools/gh
