GH-AGENT-TASK-CREATE(1) GitHub CLI manual GH-AGENT-TASK-CREATE(1)

# [NAME](#NAME)

gh-agent-task-create - Create an agent task (preview)

# [SYNOPSIS](#SYNOPSIS)

**gh agent-task create \[&lt;task description&gt;] \[flags]**

# [OPTIONS](#OPTIONS)

[**-b**, **--base** **&lt;string&gt;**](#b)

Base branch for the pull request (use default branch if not provided)

[**-a**, **--custom-agent** **&lt;string&gt;**](#a)

Use a custom agent for the task. e.g., use 'my-agent' for the 'my-agent.md' agent

[**--follow**](#follow)

Follow agent session logs

[**-F**, **--from-file** **&lt;file&gt;**](#F)

Read task description from file (use "-" to read from standard input)

[**-R**, **--repo** **&lt;\[HOST/\]OWNER/REPO&gt;**](#R)

Select another repository using the \[HOST/]OWNER/REPO format

# [EXIT CODES](#EXIT_CODES)

0: Successful execution

1: Error

2: Command canceled

4: Authentication required

NOTE: Specific commands may have additional exit codes. Refer to the command's help for more information.

# [EXAMPLE](#EXAMPLE)

```
# Create a task from an inline description
$ gh agent-task create "build me a new app"
# Create a task from an inline description and follow logs
$ gh agent-task create "build me a new app" --follow
# Create a task from a file
$ gh agent-task create -F task-desc.md
# Create a task with problem statement from stdin
$ echo "build me a new app" | gh agent-task create -F -
# Create a task with an editor
$ gh agent-task create
# Create a task with an editor and a file as a template
$ gh agent-task create -F task-desc.md
# Select a different base branch for the PR
$ gh agent-task create "fix errors" --base branch
# Create a task using the custom agent defined in '.github/agents/my-agent.md'
$ gh agent-task create "build me a new app" --custom-agent my-agent
```

# [SEE ALSO](#SEE_ALSO)

[**gh-agent-task(1)**](/man/os/gh/gh-agent-task.1)

Oct 2026

---

Document: gh-agent-task-create(1) from gh 2.103.2-r0 (Chainguard OS)
Source: https://github.com/cli/cli
