title | tags |
---|---|
How to create an issue in GitHub from the command line |
git, github |
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
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
-
Create issue and add to project:
gh issue create --project "Q2 Roadmap"
-
Create issue with milestone:
gh issue create --milestone "v1.0"
-
Create issue and open in browser:
gh issue create --web
Remember to run gh auth login
if you haven't authenticated the GitHub CLI yet.