Skip to content

Latest commit

 

History

History
109 lines (72 loc) · 6.89 KB

using-github-copilot-with-an-account-on-ghecom.md

File metadata and controls

109 lines (72 loc) · 6.89 KB
title shortTitle intro versions defaultTool topics
Using GitHub Copilot with an account on GHE.com
Authenticate to GHE.com
Update your development environment to access a {% data variables.product.prodname_copilot_short %} plan for an account on {% data variables.enterprise.data_residency_site %}.
feature
copilot
vscode
Copilot

To use {% data variables.product.prodname_copilot %} in an IDE or the command line, you must authenticate to an account on {% data variables.product.github %} that has a {% data variables.product.prodname_copilot_short %} license.

If you receive access to {% data variables.product.prodname_copilot_short %} through a {% data variables.enterprise.prodname_managed_user %} owned by an enterprise on {% data variables.enterprise.data_residency_site %}, you may need to adjust some settings in your IDE before you can authenticate to your account.

Use the tabs at the top of this article to see instructions for your environment.

{% vscode %}

Authenticating from {% data variables.product.prodname_vscode_shortname %}

  1. To open your {% data variables.product.prodname_vscode_shortname %} settings, press Command+, (Mac) or Ctrl+, (Windows).

  2. In the search bar, search for enterprise.

  3. For the Github-enterprise: Uri setting, enter the URL where you access {% data variables.product.github %}. For example: https://{% data variables.enterprise.data_residency_example_domain %}.

  4. In the {% data variables.product.prodname_vscode_shortname %} settings, search for copilot.

  5. Under "GitHub > Copilot: Advanced," click Edit in settings.json.

  6. Inside the github.copilot.advanced property, add "authProvider": "github-enterprise". For example:

    "github.copilot.advanced": {
         "authProvider": "github-enterprise"
    },
  7. Save the settings.json file.

  8. You will be shown a prompt asking you to sign in to use {% data variables.product.prodname_copilot %}. Click Sign in to {% data variables.product.github %}, then follow the prompts to authorize your account.

    If you don't see the prompt, try restarting {% data variables.product.prodname_vscode_shortname %}.

If you ever need to switch to an account on {% data variables.product.prodname_dotcom_the_website %}, remove the authProvider setting from settings.json.

{% endvscode %}

{% jetbrains %}

Authenticating from JetBrains IDEs

To authenticate to {% data variables.enterprise.data_residency_site %} in a JetBrains editor, you must install version 1.4.11 or later of the {% data variables.product.prodname_copilot_short %} extension. You must then configure the extension to work with {% data variables.enterprise.data_residency_site %}.

  1. To open the editor preferences or settings dialog, press Command+, (Mac) or Ctrl+Alt+S (Windows).
  2. In the left sidebar, expand the "Languages & Frameworks" section, then click {% data variables.product.prodname_copilot %}.
  3. In the "Authentication Provider" field, enter the hostname where you access {% data variables.product.github %}. For example: {% data variables.enterprise.data_residency_example_domain %}.
  4. To save your changes, click OK.
  5. To sign in, open the Tools menu, then select {% data variables.product.prodname_copilot %} > Login to {% data variables.product.github %}. Follow the prompts to sign in.

If you ever need to switch to an account on {% data variables.product.prodname_dotcom_the_website %}, remove the value you entered in the "Authentication Provider" field.

{% endjetbrains %}

{% xcode %}

Authenticating from Xcode

  1. Open the "{% data variables.product.prodname_copilot %} for Xcode" application.
  2. Click the Advanced tab.
  3. In the "Auth provider URL" field, enter the URL where you access {% data variables.product.github %}. For example: https://{% data variables.enterprise.data_residency_example_domain %}.
  4. Authorize the extension by following the instructions in Signing in to {% data variables.product.prodname_copilot %}.

{% endxcode %}

{% cli %}

Authenticating from the command line

To use the gh-copilot extension for the {% data variables.product.prodname_cli %}, you must:

  1. Download and install the extension. To do this, you must be authenticated to an account on {% data variables.product.prodname_dotcom_the_website %}. See AUTOTITLE.
  2. Authenticate to the account on {% data variables.enterprise.data_residency_site %} where you receive your {% data variables.product.prodname_copilot_short %} license.

{% data variables.product.prodname_dotcom_the_website %} is the default destination of {% data variables.product.prodname_cli %} requests. To use gh copilot, you must ensure requests are sent to {% data variables.enterprise.data_residency_site %}, where you receive your license. You have the following options:

  • Include the flag --hostname SUBDOMAIN.ghe.com in all gh copilot commands.
  • Set the GH_HOST environment variable to change the default host for all {% data variables.product.prodname_cli %} commands.
  • Sign out of {% data variables.product.prodname_dotcom_the_website %} with gh auth logout. However, you will need to sign back in to get updates to gh-copilot.

For general information on using the {% data variables.product.prodname_cli %} across platforms, see AUTOTITLE.

{% endcli %}

{% visualstudio %}

Authenticating from Visual Studio

To authenticate from Visual Studio, follow the steps in Add your GitHub accounts to your Visual Studio keychain on Microsoft Learn.

For the "{% data variables.product.prodname_enterprise %} URL" field, enter the URL where you access {% data variables.product.github %}. For example: https://{% data variables.enterprise.data_residency_example_domain %}.

{% endvisualstudio %}

{% eclipse %}

Authenticating from Eclipse

  1. In the IDE, click {% octicon "copilot" aria-hidden="true" %} {% data variables.product.prodname_copilot_short %} to open the menu.
  2. Click Edit Preferences....
  3. In the {% data variables.product.prodname_enterprise %} Authentication Endpoint field, enter the URL where you access {% data variables.product.github %}. For example: https://{% data variables.enterprise.data_residency_example_domain %}.
  4. Click Apply.
  5. Open the {% octicon "copilot" aria-hidden="true" %} {% data variables.product.prodname_copilot_short %} menu again then click Sign In to {% data variables.product.prodname_dotcom %}.

{% endeclipse %}