LinuxCommandLibrary

gh-issue-create

Create new GitHub issues

TLDR

Create a new issue against the current repository interactively

$ gh issue [[new|create]]
copy

Create a new issue with the bug label interactively
$ gh issue [[new|create]] [[-l|--label]] "bug"
copy

Create a new issue interactively and assign it to the specified users
$ gh issue [[new|create]] [[-a|--assignee]] [user1,user2,...]
copy

Create a new issue with a title and body, and assign it to the current user
$ gh issue [[new|create]] [[-t|--title]] "[title]" [[-b|--body]] "[body]" [[-a|--assignee]] "@me"
copy

Create a new issue interactively, reading the body text from a file
$ gh issue [[new|create]] [[-F|--body-file]] [path/to/file]
copy

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

Display help
$ gh issue [[new|create]] [[-h|--help]]
copy

SYNOPSIS

gh issue create [flags]

PARAMETERS

--assignee LOGINS
    Assign to users (repeatable)

--body FILE
    Body from file (use - for stdin)

--body string
    Inline body text

--label LABELS
    Add labels (repeatable)

--limit int
    Max suggestions (default 100)

--milestone NUMBER,TITLE
    Add milestone by number or title

--project PROJECT
    Add project by ID or URL

--repo [HOST/]OWNER/REPO
    Target repository

--title TITLE
    Issue title

--web
    Open browser for interactive creation

DESCRIPTION

The gh issue create command, part of the official GitHub CLI (gh), enables users to create new issues in GitHub repositories directly from the terminal. It integrates seamlessly with Git workflows, detecting the current repository or allowing specification of another via --repo.

In interactive mode (default without flags), it prompts for a title and opens the user's default editor (e.g., Vim, Nano) for the body. If the repository has configured issue templates, it offers a selection menu. This makes it ideal for quick issue reporting during development.

Non-interactive use supports flags for title, body (from file, stdin with -, or inline string), assignees, labels, milestones, and projects. Use --web to launch a browser for creation instead. The command fetches valid options like labels and milestones dynamically from the repo.

Requires prior authentication with gh auth login and appropriate repository permissions (write access). Supports automation in CI/CD pipelines or scripts. Enhances productivity by avoiding browser context-switching. Alias: ic.

CAVEATS

Requires gh auth login and repo write access. Interactive prompts fail in non-TTY environments. Body editor respects GIT_EDITOR or EDITOR.

EXAMPLES

gh issue create --title "Fix bug" --body "Steps to reproduce:
1. ..."

gh issue create --body bug-report.md --label bug
echo 'Details' | gh issue create --title 'Issue' --body -

HISTORY

Introduced in GitHub CLI v0.5.0 (Feb 2020). Evolved with template support in v1.0+ and dynamic suggestions in later releases.

SEE ALSO

gh issue(1), gh pr create(1), git(1)

Copied to clipboard