DEV Community

Oleksandr Demian
Oleksandr Demian

Posted on

How to open a project/folder with your favorite IDE from command line

The esiest way to open a project/folder from terminal is to use open-ide npm package. Here is how:

1) Installation

Install open-ide globaly from npm:

npm i -g open-ide
Enter fullscreen mode Exit fullscreen mode

2) Add your editors

open-ide add <alias> <path>
Enter fullscreen mode Exit fullscreen mode

Example:

open-ide add vscode C:\PATH\TO\VSCODE\Code.exe
Enter fullscreen mode Exit fullscreen mode

3) Enjoy

Now, you can execute open-ide in any folder, and it will be opened inside of your editor. If you have multiple editors, you can specify the one you want to use by passing it as first argument to the command:

open-ide vscode
Enter fullscreen mode Exit fullscreen mode

Otherwise open-ide will ask you to choose the editor (from a list)

Note: if you have only one editor declared, it will be used as default

open-ide is an open source project hosted on Github

Top comments (0)