To use GitHub Copilot in an IDE or the command line, you must authenticate to an account on GitHub that has a Copilot license.
If you receive access to Copilot through a managed user account owned by an enterprise on GHE.com, 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.
Authenticating from VS Code
-
To open your VS Code settings, press Command+, (Mac) or Ctrl+, (Windows).
-
In the search bar, search for
enterprise. -
For the
Github-enterprise: Urisetting, enter the URL where you access GitHub. For example:https://octocorp.ghe.com. -
In the VS Code settings, search for
copilot. -
Under "GitHub > Copilot: Advanced," click Edit in settings.json.
-
Inside the
github.copilot.advancedproperty, add"authProvider": "github-enterprise". For example:JSON "github.copilot.advanced": { "authProvider": "github-enterprise" },"github.copilot.advanced": { "authProvider": "github-enterprise" }, -
Save the
settings.jsonfile. -
You will be shown a prompt asking you to sign in to use GitHub Copilot. Click Sign in to GitHub, then follow the prompts to authorize your account.
If you don't see the prompt, try restarting VS Code.
If you ever need to switch to an account on GitHub.com, remove the authProvider setting from settings.json.
Authenticating from JetBrains IDEs
To authenticate to GHE.com in a JetBrains editor, you must install version 1.4.11 or later of the Copilot extension. You must then configure the extension to work with GHE.com.
- To open the editor preferences or settings dialog, press Command+, (Mac) or Ctrl+Alt+S (Windows).
- In the left sidebar, expand the "Tools" section, then click GitHub Copilot.
- In the "General" section, look for the "Authentication Provider" field and enter the hostname where you access GitHub. For example:
octocorp.ghe.com. - To save your changes, click OK.
- Follow the prompts to sign in to use GitHub Copilot.
To sign in and out of GitHub at any time, click the Copilot Chat icon () in the status bar, then click Login to GitHub. Follow the prompts to sign in.
If you ever need to switch to an account on GitHub.com, remove the value you entered in the "Authentication Provider" field.
Authenticating from Xcode
- Open the "GitHub Copilot for Xcode" application.
- Click the Advanced tab.
- In the "Auth provider URL" field, enter the URL where you access GitHub. For example:
https://octocorp.ghe.com. - Authorize the extension by following the instructions in Signing in to GitHub Copilot.
Authenticating from the command line
To use Copilot CLI, you must:
- Download and install Copilot CLI. See Installing GitHub Copilot CLI.
- Authenticate to the account on GHE.com where you receive your Copilot license with
copilot login --host SUBDOMAIN.ghe.com.
For general information on using Copilot CLI, see GitHub Copilot CLI.
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 "GitHub Enterprise URL" field, enter the URL where you access GitHub. For example: https://octocorp.ghe.com.
Authenticating from Eclipse
- In the IDE, click Copilot to open the menu.
- Click Edit Preferences....
- In the GitHub Enterprise Authentication Endpoint field, enter the URL where you access GitHub. For example:
https://octocorp.ghe.com. - Click Apply.
- Open the Copilot menu again then click Sign In to GitHub.