Open Any Project Instantly with VS Code from Your Terminal

You have VS Code installed on your computer and all you want is to open a file or folder with the editor from the command line. All you need to do is to specify the path of the file or folder that you want to open with the “code” command.

Open Any Project Instantly with VS Code from Your Terminal

Stop Clicking Around Your File Explorer

If you’re still:

  • opening Finder/Explorer
  • navigating folders manually
  • right-clicking “Open with VS Code”

…you’re wasting seconds that add up fast.

There’s a much cleaner workflow:

code .

That single command opens your current folder directly in Visual Studio Code.

Once you get used to it, there’s no going back.

The Magic Command

Navigate to any project in your terminal:

Then run code . :

Boom. Your entire project opens instantly in VS Code.

The . simply means:

“Opens the current directory.”

Open Specific Files Too

You can also open individual files directly:

code app.js

Or multiple files:

code index.html styles.css

Code Doesn’t Work

You probably haven’t added VS Code to your system PATH yet.

On macOS

  1. Open Visual Studio Code
  2. Press Cmd + Shift + P
  3. Search for Shell Command: Install 'code' command in PATH
  1. Press Enter
  1. Just type code --v in the command line for control. You will see the installed version number.