24

I have installed GitHub Copilot just for the sake of testing. However, none of the commands work.

For example if I try CTRL + Enter I get this error message:

command 'github.copilot.generate' not found

I am trying it with JS file.

I have latest Visual Studio Code and Copilot installed.

liuliang
  • 395
  • 1
  • 3
  • 14
harunB10
  • 4,823
  • 15
  • 63
  • 107

15 Answers15

36
  1. Click on the bell button on bottom right-corner of the Visual Studio Code Editor
  2. Press 'Agree' button
  3. Thats it!

enter image description here

Prashanth Sams
  • 19,677
  • 20
  • 102
  • 125
9

I had already signed up for the Technical preview and also accepted the invite for the same. Even after being signed in to VS Code using the same account, I had this error. This solution worked for me:

  • Sign out of my account from the Accounts section of the left sidebar on VS Code
  • Sign in again using the same account in which invite was received
Kshitiz Kamal
  • 131
  • 1
  • 5
7

NOTE: There is a thread on the official Copilot discussion board on this issue here.

Disclaimer: these are a bunch of things I tried that didn't work, but may work for you.

I have access to Github Copilot as well but get the error:

command 'github.copilot.generate' not found

Tried reloading and reinstalling it as well through vscodes ui.

Went in and manually went through the process of completely deleting it explained here.

Afterward, I logged out of my Github account attempted to install Copilot then logged back in when the prompt was displayed, again no luck.

Tested running both CTRL+ENTER and Alt+\ , neither of them did anything.

After I tried:

Developer: Reload Window

But that didn't do anything.

Checked the discussion forums and they had a solution for:

command 'github.copilot.toggleCopilot' not found

Which was to simply uninstall then reinstall copilot then run CTRL+R (Developer: Reload Window), this too didn't work out.

There's a good chance that all you'd have to do is retrigger the authentication flow considering that the developer tools console reports that copilot is "missing an auth token" (but no one knows how to retrigger it).

In addition to the above, I tried running CTRL+SHIFT+P then ran "Open Copilot", which resulted in the error

Command 'Open Copilot' resulted in an error (command 'github.copilot.generate' not found)

From this discussion post on another forum with a similar issue, apparently, this is an issue with command registration.

This specific comment seemed most relevant

  1. Uninstall Python extension (if you have pylance uninstall it first).

  2. Close all instances of VS Code.

  3. Go to,%USERPROFILE%/.vscode/extensions (on windows) or ~/.vscode/extensions on Linux/Mac.

  4. Delete any folder with the name starting with ms-python.python*

  5. Start VS Code, and install Python extension (also pylance if you uninstalled it in step 1).

Of course, you'd have to apply this to Copilot so...

  1. Uninstall Copilot

  2. Close all instances of vscode

  3. Go to, %USERPROFILE%/.vscode/extensions (on windows) or ~/.vscode/extensions on Linux/Mac.

  4. Delete all instances of Copilot

  5. Go to, %USERPROFILE%/AppData/Roaming/Code/CachedExtensionVSIXs

  6. Delete all instances of Copilot

  7. Start and install Copilot

This too didn't work.

If I were to guess this would be solvable via retriggering the authentication flow.

General Grievance
  • 4,555
  • 31
  • 31
  • 45
Vincent Casey
  • 178
  • 2
  • 11
  • 1
    On mac you need to delete ~/Library/Application Support/Code/CachedExtensionVSIXs/github.copilot*" as well (this is the mac version of step 6) – apple16 Oct 25 '21 at 04:19
  • I have the same issue when connected to my work VPN. If I disconnect from the VPN it work – voidmind Nov 02 '21 at 17:05
3
  1. Like this answer said

Go to, %USERPROFILE%/AppData/Roaming/Code/CachedExtensionVSIXs

  1. Delete all files and reopen vsCode.
General Grievance
  • 4,555
  • 31
  • 31
  • 45
2

This happens when you have failed to authenticate Copilot with Visual Studio Code.

If you had a missed authentication flow the flow can be re-triggered by clicking the VSCode Notifications icon on the status bar and clicking on the Sign in to Github notification.

If you have lost the authentication flow notification from the notifications panel, re-installing the Copilot helps.

TIP: To make it easier to sign in, make sure you are already authenticated on github.com on the default browser.

bhagyas
  • 3,050
  • 1
  • 23
  • 21
1

You can open the extensions tab or press ctrl + shift + x to look at the copilot extension. you may reload it if you have authenticated with your GitHub account before.

1

In OSX this worked:

On a previous try, I had logged in to the wrong GitHub account. Be sure to be logged in with the correct GitHub account in the browser. Delete the extension from VSCode. Then open the Keychain Access -app and delete GitHub keys from there. After that install the extension and now it gets the correct authorization.

stuta
  • 11
  • 1
1

Step 1: First you need to login with same Github account you use for copilot beta signup, in your default browser.

If you mistakenly did something wrong here, just uninstall the extension and reload it, and then repeat step 1.

ouflak
  • 2,458
  • 10
  • 44
  • 49
anish jain
  • 11
  • 1
  • 2
0

I don't know how this ties in but maybe it will help.

I have several times gotten a page saying that Copilot installed but wasn't done yet, and that I could finish the process by pasting an auth code into the "sign on to Github" link found in the VSCode status bar.

No such sign-on link ever showed up in my status bar but the auth code looked like this:

vscode-insiders://vscode.github-authentication/did-authenticate?windowid=1&code=65....

but I have found no place I can run that where it produces the desired result. At best I end up back at the waitlist sign on page.

The Guy
  • 129
  • 1
  • 6
0

I found that the reason was because my account never prompted me to allow the access as one of the top answers shows. It may have something to do with a firewall or other permissions (or bugs) on your machine. If you have access to another computer you can try to use Co-Pilot and see what happens. For me, everything worked on the second computer. Then you could compare and see what is different. In my case, it was my work's VPN that didn't allow. Once I disconnected from the VPN or tried another device, it worked fine.

Jeremy
  • 1,038
  • 11
  • 34
0

Just log out your github account and re-log-in it in VSCode

Wynne
  • 11
  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Oct 26 '21 at 03:56
0

Check if you behind a firewall or proxy

Majid Omar
  • 51
  • 4
0

Have you got the copilot beta? If not, you cant use it!

ouflak
  • 2,458
  • 10
  • 44
  • 49
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 22 '21 at 02:29
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/30399081) – Robert Nov 23 '21 at 14:26
0

Updating Github Copilot helped (for NVim + Vundle I did :BundleUpdate).

Serge Vinogradov
  • 710
  • 1
  • 9
  • 28
0

When you get approved from waiting list you will got on your email something like this:

Welcome to the Copilot chat private beta!

You're off the waitlist and can start using Copilot chat.

  1. Download and install Visual Studio Code - Insiders
  2. Already on the Insiders build? Make sure you are on the latest version!
  3. In VS Code Insiders, go to the Extensions tab (Cmd+Shift+X) in the activity panel and search for and install the GitHub Copilot Nightly extension.
  4. If you have not previously authorized VS Code Insiders in your GitHub account, follow the steps to do so, you will be prompted to sign in.
  5. A new Chat icon appears in the activity panel. Click on it to see the conversation interface.
  6. If that doesn't work, restart the editor and authorize GitHub Copilot to see the chat window.

After that you gonna see chat icon on the left and when you select the code with right click on mouse you gonna have Copilot -> Explain this or start code chat, and that's it!

easy peasy

hope this will help