skip to Main Content

Is it possible to install VSCode Modules/Extensions from the command line or via Powershell?

I would like to deploy unattended installations with the Modules/Extensions already installed

2

Answers


  1. Use code --install-extension <ext-id | path>

    Directly from code --help:
    enter image description here

    Login or Signup to reply.
  2. It is possible. The documentation of VSCode describes the operations that can be performed with extensions using the command line:

    To make it easier to automate and configure VS Code, it is possible to list, install, and uninstall extensions from the command line. When identifying an extension, provide the full name of the form publisher.extension, for example ms-python.python.

    Example:

    code --extensions-dir <dir>
        Set the root path for extensions.
    code --list-extensions
        List the installed extensions.
    code --show-versions
        Show versions of installed extensions, when using --list-extension.
    code --install-extension (<extension-id> | <extension-vsix-path>)
        Installs an extension.
    code --uninstall-extension (<extension-id> | <extension-vsix-path>)
        Uninstalls an extension.
    code --enable-proposed-api (<extension-id>)
        Enables proposed API features for extensions. Can receive one or more extension IDs to enable individually.
    

    You can always get this information (together with the other command line options) by running in your terminal:

    code --help
    

    The command you are looking for is:

    code --install-extension <extension-id>
    

    Replace <extension-id> with the ID of the extension you want to install. You can find the extension ID in VSCode, in the extension details page (see the bottom-right corner of the image below)

    The extension details page of the ESLint VSCode extension

    You can also find the extension ID on the extension’s page in Marketplace, roughly on the same area of the page (it is called "Unique Identifier").

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search