Repository navigation
Fresh brew install asks for Github Copilot API key #1154
Description
Activity
Check and see if
~/.local/state/opencode/plugin/copilot.tsexists on your system. Experienced the same issue and was able to fix it by copying that file over from one of my Linux machines where OAuth login is working.I'm having the same issue. I do not have the file @zacharyeller13 mentioned. Completely fresh install from NPM.
I can't get it to prompt me for auth device flow at all, it always prompts for API key.
Edit: Setting "NODE_TLS_REJECT_UNAUTHORIZED=0" fixes this issue for me. It is due to corporate proxy. See #1694 for an issue asking for local trust store support.
[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!
I got the same issue (API key asked for Github Copilot) but it was due to a different root cause (silent failure to install npm deps).
Because of a custom npm registry configured on my side, the attempts to install the deps were getting 401 but I was getting 0 error on the UI so I did not know that something was wrong. Like described in this ticket I was then unable, to login to Github Copilot because it was asking for an API key.
Once I fixed my npm registry, everything went like a charm.
I'm guessing that the errors are not caught, that's why there is no error message on the UI. Maybe a good fix would be to display an error message when that happens?
Here's an extract of the logs, showing the 401.
INFO 2026-01-12T12:25:29 +110ms service=bun code=1 s
stdout=bun add v1.3.5 (1e86cebd)
stderr=Resolving dependencies
Resolved, downloaded and extracted [1]
error: GET https://<CUSTOM_NPM_REGISTRY>/@opencode-ai%2fplugin - 401
done
INFO 2026-01-12T12:25:29 +0ms service=bun cmd=["/opt/homebrew/Cellar/opencode/1.1.14/bin/opencode","install"] cwd=/Users/hulius/.config/opencode running
INFO 2026-01-12T12:25:29 +6ms service=bun code=1 stdout=bun add v1.3.5 (1e86cebd)
stderr=Resolving dependencies
Resolved, downloaded and extracted [1]
error: GET https://<CUSTOM_NPM_REGISTRY>/opencode-copilot-auth - 401
doneI'm on MacOS, v1.1.14 installed with Homebrew.
I'm guessing that the errors are not caught, that's why there is no error message on the UI. Maybe a good fix would be to display an error message when that happens?
YES
Reacted by Jules H.- added a commit that references this issue
on May 12, 2026
Description: Fresh install asks for a GH Copilot API key instead of providing a link to the auth flow.
OS: Mac
Steps to reproduce:
opencode auth loginExpected Results: Returns a link to complete the auth flow, and the security code.
Actual results: Asks for GH Copilot API key