>_ ghcli.com
ghcli / Issues / gh issue create

gh issue create

File an issue without the browser

gh issue create opens a new issue in the current repository from your terminal. Provide the title and body up front, attach labels and assignees, or run it interactively and let gh walk you through your repository's issue templates.

Quick answer
gh issue create --title "Bug: crash on startup" --body "Steps to reproduce..."

Syntax

gh issue create [flags]

Examples

Interactive create with templates

gh issue create

Set title and body directly

gh issue create --title "Crash on startup" --body "Steps: ..."

Assign to yourself and label it

gh issue create --title "Docs typo" --assignee @me --label docs

Read the body from a file

gh issue create --title "RFC" --body-file rfc.md

Finish creating it in the browser

gh issue create --web

Options & flags

FlagWhat it does
-t, --titleIssue title.
-b, --bodyIssue body text.
-F, --body-fileRead the body from a file (- for stdin).
-a, --assigneeAssign people. Use @me for yourself.
-l, --labelAdd labels by name.
-m, --milestoneAdd the issue to a milestone.
-p, --projectAdd the issue to a project.
-T, --templateUse a specific issue template.
-w, --webContinue in the browser.

How to use gh issue create, step by step

  1. Run gh issue create inside the repository.
  2. Choose an issue template if the repo has them.
  3. Fill in the title and body, or pass them as flags.
  4. gh prints the new issue URL when it's created.

Common errors and fixes

could not determine base repo

Run inside a cloned repo, or pass --repo owner/name.

GraphQL: Issues are disabled for this repository

The repo has issues turned off in its settings. Enable Issues under the repository's Features, or file it elsewhere.

Related commands

Frequently asked questions

How do I create a GitHub issue from the command line?

Run gh issue create inside the repository. Pass --title and --body to set it directly, or answer the prompts to pick a template and write the issue interactively.

Can I assign labels and people when creating an issue?

Yes. Use --label and --assignee, e.g. gh issue create --title "Bug" --label bug --assignee @me. @me assigns it to you.

How do I write the issue body from a file?

Use --body-file: gh issue create --title "RFC" --body-file rfc.md. Pass - to read the body from standard input.