Newer Version Available

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

Update Salesforce CLI

If you want to ensure that you’re running the latest version of Salesforce CLI, you can manually update it.

Determine How You Installed Salesforce CLI

Because the method to update or uninstall Salesforce CLI differs depending on whether you used the installers or npm, you must know how you installed before you can update or uninstall. In case you forgot, here are some tips.

  • Run sf update in a terminal (macOS and Linux) or command prompt (Windows). If Salesforce CLI successfully updates, then you installed with the installers. If the command returns this or similar warning, then you installed with npm:
    1sf update
    2 ›   Warning: Use "npm update --global @salesforce/cli" to update npm-based installations.
    3@salesforce/cli: Updating CLI... not updatable

    If you get an error similar to this one, then you’re probably still using sf (v1), which was bundled with sfdx (v7):

    1Running "sf update" has no effect because you're using a version of sf that was installed by sfdx.

    Both sf (v1) and sfdx (v7) are deprecated, so see Move from sfdx (v7) to sf (v2) for information on how to move to the latest supported version of Salesforce CLI, which is sf (v2).

  • Run npm list -g --depth 0. If you got valid output, and the displayed list includes the entry @salesforce/cli@<version>, then you installed Salesforce CLI with npm.

If You Installed Salesforce CLI Using the Installer

To install the latest Salesforce CLI and plugin versions, run this command in a terminal (macOS) or command prompt (Windows):
1sf update

By default, the CLI periodically checks for and installs updates. To disable auto-update, set the SF_AUTOUPDATE_DISABLE environment variable to true.

When you update Salesforce CLI, we automatically display the release notes for the version you're updating to so you can learn about the new, changed, and fixed features. To silence the display, set the SF_HIDE_RELEASE_NOTES and SF_HIDE_RELEASE_NOTES_FOOTER environment variables to true.

If You Installed Salesforce CLI Using npm

The auto-update option isn’t available. When a new version of the CLI is available, run this command in a terminal (macOS and Linux) or command prompt (Windows):
1npm install --global @salesforce/cli