About Opening a Directory in Visual Studio Code from Command Line

Use this command to open a directory in Visual Studio Code:

$ code .

or this one for opening it in Visual Studio Code - Insiders:

$ code-insiders .

However, first, you have to install the shell command:

  1. Open Visual Studio Code or Visual Studio Code - Insiders.
  2. Open the Command Palette by pressing Cmd + Shift + P on macOS or Ctrl + Shift + P elsewhere.
  3. Type "Shell Command: Install 'code' command in PATH" or "Shell Command: Install 'code-insiders' command in PATH" and select the option that appears.
  4. Restart the Terminal.

Tips and Tricks Development Developer Experience Visual Studio Code