乐闻世界logo
搜索文章和话题

How to install Visual Studio Code extensions from Command line

1个答案

1

Steps

  1. Open the command line tool:
    • On Windows, use CMD or PowerShell.
    • On macOS or Linux, use Terminal.
  2. Ensure the VSCode command-line tool code is installed:
    • By default, the code command is added to your system's PATH during VSCode installation. If not, manually add the VSCode installation directory to your PATH environment variable.
  3. Find the plugin's unique identifier:
    • Locate the desired plugin in the VSCode Marketplace. Each plugin's page URL contains its unique identifier, typically formatted as publisher.extension.
  4. Install the plugin using the command:
    • In the command line, enter the following command, replacing extension-id with the plugin's identifier:
      shell

code --install-extension extension-id ```

Example

  • To install the 'ESLint' plugin (identifier: dbaeumer.vscode-eslint):
    1. Open the command line window.
    2. Enter the command:
      shell

code --install-extension dbaeumer.vscode-eslint ``` 3. Press Enter to execute; VSCode will automatically download and install the plugin.

Summary

  • Following these steps allows you to install any required plugin via the command line without opening the VSCode main interface. This approach is ideal for developers preferring command-line workflows or scenarios requiring plugin installation in automation scripts.
2024年6月29日 12:07 回复

你的答案