Automatically install extensions in VS Code?

Viewed 13099

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?

4 Answers

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
Related