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: Uri
setting, 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.advanced
property, add"authProvider": "github-enterprise"
. For example:JSON "github.copilot.advanced": { "authProvider": "github-enterprise" },
"github.copilot.advanced": { "authProvider": "github-enterprise" },
-
Save the
settings.json
file. -
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
.