How to create an issue in GitHub from the command line (without using the GitHub GUI or any apps)

Devin Schumacher
1 min readOct 6, 2024

--

The basic syntax:

gh issue create [flags]

Running gh issue create without flags will open an interactive prompt.

Or you can run it without the interactive prompt by providing the flags.

Common flags:

  • --title or -t: Set the issue title
  • --body or -b: Set the issue body
  • --label or -l: Add labels
  • --assignee or -a: Assign users

Example:

gh issue create --title "Bug: Login form not responsive" --body "The login form doesn't adjust properly on mobile devices" --label bug --assignee username

Creating issue in devinschumacher/repo

https://github.com/devinschumacher/repo/issues/1

Multiple labels and assignees:

To create an issue with multiple labels or assignees, repeat the flag:

gh issue create --title "feature: Dark mode" --body "Implement a dark mode option" --label enhancement --label ui --assignee dev1 --assignee dev2

Advanced usage:

  1. Create issue and add to project:
gh issue create - project "Q2 Roadmap"

2. Create issue with milestone:

gh issue create --milestone "v1.0"

3. Create issue and open in browser:

gh issue create --web

--

--