Launch Visual Studio Code from Command Line

Visual Studio Code is an increasingly popular tool for developing software applications. It is comparable to Atom, Sublime Text etc.

To launch any tool from the command prompt, the path of the tool executable has to be present in PATH environmental variable. This is either done automatically at the time of installation of the tool or added later manually. Visual Studio Code made the manual addition step easier. Instead of dealing with paths and manual change of environmental variables, Visual Studio Code lets you add the executable path to PATH environmental variable right from the tool.

Step 1: Open the Command Palette from View menu

Step 2: Choose the option Shell Command: Install code command in PATH from the list of options

Step 3: Now open any file in Visual Studio code from command line or a script by typing code command.

# code <fileName>
code ~/.zshrc
Launch Visual Studio Code from Command Line
Be The First

Join our list to get instant access to new articles and weekly newsletter.

Tagged on:         
0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x