Newer Version Available

This content describes an older version of this product. View Latest

Install Other Versions of Salesforce CLI Plugins

Sometimes you want to use a specific version of a plugin. For example, let’s say Salesforce fixed a bug in the apex run command. The fix has been released in the associated plugin, but Salesforce hasn’t yet included that plugin release in the current Salesforce CLI. But you want to test the bug fix in your local development environment. Follow these steps to install the version of the plugin that has the fix.
  1. Determine the plugin that contains the command by running the which command. This example shows that the apex run command is in the plugin-apex plugin.
    1sf which apex run
    2=== apex run
    3
    4plugin: @salesforce/plugin-apex
  2. Find the plugin’s repository with the Salesforce CLI Status page. Then navigate to its GitHub repo, such as @salesforce/plugin-apex, which lists all the releases and tags.
  3. Install the version that contains the bug fix. For example, to install version 2.2.22 of the apex plugin, run this command:
    1sf plugins install apex@2.2.22
    The preceding example uses the plugin’s short name, which is shown in the output of sf plugins --core. You can also use the plugin’s long name, which is the name property in the plugin’s package.json file.
    1sf plugins install @salesforce/plugin-apex@2.2.22

    When you now run sf plugins --core, the apex plugin entry shows the newly installed version rather than (core).

    1apex 2.2.21 (2.2.22)
  4. When you finish testing, go back to using the current version of the plugin by uninstalling the tagged version.
    1sf plugins uninstall apex

    When you install a specific plugin version using a tag, such as 2.2.22, you stay with that tag until you explicitly uninstall it.

    Important