"code ." command is not working

For Mac OS, You can paste this into your terminal, or in your .bashrc file (or whatever shell config file you are using) :

export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"

It looks as if you do not have the code program installed. You can open the Command Palette,

  • Mac: ShiftCmdP
  • Windows/Linux: ShiftCtrlP

And search "install command", which should return this as one of the options:

  • Shell Command: Install 'code' command in PATH

Run that, and it should install the code command, after which you should be able to use it.


I found it. In the "search" type environment variables then click on the "edit system environment variables".

Inside Environment variables->Path put C:\Users\{your_username}\AppData\Local\Programs\Microsoft VS Code\bin.

Go to the project folder and open the cmd with it typing in the location bar and then type code .

That will do.