Newer Version Available

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

Install and Update sf

You can install sf with the Salesforce CLI installers, TAR files, or npm. The steps are mostly similar to how you install sfdx except if you use npm.

Don’t install sf using both an installer (or TAR file) and npm. Installing it both ways can lead to confusing path issues on your computer, sometimes without an explicit error and thus difficult to diagnose.

Warning

Install sf With the Salesforce CLI Installer or TAR File

The Salesforce CLI installers and TAR files bundle both sfdx and sf together. As a result:

  • When you install Salesforce CLI using the *.pkg installer (macOS), *.exe installer (Windows), or a TAR file, both the sfdx and sf executables are installed.
  • When you subsequently run sfdx update, the sf executable is also updated.
To install sf using installers or TAR files, see these sections:
After you’ve installed Salesforce CLI, run this command to update it to the latest version:
1sfdx update

To update to the weekly release candidate, which contains changes that we plan to include in the following week’s version:

1sfdx update stable-rc

To return to the latest version after you’ve updated to the release candidate:

1sfdx update stable

Install sf With npm

In contrast to the installers and TAR files, the npm versions of sf and sfdx aren’t bundled together. You must install each executable separately. You must also subsequently update each executable separately.

To install sf with npm, run this command:

1npm install --global @salesforce/cli

To update to the latest version, run this command:

1npm install --global @salesforce/cli@latest
To update to the release candidate:
1npm install --global @salesforce/cli@latest-rc