Steps
- Open the command line tool:
- On Windows, use CMD or PowerShell.
- On macOS or Linux, use Terminal.
- Ensure the VSCode command-line tool
codeis installed:- By default, the
codecommand is added to your system's PATH during VSCode installation. If not, manually add the VSCode installation directory to your PATH environment variable.
- By default, the
- 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.
- Locate the desired plugin in the VSCode Marketplace. Each plugin's page URL contains its unique identifier, typically formatted as
- Install the plugin using the command:
- In the command line, enter the following command, replacing
extension-idwith the plugin's identifier:shell
- In the command line, enter the following command, replacing
code --install-extension extension-id ```
Example
- To install the 'ESLint' plugin (identifier:
dbaeumer.vscode-eslint):- Open the command line window.
- 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 回复