Getting Started With GitHub Copilot in A JetBrains IDE (Docs Github Com)
Getting Started With GitHub Copilot in A JetBrains IDE (Docs Github Com)
com
/en/copilot/getting-started-with-github-copilot/getting-started-with-github-copilot-in-a-jetbrains-ide
Learn how to install GitHub Copilot in a JetBrains IDE, and start seeing suggestions as you write
comments and code.
GitHub Copilot is available to GitHub customers with a personal account on GitHub.com and GitHub
Enterprise Cloud organizations owned by an enterprise account.
GitHub Copilot is free to use for verified students, teachers, and maintainers of popular open source
projects. If you are not a student, teacher, or maintainer of a popular open source project, you can try
GitHub Copilot for free with a one-time 60-day trial. After the free trial, you will need a paid subscription
for continued use. For more information, see "About billing for GitHub Copilot."
If you use a JetBrains IDE, you can view and incorporate suggestions from GitHub Copilot directly within
the editor. This guide demonstrates how to use GitHub Copilot within a JetBrains IDE for macOS,
Windows, or Linux.
Prerequisites
To use GitHub Copilot you must have an active GitHub Copilot subscription. For more information,
see "About billing for GitHub Copilot."
To use GitHub Copilot in JetBrains, you must have a compatible JetBrains IDE installed. GitHub Copilot is
compatible with the following IDEs.
1/7
MPS
PhpStorm
PyCharm (Professional, Community, Educational)
Rider
RubyMine
WebStorm
1. In your JetBrains IDE, under the File menu for Windows or under the name of your IDE for Mac (for
example, PyCharm or IntelliJ), click Settings for Windows or Preferences for Mac.
3. At the top of the Settings/Preferences dialog box, click Marketplace. In the search bar, search for
GitHub Copilot, then click Install.
2/7
5. After your JetBrains IDE has restarted, click the Tools menu. Click GitHub Copilot, then click
Login to GitHub.
6. In the "Sign in to GitHub" dialog box, to copy the device code and open the device activation
window, click Copy and Open.
7. A device activation window will open in your browser. Paste the device code, then click Continue.
3/7
To paste the code in macOS, press command+v.
8. GitHub will request the necessary permissions for GitHub Copilot. To approve these permissions,
click Authorize GitHub Copilot Plugin.
9. After the permissions have been approved, your JetBrains IDE will show a confirmation. To begin
using GitHub Copilot, click OK.
4. To prompt GitHub Copilot to suggest a function body, type the following line below the bracket of
the main function. The exact suggestion may vary.
int calculateDaysBetweenDates(
4/7
5. To accept the suggestion, press Tab.
GitHub Copilot will attempt to match the context and style of your code. You can always edit the
suggested code.
2. To prompt GitHub Copilot to show you a suggestion, type the following line in the Java file.
int calculateDaysBetweenDates(
int calculateDaysBetweenDates(
5/7
On Windows or Linux, press Ctrl+Enter, then click Open GitHub Copilot.
4. To accept a suggestion, above the suggestion, click Accept Solution. To reject all suggestions,
close the tab.
void process () {
6/7
enabled or disabled. When enabled, the icon is highlighted. When disabled, the icon is grayed out.
1. To enable or disable GitHub Copilot, click the status icon in the bottom panel of the JetBrains
window.
2. If you are disabling GitHub Copilot, you will be asked whether you want to disable it globally, or for
the language of the file you are currently editing.
Further reading
7/7