What is the GitHub Copilot extension for Visual Studio?
Applies to:
Visual Studio
Visual Studio for Mac
Visual Studio Code
GitHub Copilot and GitHub Copilot Chat extensions in Visual Studio enable enhanced AI-assisted development in Visual Studio, helping you be more productive and efficient when writing code.
In this article, you learn about the Copilot extension, an AI-powered pair programmer extension for Visual Studio that provides you with context-aware code completions, suggestions, and even entire code snippets. This powerful tool aids AI-assisted development in Visual Studio and helps developers write code more efficiently, reduce the time spent on repetitive tasks, and minimize errors.
For more information on the GitHub Copilot Chat extension in Visual Studio, see About the GitHub Copilot Chat extension for Visual Studio.
How GitHub Copilot works
GitHub Copilot works by utilizing advanced machine learning models trained on a vast dataset of publicly available code from GitHub repositories. As you type code, the AI analyzes the context and provides relevant suggestions in real-time. You can receive suggestions also by writing a natural language comment describing what you want the code to do.
You can also use GitHub Copilot to convert comments to code, create unit tests, create SQL queries, and more.
Prerequisites
To get started, you need:
Visual Studio 2022 version 17.4.4 or later
a GitHub Copilot subscription.
Tip
GitHub Copilot is free for verified students and for maintainers of popular open source projects on GitHub. If you are not a student or maintainer of a popular open source project, you can try GitHub Copilot for free with a one-time 30-day trial. After the free trial, you will need a paid subscription for continued use.
GitHub Copilot supports several programming languages and frameworks, including but not limited to: C#, C++, and Python.
Installation instructions
You can install GitHub Copilot as an extension, but we recommend you install GitHub Copilot as a component using the Visual Studio Installer.
Install using the Visual Studio Installer
Launch the Visual Studio Installer.
Select the installation of Visual Studio you want to modify, and then select Modify.
Select any workload, for example, .NET desktop development.
Select GitHub Copilot from the list of Optional components, and then select Modify to install the extension.
Note
You'll use the Manage Extensions dialog to manage updates to the GitHub Copilot extension.
Install using the Manage Extensions dialog
- Open Visual Studio.
- On the menu bar, select Extensions > Manage Extensions.
- In the Search box, enter "GitHub Copilot".
- Select the GitHub Copilot extension, and then select the Download button.
- Restart Visual Studio to complete the installation process.
Note
For more information about activation & authorization, see the Installing the Visual Studio extension section in GitHub Docs.
After installation, you can start using GitHub Copilot by typing code in the editor and observing the suggestions provided by AI.
Exploring GitHub Copilot
To see GitHub Copilot in action, check out the following video tutorial.
Video length: 1.19 minutes
Next steps
To learn more about the current GitHub Copilot extension for Visual Studio, consider exploring the following resources:
Feedback
Submit and view feedback for