I want to open multiple vscodes with one command and execute commands to build a server in each vscode such as docker-compose up or npm run dev.

Asked 2 years ago, Updated 2 years ago, 141 views

If you are developing in practice, you will often open many projects simultaneously in vscode and build servers for each project (docker-compose up, npm run dev, rails, etc.).
It would be nice if it's 2 pieces, but recently due to the trend of microservices, I often set up many servers at the same time during development.

When I restart my Mac, all the vscodes will be closed, and of course all the servers will be shut down.
Currently, we open each project in vscode from the GUI and have about 5 vscodes, so we are running docker-compose up and npm run dev on each terminal.

However, this is so hard that I'm thinking about how to do well with shell scripts or something, and how to open five projects at once in vscode and build servers on each vscode.

First of all, I found a way to launch vscode from above the command.

How to launch Visual Studio Code from a terminal [official method]

code<project path>

However, I am struggling to find a way to successfully start a server on each vscode with just one command.
If you have any ideas or solutions, please let me know.

I look forward to your kind cooperation.

vscode docker-compose

2022-09-29 20:25

1 Answers

VSCode is only an editor.It is true that you can also invoke the functionality of the terminal, but if you don't mind "Starting VSCode automatically and starting each server at the terminal in it…", it would be sufficient to write docker-compose and npm commands in the shell script.


2022-09-29 20:25

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.