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 %}. |
|
vscode |
|
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 %}
-
To open your {% data variables.product.prodname_vscode_shortname %} settings, press Command+, (Mac) or Ctrl+, (Windows).
-
In the search bar, search for
enterprise
. -
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 %}
. -
In the {% data variables.product.prodname_vscode_shortname %} settings, search for
copilot
. -
Under "GitHub > Copilot: Advanced," click Edit in settings.json.
-
Inside the
github.copilot.advanced
property, add"authProvider": "github-enterprise"
. For example:"github.copilot.advanced": { "authProvider": "github-enterprise" },
-
Save the
settings.json
file. -
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 %}
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 %}.
- To open the editor preferences or settings dialog, press Command+, (Mac) or Ctrl+Alt+S (Windows).
- In the left sidebar, expand the "Languages & Frameworks" section, then click {% data variables.product.prodname_copilot %}.
- In the "Authentication Provider" field, enter the hostname where you access {% data variables.product.github %}. For example:
{% data variables.enterprise.data_residency_example_domain %}
. - To save your changes, click OK.
- 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 %}
- Open the "{% data variables.product.prodname_copilot %} for Xcode" application.
- Click the Advanced tab.
- 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 %}
. - Authorize the extension by following the instructions in Signing in to {% data variables.product.prodname_copilot %}.
{% endxcode %}
{% cli %}
To use the gh-copilot
extension for the {% data variables.product.prodname_cli %}, you must:
- 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.
- 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 allgh 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 togh-copilot
.
For general information on using the {% data variables.product.prodname_cli %} across platforms, see AUTOTITLE.
{% endcli %}
{% visualstudio %}
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 %}
- In the IDE, click {% octicon "copilot" aria-hidden="true" %} {% data variables.product.prodname_copilot_short %} to open the menu.
- Click Edit Preferences....
- 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 %}
. - Click Apply.
- 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 %}