Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Possible to invoke a VSCode extension command from command line?

Is it possible to invoke a VSCode extension command from a terminal?

I'm aware of the code command and all the switches under the Extensions Management category. However, I do not understand if it's possible to invoke a command implemented within a VSCode extension from the command line or it is required that a user must invoke it from the editor's context?

I cannot seem to find a definitive answer after Googling and searching StackOverflow, so I'm asking as a new question. Any insights?

like image 745
ariestav Avatar asked Jan 28 '19 19:01

ariestav


People also ask

How do I run a VS Code extension in terminal?

You can also run VS Code from the terminal by typing 'code' after adding it to the path: Launch VS Code. Open the Command Palette (Cmd+Shift+P) and type 'shell command' to find the Shell Command: Install 'code' command in PATH command.

How do you run the install from VSIX command in VS Code?

All you need to do is press Ctrl+Shift+P and type 'vsix' in the command palette, and VS Code will suggest 'Extensions: Install from vsix…'. When you select this, you need to browse to the file, and hit the 'Install' button.


1 Answers

Ugly workaround I can use - https://marketplace.visualstudio.com/items?itemName=gabrielgrinberg.auto-run-command

write config file and start vscode (which should trigger that task, check if file exists, run commands) and close vscode

Sad, that there is no better solution for a while

like image 155
Vasiliy Vanchuk Avatar answered Oct 26 '22 14:10

Vasiliy Vanchuk