leona / helix-gpt

Code assistant language server for Helix with support for Copilot/OpenAI/Codeium/Ollama
MIT License
285 stars 19 forks source link

Question about API key #32

Closed cfuehrmann closed 4 months ago

cfuehrmann commented 4 months ago

Please forgive this stupid question, I seem to be having a blackout about the required API key. I pay for GitHub Copilot, and for a long time I've been using Copilot in Visual Studio, Visual Studio, and Neovim. In your instructions, you mention a required API key. But I can't figure out for the life of me how to obtain that key. I can find no corresponding function in my GitHub account. How do I find the key?

And is this key the same as the "token" you mention in the context of helix-gpt --authCopilot? Or are key and token two different things?

What is supposed to happen when I use helix-gpt --authCopilot? What I get is "error: no handler key provided". But isn't the very command supposed to get me the key?

Can you maybe clarify your instructions in this regard?

hnorkowski commented 4 months ago

You are supposed to use --authCopilot to acquire the token. But there is an oversight in its implementation. It expects you to already provide a token. However, this token is not used so you can just specify any random token and use the function to get an actual token and store that in the token env variable.

TLDR: execute HANDLER=copilot COPILOT_API_KEY=123 helix-gpt --authCopilot and use the printed token.

EDIT: see #31

cfuehrmann commented 4 months ago

Thanks ever so much! I have it all working now. Great project!