To obtain the copilot token, execute the following command after Installation.
helix-gpt --authCopilot
It will ask you to open GitHub’s device registration page
and input the 8 character code.
After that it should automatically display the obtained token.
Simply store that in the COPILOT_API_KEY environment variable, in my case, as I’m using fish, it’s as easy as
set -Ux COPILOT_API_KEY ghu_TOKEN
Replace
ghu_TOKEN: Your obtained Copilot API token
Set the HANDLER environment variable to copilot (I’m using fish again)
set -Ux HANDLER copilot
Helix
No further configuration should be necessary for the gpt language server itself, as I’ve already included a configuration with my Dotfiles.
But in general, you want to add gpt to the language-servers array of a particular language you want to support within the languages.toml file.
Tip
You can either add it to the global file in ~/.config/helix file, or even better configure this on a per-project basis, by using a project-local .helix directory!