Skip to main content

Utilisation de GitHub Copilot Chat dans votre IDE

Vous pouvez commencer à utiliser GitHub Copilot Chat en installant l’extension dans l’environnement de votre choix.

Qui peut utiliser cette fonctionnalité ?

Tous les utilisateurs disposant d’un abonnement GitHub Copilot Individual peuvent accéder à GitHub Copilot Chat dans Visual Studio Code et Visual Studio. Les propriétaires d’organisations avec un abonnement Copilot Business peuvent décider d’accorder l’accès à GitHub Copilot Chat pour Visual Studio, et VS Code.

GitHub Copilot Chat dans un IDE JetBrains est actuellement en phase bêta et peut faire l’objet de modifications. Seuls certains utilisateurs sont éligibles pour rejoindre la version bêta. Pour plus d’informations, consultez « Adhésion à la version bêta de GitHub Copilot Chat dans un IDE JetBrains ».

About GitHub Copilot Chat and Visual Studio Code

GitHub Copilot Chat is a chat interface that lets you ask and receive answers to coding-related questions directly within a supported IDE. Copilot Chat can help you with a variety of coding-related tasks, like offering you code suggestions, providing natural language descriptions of a piece of code's functionality and purpose, generating unit tests for your code, and proposing fixes for bugs in your code. For more information, see "About GitHub Copilot Chat."

Prerequisites

  • To use the GitHub Copilot Chat beta you must have an active GitHub Copilot subscription. For more information, see "About billing for GitHub Copilot."

  • To use GitHub Copilot Chat in Visual Studio Code, you must have the latest version of Visual Studio Code installed. For more information, see the Visual Studio Code download page.

  • To use GitHub Copilot Chat in Visual Studio Code, you must be signed into Visual Studio Code with the same GitHub ID that has access to GitHub Copilot.

Enabling or disabling GitHub Copilot Chat

Note: If you have a GitHub Copilot Individual subscription, you are automatically granted access to GitHub Copilot Chat.

GitHub Copilot Chat is available to all organizations and enterprises that have an active GitHub Copilot Business license. You can enable or disable GitHub Copilot Chat for your organization or enterprise in the GitHub Copilot Business settings page.

If Copilot Chat is enabled or disabled at the enterprise level, organizations within the enterprise cannot override the setting.

Enabling or disabling GitHub Copilot Chat at the organization level

  1. In the upper-right corner of GitHub.com, select your profile photo, then click Your organizations.

    Screenshot of the dropdown menu under @octocat's profile picture. "Your organizations" is outlined in dark orange.

  2. Next to the organization, click Settings.

  3. In the "Code, planning, and automation" section of the sidebar, click Copilot, and then click Policies.

  4. To the right of Copilot Chat in the IDE, select the dropdown menu, and then click Enabled or Disabled.

Enabling or disabling GitHub Copilot Chat at the enterprise level

  1. In the enterprise account sidebar, click Policies.
  2. Under " Policies", click Copilot.
  3. To the right of Copilot Chat in the IDE, select the dropdown menu, and then choose the appropriate option.
    • Click Allowed to enable GitHub Copilot Chat for all organizations under your enterprise.
    • Click Blocked to disable GitHub Copilot Chat for all organizations under your enterprise.
    • Click No policy to allow each organization under your enterprise to set their own policy.

Installing the GitHub Copilot Chat extension in Visual Studio Code

To use GitHub Copilot Chat, you must first install the GitHub Copilot Chat extension for Visual Studio Code.

  1. In Visual Studio Code, open the Extensions view by clicking the Extensions icon in the activity bar on the left side of the Visual Studio Code window.

    Screenshot of the extensions icon in the Activity Bar.

  2. In the "Search Extensions in Marketplace" search box, search for the GitHub Copilot Chat extension, then click Install.

    Screenshot of the GitHub Copilot Chat extension in the Extensions Marketplace.

  3. In the Visual Studio Code window, click Reload required to update Visual Studio Code.

  4. If you are prompted to sign in by a toast notification in the bottom right corner of Visual Studio Code, click Sign in to GitHub. Sign in with the same GitHub ID that has a license for GitHub Copilot, or is assigned a seat for GitHub Copilot through an organization.

  5. Follow the prompts in Visual Studio Code and on GitHub in your browser to complete the sign in and authentication process.

  6. To confirm that GitHub Copilot Chat has been successfully installed, in the activity bar on the left side of the Visual Studio Code window, click the GitHub Copilot Chat icon to open the GitHub Copilot Chat chat window.

    Screenshot of the GitHub Copilot Chat icon in the Activity Bar.

Note: If you experience authentication issues after installing the extension, see "Troubleshooting issues with GitHub Copilot Chat."

Asking your first question

GitHub Copilot Chat is intended to answer exclusively coding related questions that you ask in natural language. For example, you can ask GitHub Copilot Chat to help you write a function that returns the sum of two numbers.

  1. In the Visual Studio Code activity bar, click the GitHub Copilot Chat icon to open the GitHub Copilot Chat chat window.

    Screenshot of the GitHub Copilot Chat icon in the Activity Bar.

  2. At the bottom of the GitHub Copilot Chat window, in the Ask Copilot a question or type / for topics text box, type a coding-related question, then press Enter. For example, type "How do I write a function that returns the sum of two numbers?".

  3. GitHub Copilot Chat will process your question and provide an answer, with code suggestions when appropriate, in the chat window.

    If your question is outside the scope of GitHub Copilot Chat, it will tell you and may suggest an alternative question to ask.

  4. Optionally, if GitHub Copilot Chat suggests a follow-up question above the Ask Copilot a question or type / for topics text box, click the follow-up question to ask it.

Using code suggestions from GitHub Copilot Chat

When GitHub Copilot Chat provides code suggestions, you have a few options for how to use them.

  1. In the GitHub Copilot Chat window, to show the options for a code suggestion, hover over the suggestion.

    Screenshot of code suggestion options in the GitHub Copilot Chat window.

  2. Choose one of the options for using the code suggestion.

    • To copy the code suggestion to your clipboard, click the Copy icon.
    • To insert the code suggestion into your code at the current location of your cursor, click the Insert at Cursor icon.
    • To view additional options, click the ... icon.
      • To create a new file and insert the suggestion into it, click Insert Into New File.
      • To run the code suggestion in the Visual Studio Code terminal, click Run in Terminal.

Asking GitHub Copilot Chat questions about your code

GitHub Copilot Chat can provide answers and support with a wide range of coding related topics.

  1. In Visual Studio Code, open the file you want GitHub Copilot Chat to help you with.
  2. Ask GitHub Copilot Chat a question about the file you have open. For example:
    • To generate a description of the file's purpose, ask a question like, "What does this file do?"
    • To generate a unit test for the file, type a request like, "Write a unit test for this file." Alternatively, highlight the code you want to generate a unit test for, then ask a question like, "Write a unit test for this code."
    • To generate a fix for a bug in the file, type a request like, "Fix this bug."

Sharing feedback about GitHub Copilot Chat

To share feedback about GitHub Copilot Chat, you can use the share feedback button in the GitHub Copilot Chat window.

  1. Scroll to the top of the GitHub Copilot Chat window.
  2. Click the share feedback button.
  3. In your browser, in the vscode-copilot-release repository, create a new issue or open the GitHub Copilot community discussion.
    • To open an issue to report a bug, next to Bug report for GitHub Copilot Chat, click Get started.
    • To open an issue to request a feature, next to Feature request for GitHub Copilot Chat, click Get started.
    • To report a security vulnerability, next to Report a security vulnerability, click View policy.
    • To ask a question in a discussion, next to Questions, click Open.

Further reading

About GitHub Copilot Chat and Visual Studio

GitHub Copilot Chat is a chat interface that lets you ask and receive answers to coding-related questions directly within a supported IDE. Copilot Chat can help you with a variety of coding-related tasks, like offering you code suggestions, providing natural language descriptions of a piece of code's functionality and purpose, generating unit tests for your code, and proposing fixes for bugs in your code. For more information, see "About GitHub Copilot Chat."

Prerequisites

  • To use the GitHub Copilot Chat beta you must have an active GitHub Copilot subscription. For more information, see "About billing for GitHub Copilot."

  • To use GitHub Copilot Chat with Visual Studio, you must be running Visual Studio 2022 version 17.6 or higher. For more information, see the Visual Studio IDE documentation.

  • To use GitHub Copilot Chat with Visual Studio, you must be signed into Visual Studio with the same GitHub ID that has access to GitHub Copilot.

Enabling or disabling GitHub Copilot Chat

Note: If you have a GitHub Copilot Individual subscription, you are automatically granted access to GitHub Copilot Chat.

GitHub Copilot Chat is available to all organizations and enterprises that have an active GitHub Copilot Business license. You can enable or disable GitHub Copilot Chat for your organization or enterprise in the GitHub Copilot Business settings page.

If Copilot Chat is enabled or disabled at the enterprise level, organizations within the enterprise cannot override the setting.

Enabling or disabling GitHub Copilot Chat at the organization level

  1. In the upper-right corner of GitHub.com, select your profile photo, then click Your organizations.

    Screenshot of the dropdown menu under @octocat's profile picture. "Your organizations" is outlined in dark orange.

  2. Next to the organization, click Settings.

  3. In the "Code, planning, and automation" section of the sidebar, click Copilot, and then click Policies.

  4. To the right of GitHub Copilot Chat in the IDE, select the dropdown menu, and then click Enabled or Disabled.

Enabling or disabling GitHub Copilot Chat at the enterprise level

  1. In the enterprise account sidebar, click Policies.
  2. Under " Policies", click Copilot.
  3. To the right of Copilot Chat in the IDE, select the dropdown menu, and then choose the appropriate option.
    • Click Allowed to enable GitHub Copilot Chat for all organizations under your enterprise.
    • Click Blocked to disable GitHub Copilot Chat for all organizations under your enterprise.
    • Click No policy to allow each organization under your enterprise to set their own policy.

Installing the GitHub Copilot Chat extension in Visual Studio

To use GitHub Copilot Chat with Visual Studio, you must install the Visual Studio extension.

  1. In the Visual Studio menu bar, click Extensions, then click Manage Extensions.

    Screenshot of the menu bar in Visual Studio. The "Extensions" menu is open, and the "Manage Extensions" option is highlighted with an orange outline.

  2. In the "Manage Extensions" window, click Visual Studio Marketplace, search for "GitHub Copilot Chat", then click Download.

  3. Close the "Manage Extensions" window, then exit and relaunch Visual Studio.

Note: If you experience authentication issues after installing the extension, see "Troubleshooting issues with GitHub Copilot Chat."

Asking your first question

GitHub Copilot Chat is intended to answer exclusively coding related questions that you ask in natural language. For example, you can ask GitHub Copilot Chat to help you write a function that returns the sum of two numbers.

  1. In the Visual Studio menu bar, to launch GitHub Copilot Chat, click View, then click GitHub Copilot Chat.

  2. At the bottom of the Copilot Chat window, in the Ask Copilot text box, type a coding related question, then press Enter. For example, type "How do I write a function that returns the sum of two numbers?".

    Note: If your question is outside the scope of GitHub Copilot Chat, it will tell you and may suggest an alternative question to ask.

  3. If Copilot Chat offers a code suggestion that you want to use, click the Copy icon to copy the code suggestion to your clipboard.

  4. Optionally, if GitHub Copilot Chat suggests a follow-up question under your last answer, click the follow-up question to ask it.

Asking GitHub Copilot Chat questions about your code

GitHub Copilot Chat can provide answers and support with a wide range of coding related topics.

  1. In Visual Studio, open the file you want GitHub Copilot Chat to help you with.
  2. Ask GitHub Copilot Chat a question about the file you have open. For example:
    • To generate a description of the file's purpose, ask a question like, "What does this file do"
    • To generate a unit test for the file, type a request like, "Write a unit test for this file." Alternatively, highlight the code you want to generate a unit test for, then ask a question like, "Write a unit test for this code."
    • To generate a fix for a bug in the file, type a request like, "Fix this bug."

Sharing feedback about GitHub Copilot Chat

To share feedback about GitHub Copilot Chat, you can use the Send feedback button in Visual Studio. For more information on providing feedback for Visual Studio, see the Visual Studio Feedback documentation.

  1. In the top right corner of the Visual Studio window, click the Send feedback button.

    Screenshot of the share feedback button in Visual Studio.

  2. Choose the option that best describes your feedback.

    • To report a bug, click Report a problem.
    • To request a feature, click Suggest a feature.

Further reading

About GitHub Copilot Chat and JetBrains

GitHub Copilot Chat is a chat interface that lets you ask and receive answers to coding-related questions directly within a supported IDE. Copilot Chat can help you with a variety of coding-related tasks, like offering you code suggestions, providing natural language descriptions of a piece of code's functionality and purpose, generating unit tests for your code, and proposing fixes for bugs in your code. For more information, see "About GitHub Copilot Chat."

Joining the beta for GitHub Copilot Chat in a JetBrains IDE

The following customers are eligible to participate in the private beta for GitHub Copilot Chat in a JetBrains IDE.

  • Users with Copilot Individual subscriptions. To join the private beta, sign up on the waitlist. You will be notified by email when you are granted access to the beta. Joining the waitlist does not guarantee access to the beta.
  • Owners of invoiced organizations or enterprises with a Copilot Business subscription who also have an account manager. To join the private beta, contact your account manager or solutions engineer to request access.

The following customers are not eligible for the private beta for GitHub Copilot Chat in a JetBrains IDE at this time.

  • Customers on Free, Team, or Enterprise plans who do not have an account manager.
  • Customers on Enterprise plans who pay for GitHub with a credit card or PayPal.

Prerequisites

  • To use the GitHub Copilot Chat beta you must have an active GitHub Copilot subscription. For more information, see "About billing for GitHub Copilot."

  • To use the GitHub Copilot Chat beta in JetBrains, you must have a compatible JetBrains IDE installed. Copilot Chat is compatible with the following IDEs:

    • IntelliJ IDEA (Ultimate, Community, Educational)
    • Android Studio
    • AppCode
    • CLion
    • DataGrip
    • DataSpell
    • GoLand
    • MPS
    • PhpStorm
    • PyCharm (Professional, Community, Educational)
    • Rider
    • RubyMine
    • RustRover
    • WebStorm

    For more information, see the JetBrains IDEs tool finder.

Enabling or disabling GitHub Copilot Chat

Notes:

  • If you have a GitHub Copilot Individual subscription, you can join the waitlist. You will be notified by email when you have been grated access. Joining the waitlist does not guarantee you access.
  • If you have a GitHub Copilot Business subscription for an invoiced organization or enterprise, you can contact your account manager or solutions engineer to request access.

Enabling or disabling GitHub Copilot Chat at the organization level

  1. In the upper-right corner of GitHub.com, select your profile photo, then click Your organizations.

    Screenshot of the dropdown menu under @octocat's profile picture. "Your organizations" is outlined in dark orange.

  2. Next to the organization, click Settings.

  3. In the "Code planning, and automation" section of the sidebar, click Copilot, and then click Policies.

  4. To the right of GitHub Copilot Chat Beta, select the dropdown menu, and then click Enabled or Disabled.

Enabling or disabling GitHub Copilot Chat at the enterprise level

  1. In the enterprise account sidebar, click Policies.
  2. Under " Policies", click Copilot.
  3. To the right of GitHub Copilot Chat Beta, select the dropdown menu, and then choose the appropriate option.
    • Click Allowed to enable the GitHub Copilot Chat beta for all organizations under your enterprise.
    • Click Blocked to disable the GitHub Copilot Chat beta for all organizations under your enterprise.
    • Click No policy to allow each organization under your enterprise to set their own policy.

Installing or updating the GitHub Copilot plugin in JetBrains

To use the GitHub Copilot Chat beta in a JetBrains IDE, you must install or update the GitHub Copilot plugin. If you have not yet installed the GitHub Copilot plugin, follow the steps in "Installing the GitHub Copilot plugin in your JetBrains IDE." If you have already installed the GitHub Copilot plugin, follow the steps in "Updating the GitHub Copilot plugin in JetBrains."

The following procedures will guide you through installing or updating the GitHub Copilot plugin in IntelliJ IDEA. Steps to install the plugin in another supported IDE may differ.

Installing the GitHub Copilot plugin in your JetBrains IDE

To use GitHub Copilot in a JetBrains IDE, you must install the GitHub Copilot plugin.

  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.

  2. In the left-side menu of the Settings/Preferences dialog box, click Plugins.

  3. At the top of the Settings/Preferences dialog box, click Marketplace. In the search bar, search for GitHub Copilot, then click Install.

    Screenshot of the "Preferences" window. A tab labeled "Marketplace" is highlighted with an orange outline. In a list of search results, the installed "GitHub Copilot" plugin is marked by a selected checkbox.

  4. After GitHub Copilot is installed, click Restart IDE.

  5. After your JetBrains IDE has restarted, click the Tools menu. Click GitHub Copilot, then click Login to GitHub.

    Screenshot of the expanded "Tools" menu and "GitHub Copilot" sub-menu. The "Login to GitHub" option is highlighted in blue.

  6. In the "Sign in to GitHub" dialog box, to copy the device code and open the device activation window, click Copy and Open.

    Screenshot of the "Sign in to GitHub" dialog. A device code is displayed above a button labeled "Copy and Open".

  7. A device activation window will open in your browser. Paste the device code, then click Continue.

  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.

Updating the GitHub Copilot plugin in JetBrains

  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.
  2. In the left-side menu of the Settings/Preferences dialog box, click Plugins.
  3. At the top of the Settings/Preferences dialog box, click Installed. In the search bar, search for GitHub Copilot, then click Update.
  4. After GitHub Copilot is updated, quit and relaunch your JetBrains IDE.

Asking your first question

GitHub Copilot Chat is intended to answer exclusively coding related questions that you ask in natural language. For example, you can ask GitHub Copilot Chat to help you write a function that returns the sum of two numbers.

  1. At the right side of the JetBrains IDE window, click the GitHub Copilot Chat icon to open the GitHub Copilot Chat window.

    Screenshot of the GitHub Copilot Chat icon in the Activity Bar.

  2. At the bottom of the GitHub Copilot Chat window, in the Ask Copilot a question or type / for commands text box, type a coding related question, then press Enter. For example, type "How do I write a function that returns the sum of two numbers?".

  3. GitHub Copilot Chat will process your question and provide an answer, with code suggestions when appropriate, in the chat window.

    If your question is outside the scope of GitHub Copilot Chat, it will tell you and may suggest an alternative question to ask.

  4. Optionally, if GitHub Copilot Chat suggests a follow-up question above the Ask Copilot a question or type / for commands text box, click the follow-up question to ask it.

Asking GitHub Copilot Chat questions about your code

GitHub Copilot Chat can provide answers and support with a wide range of coding-related topics.

  1. In your JetBrains IDE, open the file you want GitHub Copilot Chat to help you with.
  2. Ask GitHub Copilot Chat a question about the file you have open. For example:
    • To generate a description of the file's purpose, ask a question like, "What does this file do?"
    • To generate a unit test for the file, type a request like, "Write a unit test for this file." Alternatively, highlight the code you want to generate a unit test for, then ask a question like, "Write a unit test for this code."
    • To generate a fix for a bug in the file, type a request like, "Fix this bug."

Sharing feedback about GitHub Copilot Chat

To share feedback about GitHub Copilot Chat, you can use the share feedback link in JetBrains.

  1. At the right side of the JetBrains IDE window, click the GitHub Copilot Chat icon to open the GitHub Copilot Chat window.

    Screenshot of the GitHub Copilot Chat icon in the Activity Bar.

  2. At the top of the GitHub Copilot Chat window, click the share feedback link.

    Screenshot of the share feedback link in the GitHub Copilot Chat window.

Further reading