Remarque
- Copilot coding agent is in public preview and subject to change. During the preview, use of the feature is subject to GitHub Pre-release License Terms.
- For an overview of Copilot coding agent, see About Copilot coding agent.
Introduction
You can ask Copilot to work on a task from:
- The Agents page on GitHub
- Copilot Chat in Visual Studio Code, Visual Studio, JetBrains IDEs and GitHub.com
- Your preferred IDE or agentic coding tool with Model Context Protocol (MCP) support
Copilot will start working on the task, raise a pull request, then request a review from you when it's finished working. For more information, see About Copilot coding agent.
Asking Copilot to create a pull request from the Agents page
-
Navigate to the Agents page at github.com/copilot/agents.
You can also reach this page by clicking the button next to the search bar on any page on GitHub, then selecting Agents from the sidebar.
-
Using the dropdown menu in the prompt field, select the repository you want Copilot to work in.
-
Type a prompt describing your request.
For example,
Implement a user friendly message for common errors.
-
Click the Send now button or press Return.
Copilot will start a new session, which will appear in the list below the prompt box. Copilot will work on the task and push changes to its pull request, then add you as a reviewer when it has finished, triggering a notification.
Asking Copilot to create a pull request from Copilot Chat in Visual Studio Code
-
Install the GitHub Pull Requests extension for Visual Studio Code.
-
Open GitHub Copilot Chat in Visual Studio Code.
-
Type a prompt explaining what you want Copilot to do, and add
#copilotCodingAgent
to the prompt.For example,
Put backticks around file names and variables in output #copilotCodingAgent
Conseil
- To help Copilot, you can select the relevant line(s) of code before submitting your prompt.
-
Submit your prompt.
Copilot will typically do some research and context-gathering in Visual Studio Code, and then will ask you to confirm that you want to use the coding agent to create a pull request.
-
Click Continue.
Copilot will push up any local changes, 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.
Asking Copilot to create a pull request from Copilot Chat in other IDEs
-
Open GitHub Copilot Chat in Visual Studio or JetBrains IDEs.
-
Type a prompt, starting with
@github
, asking Copilot to create a pull request, and giving details of what you want Copilot to change.For example,
@github Create a PR to put backticks around file names and variables in output.
Conseil
- To help Copilot, you can select the relevant line(s) of code before submitting your prompt.
- From Copilot Chat, you can ask Copilot to open a pull request using a specific branch as the base branch by including it in your prompt.
-
Submit your prompt.
Copilot asks you to confirm that you want to use the coding agent to create a pull request.
-
Click Allow.
Copilot 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.
Asking Copilot to create a pull request from Copilot Chat in GitHub.com
-
Open GitHub Copilot Chat on GitHub.com.
-
Type a prompt asking Copilot to create a pull request, and giving details of what you want Copilot to change.
For example,
Create a PR in monalisa/bookstore to put backticks around file names and variables in output.
Conseil
- You can ask Copilot to open a pull request using a specific branch as the base branch by including it in your prompt.
-
Submit your prompt.
Copilot asks you to confirm that you want to use the coding agent to create a pull request.
-
Click Allow.
Copilot 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.
Asking Copilot to create a pull request from the GitHub MCP server
As an alternative to using Copilot Chat, you can use the remote GitHub MCP server to trigger Copilot coding agent from any MCP host.
Remarque
- This capability is only available on the remote GitHub MCP server and host applications where remote MCP servers are supported.
-
Install the GitHub MCP server in your preferred IDE or agentic coding tool. See Using the GitHub MCP Server.
-
Ensure the
create_pull_request_with_copilot
tool is enabled. -
Open chat.
-
Type a prompt asking Copilot to create a pull request, with the details of what you want to change.
For example,
Open a PR in my repository to expand unit test coverage.
Conseil
- You can ask Copilot to open a pull request using a specific branch as the base branch by including it in your prompt.
-
Submit your prompt.
Copilot will start a new session, open a draft pull request and work on the task in the background. As it works, it will push changes to the pull request, and once it has finished, it will add you as a reviewer. In most cases, the MCP host will show you the URL of the created pull request.
Monitoring progress
You can view your current and past Copilot sessions from the Agents page and Visual Studio Code. See Tracking Copilot's sessions.