Skip to content

Commit 1942ee9

Browse files
timrogersBagToadfelicitymay
authored
[2025-09-25] Document gh agent-task in the Copilot coding agent docs (#57677)
Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com> Co-authored-by: Felicity Chapman <felicitymay@github.com>
1 parent e07b5d4 commit 1942ee9

File tree

2 files changed

+36
-3
lines changed

2 files changed

+36
-3
lines changed

content/copilot/how-tos/use-copilot-agents/coding-agent/create-a-pr.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Asking GitHub Copilot to create a pull request
33
shortTitle: Create a PR
4-
intro: 'You can ask {% data variables.product.prodname_copilot_short %} to create a pull request from many places, including the agents panel, {% data variables.copilot.copilot_chat_short %}, and agentic coding tools and IDEs with Model Context Protocol (MCP) support.'
4+
intro: 'You can ask {% data variables.product.prodname_copilot_short %} to create a pull request from many places, including the agents panel, {% data variables.copilot.copilot_chat_short %}, the {% data variables.product.prodname_cli %}, and agentic coding tools and IDEs with Model Context Protocol (MCP) support.'
55
product: '{% data reusables.gated-features.copilot-coding-agent %}<br><a href="https://github.com/features/copilot/plans?ref_cta=Copilot+plans+signup&ref_loc=asking+copilot+to+create+a+pull+request&ref_page=docs" target="_blank" class="btn btn-primary mt-3 mr-3 no-underline"><span>Sign up for {% data variables.product.prodname_copilot_short %}</span> {% octicon "link-external" height:16 %}</a>'
66
versions:
77
feature: copilot
@@ -28,6 +28,7 @@ You can ask {% data variables.product.prodname_copilot_short %} to work on a tas
2828
* The agents panel, available across {% data variables.product.github %}
2929
* The agents page on {% data variables.product.github %}
3030
* {% data variables.copilot.copilot_chat_short %} in {% data variables.product.prodname_vscode %}, {% data variables.product.prodname_vs %}, JetBrains IDEs and {% data variables.product.prodname_dotcom_the_website %}
31+
* The {% data variables.product.prodname_cli %}
3132
* Your preferred IDE or agentic coding tool with Model Context Protocol (MCP) support
3233
* The Raycast launcher on macOS
3334

@@ -100,6 +101,25 @@ You can ask {% data variables.product.prodname_copilot_short %} to open a pull r
100101

101102
{% data variables.product.prodname_copilot_short %} will start a new session and respond with a link to the pull request it creates. It will work on the task and push changes to the pull request, and then add you as a reviewer when it has finished, triggering a notification.
102103

104+
## Asking {% data variables.product.prodname_copilot_short %} to create a pull request from the {% data variables.product.prodname_cli %}
105+
106+
> [!NOTE]
107+
> The `agent-task` command set is only available in v2.80.0 or later of the {% data variables.product.prodname_cli %}. This command set is a {% data variables.release-phases.public_preview %} and is subject to change.
108+
109+
You can start a new {% data variables.copilot.copilot_coding_agent %} session with the `gh agent-task create` command in the {% data variables.product.prodname_cli %}.
110+
111+
When you run the command without any arguments, you are asked to enter a prompt. {% data variables.copilot.copilot_coding_agent %} acts on the prompt and opens a pull request in the current repository.
112+
113+
You can use command line options to:
114+
115+
* Provide the prompt (`gh agent-task create "Example prompt"`)
116+
* Choose a base branch, instead of using the repository's default branch (`--base`)
117+
* Select a repository, instead of targeting the current repository (`--repo`)
118+
* Follow the session log in real time (`--log --follow`)
119+
120+
121+
To see all of the available options, run `gh agent-task create --help`.
122+
103123
## Asking {% data variables.product.prodname_copilot_short %} to create a pull request from the {% data variables.product.github %} MCP server
104124

105125
As an alternative to using {% data variables.copilot.copilot_chat_short %}, you can use the remote {% data variables.product.github %} MCP server to trigger {% data variables.copilot.copilot_coding_agent %} from any MCP host.

content/copilot/how-tos/use-copilot-agents/coding-agent/track-copilot-sessions.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Tracking GitHub Copilot's sessions
33
shortTitle: Track Copilot sessions
4-
intro: 'You can use the agents panel or page, {% data variables.product.prodname_vscode %}, Raycast and session logs to track {% data variables.product.prodname_copilot_short %}''s progress and understand its approach.'
4+
intro: 'You can use the agents panel or page, {% data variables.product.prodname_vscode %}, the {% data variables.product.prodname_cli %}, Raycast and session logs to track {% data variables.product.prodname_copilot_short %}''s progress and understand its approach.'
55
product: '{% data reusables.gated-features.copilot-coding-agent %}<br><a href="https://github.com/features/copilot/plans?ref_cta=Copilot+plans+signup&ref_loc=using+the+copilot+coding+agent+logs&ref_page=docs" target="_blank" class="btn btn-primary mt-3 mr-3 no-underline"><span>Sign up for {% data variables.product.prodname_copilot_short %}</span> {% octicon "link-external" height:16 %}</a>'
66
versions:
77
feature: copilot
@@ -24,7 +24,7 @@ contentType: how-tos
2424

2525
After you give {% data variables.product.prodname_copilot_short %} a task, it works autonomously in the background to complete it. See [AUTOTITLE](/copilot/concepts/about-copilot-coding-agent).
2626

27-
The agents panel, [agents page](https://github.com/copilot/agents), and {% data variables.product.prodname_copilot %} extension for Raycast provide an overview of your agent sessions across repositories. You can use them to kick off new tasks and track {% data variables.product.prodname_copilot_short %}'s progress.
27+
The agents panel, [agents page](https://github.com/copilot/agents), the {% data variables.product.prodname_cli %}, and {% data variables.product.prodname_copilot %} extension for Raycast provide an overview of your agent sessions across repositories. You can use them to kick off new tasks and track {% data variables.product.prodname_copilot_short %}'s progress.
2828

2929
You can also track {% data variables.product.prodname_copilot_short %}'s sessions in a specific repository from {% data variables.product.prodname_vscode %}.
3030

@@ -46,6 +46,19 @@ To view the session logs, click through to the pull request in the list, then fi
4646

4747
You can also start new agent sessions from the page and panel. See [AUTOTITLE](/copilot/how-tos/agents/copilot-coding-agent/asking-copilot-to-create-a-pull-request).
4848

49+
## Tracking agent sessions from the {% data variables.product.prodname_cli %}
50+
51+
> [!NOTE]
52+
> The `agent-task` command set is only available in v2.80.0 or later of the {% data variables.product.prodname_cli %}. This command set is a {% data variables.release-phases.public_preview %} and is subject to change.
53+
54+
You can see a list of your running and past agent sessions from the {% data variables.product.prodname_cli %} with the `gh agent-task list` command. The output will show a list of your recent sessions.
55+
56+
To see more information on a specific session, use the `gh agent-task view` command. For example, to view information about the session associated with pull request #123 in the `monalisa/bookstore` repository, run `gh agent-task view --repo monalisa/bookstore 123`.
57+
58+
To view the session logs, add the `--log` option. Optionally, use the `--follow` option to stream live logs as the agent works.
59+
60+
To see all of the available options, run `gh agent-task list --help` or `gh agent-task view --help`.
61+
4962
## Tracking agent sessions from Raycast
5063

5164
{% data reusables.copilot.coding-agent.raycast-intro %}

0 commit comments

Comments
 (0)