Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automatically install extensions in VS Code?

Tags:

Is there some way to automatically install VS Code extensions when opening a project (like package.json but for vscode?)

If not, is there some way to install extensions at the command line?

like image 640
chadbr Avatar asked Mar 11 '16 00:03

chadbr


People also ask

Do VS Code extensions update automatically?

VS Code checks for extension updates and installs them automatically. After an update, you will be prompted to reload VS Code. If you'd rather update your extensions manually, you can disable auto-update with the Disable Auto Updating Extensions command that sets the extensions.autoUpdate setting to false .

Where does VS Code install extensions?

However, extensions are stored in %USERPROFILE%\. vscode\extensions on Windows.


2 Answers

Neither of those are currently possible. I created an issue some time ago for installing extensions via the command line, be sure to give it a +1 to show your interest.


Update

The recommended way of doing this is through workspace recommended extensions, this is a .vscode/extensions.json in your project that will prompt the user to install them when they first open the folder, the file looks like this:

{     "recommendations": [         "eg2.tslint",         "dbaeumer.vscode-eslint",         "msjsdiag.debugger-for-chrome"     ] } 

You can also try setting up a bash/bat script or some other automation to directly install the extensions using the CLI as suggested by parsley72 in the other answer. You will likely annoy users by doing this though, unless this is in a personal dotfiles project or something similar.

like image 55
Daniel Imms Avatar answered Oct 29 '22 21:10

Daniel Imms


The issue that @daniel-imms created was resolved in June 2017. You can see this in the latest version:

$ code -h Visual Studio Code 1.16.0  Usage: code [options] [paths...]  Options:   --extensions-dir <dir>                                       Set the root path for extensions.   --list-extensions                                            List the installed extensions.   --show-versions                                              Show versions of installed extensions, when using --list-extension.   --install-extension (<extension-id> | <extension-vsix-path>) Installs an extension.   --uninstall-extension <extension-id>                         Uninstalls an extension.   --enable-proposed-api <extension-id>                         Enables proposed api features for an extension.   --disable-extensions                                         Disable all installed extensions. 
like image 25
parsley72 Avatar answered Oct 29 '22 22:10

parsley72