Automatically install extensions in VS Code?

Thanks to Daniel's suggestion, and I find if you want to keep a list of vscode extensions and install all of them in single click, you can try this approach:

  1. Create the list of extensions you want using the workspace recommended extensions
  • Use the Configure Recommended Extensions command to create the extensions.json file Configure Recommended Extensions You will create a file like this:
{
  // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
  // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
  // List of extensions which should be recommended for users of this workspace.
  "recommendations": [
    "ms-vscode.cpptools",
    "file-icons.file-icons",
    "shd101wyy.markdown-preview-enhanced",
    "sagebind.mathpad",
    "johnpapa.vscode-peacock"
  ],
  // List of extensions recommended by VS Code that should not be recommended for users of this workspace.
  "unwantedRecommendations": []
}

  • Add your favorite vscode extension id into the list in JSON
  1. Re-launch vscode to open the workspace folder (the parent folder for .vscode folder)
  2. Navigate to "Extensions", filter extensions using "Recommended" filter filter extensions
  3. A list of extensions will be shown in "Workspace Recommendations"
  4. Click the ☁️ button to install all extensions at once enter image description here

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.


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.