gh-issue
Manage GitHub issues from the command line
TLDR
Display a specific issue
Display a specific issue in the default web browser
Create a new issue in the default web browser
List the last 10 issues with the bug label
List closed issues made by a specific user
Display the status of issues relevant to the user, in a specific repository
Reopen a specific issue
SYNOPSIS
gh issue <command> [flags]
PARAMETERS
create
Creates a new issue. Common options include: --title <string> (issue title), --body <string> (issue body), --label <name> (add a label), --assignee <name> (assign an individual), --milestone <name> (associate with a milestone), --project <name> (add to a project).
list
Lists issues in a repository. Common filters include: --state <string> (e.g., 'open', 'closed', 'all'), --assignee <name>, --author <name>, --label <name>, --milestone <name>, --search <query>, and --limit <int> (number of issues to fetch).
view <number | URL>
Displays details of a specific issue. Use --web to open in a browser or --comments to show comments.
edit <number | URL>
Edits an existing issue. Options for modification are similar to create, including --title, --body, --add-label, --remove-label, --add-assignee, --remove-assignee, --milestone, and --project.
close <number | URL>
Closes an issue. An optional --reason <string> can be provided (e.g., 'completed', 'not planned').
reopen <number | URL>
Reopens a closed issue.
search <query>
Searches for issues across repositories matching a query. Supports filtering similar to list, including --state, --label, --assignee, --author, and --limit.
status
Shows a summary of open issues, assigned issues, and pull requests in the current repository, relevant to the authenticated user.
develop <number | URL>
Creates a development branch linked to an issue, streamlining the workflow for addressing issues with code.
--repo <owner/repo>
A global flag for gh commands that specifies the GitHub repository to operate on, overriding the current directory's inferred repository.
--help
Displays help information for the gh issue command or a specific subcommand.
DESCRIPTION
The gh issue command is a powerful subcommand of the GitHub CLI (gh) that enables users to interact with GitHub issues directly from their terminal.
It provides comprehensive functionalities to create, list, view, edit, close, reopen, and search issues across repositories. This streamlines issue management workflows for developers who prefer a command-line interface over a web browser.
To function, it requires prior authentication with GitHub via gh auth login and typically operates within the context of a Git repository, though a target repository can be specified using the --repo flag.
CAVEATS
The gh issue command is part of the GitHub CLI (gh) and requires it to be installed on your system. It also necessitates an active GitHub account and successful authentication via gh auth login. All operations require internet connectivity to communicate with GitHub's API.
INTERACTIVE PROMPTS
Many gh issue subcommands, particularly create and edit, offer intuitive interactive prompts if essential arguments or options are omitted. This guides users through the process and enhances usability.
CONTEXT AWARENESS
When executed within a cloned Git repository, gh issue automatically detects the current GitHub repository context. This eliminates the need to explicitly specify the repository for most commands, simplifying common workflows.
HISTORY
The GitHub CLI (gh), which includes the gh issue subcommand, was officially released by GitHub in 2020. Issue management was a fundamental feature from its inception, aiming to provide a seamless, native command-line experience for GitHub users, extending capabilities previously confined to the web interface or API. It continues to be actively developed and maintained by GitHub.