Open In App

How to Open Visual Studio Code Using Terminal

Last Updated : 05 Dec, 2025
Comments
Improve
Suggest changes
11 Likes
Like
Report

Launching VS Code directly from your terminal speeds up your workflow, reduces clicks, and makes navigation between projects seamless. Once the code command is added to your system PATH, you can open files, folders, or entire projects instantly.

Why Opening VS Code From Terminal Helps:

  • Faster navigation between projects
  • Quick file opening without browsing folders
  • Easier workflow for Git and Node.js developers
  • Clean, efficient, keyboard-friendly coding setup

Step 1: Add VS Code to Your System PATH

You only need to do this once.

  • Open Visual Studio Code
  • Press Ctrl + Shift + P (Windows/Linux) or Cmd + Shift + P (macOS)
  • Type “Shell Command”
  • Select Shell Command: Install ‘code’ command in PATH
  • Hit Enter

How-to-Open-VS-Code-Using-Terminal

Done! You can now launch VS Code from any terminal using the code command.

Note: Install VS Code first if you haven’t already (Windows, Mac or Ubuntu)

Step 2: Open VS Code From the Terminal

Open the Terminal

  • Windows: Open Command Prompt or PowerShell
  • macOS: Press Cmd + Space, type Terminal, press Enter
  • Ubuntu/Linux: Press Ctrl + Alt + T

Use the following commands to open VS Code.

  • Command 1: To open VS code in the current directory.

code .

  • Command 2: To open a specific file or folder in VS code.

code [path-to-file-or-folder]

  • Command 3: To start a new project in VS code

code -n

Check out: How to Create a File in VSCode using Terminal?

For more such commands, get help using the following command. It displays VS Code command-line options and descriptions.

code --help

code---help-command


Read also:


Article Tags :

Explore