open project in vs code from terminal code example

Example 1: code command line options

code -r <path-to-working-directory>

Example 2: vs code a project folder from the command line

cd my-project-folder/
code -n .

Example 3: open vs code from terminal

Launch VS Code.
Open the Command Palette (Cmd+Shift+P) and type 'shell command' to find the Shell Command: Install 'code' command in PATH command.
Restart the terminal
Navigate to project folder in terminal, 
Type code . press enter

Example 4: open project in vs code from terminal

// Navigate to your project directory in terminal 
// then enter the below command 

open -a 'Visual Studio Code' .

// the above will open the whole project folder 
// if you wan to only open a single file from the project use

open -a 'Visual Studio Code' fileName.html

Tags:

Css Example