estruyf / vscode-remote-control

Remote Control your Visual Studio Code - This extension allows you to remotely control Visual Studio Code. Run commands from anywhere you want on your device. The extension allows you to take VSCode automation to the next level.
https://marketplace.visualstudio.com/items?itemName=eliostruyf.vscode-remote-control
MIT License
22 stars 8 forks source link
code control extension remote remote-control vscode vscode-extension

Remote Control

Visual Studio Marketplace Number of installs Ratings Buy me a coffee

This extension allows you to remotely control Visual Studio Code. Run commands from anywhere you want on your device. The extension allows you to take VSCode automation to the next level.

In the background it uses websockets in order to listen to commands it should execute in your VSCode instance.

Info: This is a sample of how I use the Remote Control extension in combination with the macOS Raycast app.

Extension Settings

The extension has the following settings which you can use to configure it:

Current port in use

Once the extension starts, it will show the port number in the status bar. This way you can easily see which port is used.

Usage

When you install this extension, it will automatically open a websocket on port 3710. This port can be changed on in the VSCode settings. When you are going to use multiple VSCode sessions at the same time, it is best to configure it on workspace level or use the remoteControl.fallbacks setting to specify fallback ports when the previous one is already in use.

Once installed, you can execute commands for VSCode remotely by calling the Remote Control its websocket. Here is an example how to open the terminal in VSCode:

echo "{ \"command\": \"workbench.action.terminal.new\" }" | websocat ws://localhost:3710

The text you need to pass to the websocket listener is as you can see a stringified JSON object. The object currently consists of:

How do I get the command ID?

To get the command ID, open the Command Palette and type Show all commands. This will give you a list with all the available commands.

Behind each command, there is a gear button. When you click on it, it brings you to the shortcut configuration. Where you can right-click on the command and copy its ID.

Feedback / issues / ideas

Please submit your feedback/issues/ideas by creating an issue in the project repository: issue list.