GH-AGENT-TASK-VIEW(1)

πŸ‘‘ gh-agent-task-view(1) β€” the GitHub CLI manual, bestie edition πŸ’…

okay so real talk: this is a page straight out of the GitHub CLI manual (yes, that GitHub CLI, the one you already have open in another tab), and it's about peeking at an agent task session. preview era ✨


✨ NAME ✨

gh-agent-task-view β€” view an agent task session (preview) 🫢

πŸ¦‹ SYNOPSIS πŸ¦‹

gh agent-task view [<session-id> | <pr-number> | <pr-url> | <pr-branch>]
[flags]

like, you give it something that points at a session β€” or honestly nothing at all, the brackets said optional β€” and then flags on top. iconic behavior.

🌸 DESCRIPTION 🌸

View an agent task session. that's it, that's the whole vibe. you look at the session, you see the session, you move on with your life πŸ’–

πŸ’… OPTIONS πŸ’…

  • --follow β€” follow the agent session logs, so you're just sitting there watching them scroll by like a livestream πŸ“
  • -q, --jq <expression> β€” filter the JSON output using a jq expression, because raw JSON is giving a lot and sometimes you just want the one field, iykyk
  • --json <fields> β€” output JSON with the specified fields (the field names are down in JSON FIELDS, keep scrolling bestie)
  • --log β€” show the agent session logs, one and done, no following required πŸ“œ
  • -R, --repo <[HOST/]OWNER/REPO> β€” select another repository using the [HOST/]OWNER/REPO format. note the [HOST/] part is optional, so it's either OWNER/REPO or HOST/OWNER/REPO πŸŽ€
  • -t, --template <string> β€” format the JSON output using a Go template; see gh help formatting for the lore πŸ“–
  • -w, --web β€” open the agent task in the browser. mouse girlies rise πŸ‘‘

πŸ”₯ JSON FIELDS πŸ”₯

these are the exact field names, no cap, copy them character for character:

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

that's twelve fields and we are obsessed with all twelve 😌

⭐ 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 β€” like, actually refer to it, don't guess πŸ’€

🌈 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 how it takes a raw session id, a PR number, a full OWNER/REPO#12345 reference, and then just yeets itself into the browser with --web? versatile queen πŸ’œ

🧚 SEE ALSO 🧚


later bestie 🌸 this was GitHub CLI v2.102.0, dated Oct 2026 β€” mwah πŸ’‹

πŸ“¦ where this page comes from