copilot.lua icon indicating copy to clipboard operation
copilot.lua copied to clipboard

Not possible to authenticate when running in Docker development container

Open magnusriga opened this issue 5 months ago • 2 comments

I assume Copilot auth should try to open a browser, but I do not have access to one as I am running nvim in a devcontainer?

Any workaround? Nothing happens when calling Copilot auth.

Thank you.

magnusriga avatar Jul 20 '25 00:07 magnusriga

What happens when you command :Copilot auth signin?

jamilraichouni avatar Jul 20 '25 07:07 jamilraichouni

If you have access to an instance running outside of docker, you might also try the token auth flow detailed here and just put the token in your container's environment:

Tokens given by gh auth token do not support Copilot, you therefore need to first generate a token through the LSP by:

  • Authenticating using the Permanent sign-in method
  • Grab the token by running :Copilot auth info
  • You can then safely delete the github-copilot folder created in your NeoVim base data directory.

Set either the environment variable GITHUB_COPILOT_TOKEN or GH_COPILOT_TOKEN to that token. Note that if you have the variable set, even empty, the LSP will attempt to use it to log in.

timhugh avatar Jul 25 '25 14:07 timhugh