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

# [NAME](#NAME)

gh-agent-task-view - View an agent task session (preview)

# [SYNOPSIS](#SYNOPSIS)

**gh agent-task view \[&lt;session-id&gt; | &lt;pr-number&gt; | &lt;pr-url&gt; | &lt;pr-branch&gt;] \[flags]**

# [DESCRIPTION](#DESCRIPTION)

View an agent task session.

# [OPTIONS](#OPTIONS)

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

Follow agent session logs

[**-q**, **--jq** **&lt;expression&gt;**](#q)

Filter JSON output using a jq expression

[**--json** **&lt;fields&gt;**](#json)

Output JSON with the specified fields

[**--log**](#log)

Show agent session logs

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

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

[**-t**, **--template** **&lt;string&gt;**](#t)

Format JSON output using a Go template; see "gh help formatting"

[**-w**, **--web**](#w)

Open agent task in the browser

# [JSON FIELDS](#JSON_FIELDS)

**completedAt**, **createdAt**, **id**, **name**, **pullRequestNumber**, **pullRequestState**, **pullRequestTitle**, **pullRequestUrl**, **repository**, **state**, **updatedAt**, **user**

# [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)

```
# View an agent task by session ID
$ gh agent-task view e2fa49d2-f164-4a56-ab99-498090b8fcdf
# View an agent task by pull request number in current repo
$ gh agent-task view 12345
# View an agent task by pull request number
$ gh agent-task view --repo OWNER/REPO 12345
# View an agent task by pull request reference
$ gh agent-task view OWNER/REPO#12345
# View a pull request agents tasks in the browser
$ gh agent-task view 12345 --web
```

# [SEE ALSO](#SEE_ALSO)

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

Sep 2026

---

Document: gh-agent-task-view(1) from gh 2.101.0-r1 (Chainguard OS)
Source: https://github.com/cli/cli
