LinuxCommandLibrary

gh-issue

Manage GitHub issues from the command line

TLDR

Display a specific issue

$ gh issue view [issue_number]
copy

Display a specific issue in the default web browser
$ gh issue view [issue_number] [[-w|--web]]
copy

Create a new issue in the default web browser
$ gh issue [[new|create]] [[-w|--web]]
copy

List the last 10 issues with the bug label
$ gh issue [[ls|list]] [[-L|--limit]] 10 [[-l|--label]] "bug"
copy

List closed issues made by a specific user
$ gh issue [[ls|list]] [[-s|--state]] closed [[-A|--author]] [username]
copy

Display the status of issues relevant to the user, in a specific repository
$ gh issue status [[-R|--repo]] [owner]/[repository]
copy

Reopen a specific issue
$ gh issue reopen [issue_number]
copy

SYNOPSIS

gh issue <command> [-R, --repo] [flags]

PARAMETERS

-R, --repo [HOST/]OWNER/REPO
    Select another repository using the [HOST/]OWNER/REPO format

--help
    Show help for command

--version
    Show gh version

DESCRIPTION

gh issue is a subcommand of the GitHub CLI (gh) tool, designed to manage GitHub issues directly from the terminal on Linux and other platforms. It provides an efficient way to create, view, list, edit, and manipulate issues without leaving the command line, integrating seamlessly with Git workflows.

Key capabilities include interactive issue creation with gh issue create, filtering and listing issues via gh issue list (supports labels, assignees, milestones), detailed viewing with gh issue view, editing content or metadata using gh issue edit or gh issue update, reopening closed issues, locking/unlocking discussions, searching, pinning to README, and transferring between repositories. Output formats like table, CSV, or JSON enable scripting and automation in CI/CD pipelines.

The command infers the repository from the current Git directory but allows overriding with --repo. Requires prior authentication via gh auth login. By mirroring GitHub's web interface features, it boosts productivity for developers preferring terminal-based operations, reducing browser context switches. Regularly updated with GitHub CLI releases.

CAVEATS

Requires GitHub CLI (gh) installed (via package managers like apt/snap or binaries) and authenticated with gh auth login. Subcommands have additional flags; run gh issue <command> --help for details. Rate-limited by GitHub API.

SUBCOMMANDS

create: Create new issue
list: List matching issues
view: View issue details
edit: Edit issue interactively
update: Update issue fields
reopen: Reopen closed issue
search: Search issues
lock/unlock: Manage comments
transfer: Move to another repo

HISTORY

Part of GitHub CLI, first released in February 2020 (v0.5.0 introduced core issue commands). Developed by GitHub as a modern successor to hub, with ongoing updates aligning to GitHub platform changes.

SEE ALSO

gh(1), git(1)

Copied to clipboard