Newer Version Available

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

Uninstall Salesforce CLI or Plugins

Uninstalling Salesforce CLI removes it entirely from your computer.

macOS or Linux

Enter all these commands in a terminal to remove Salesforce CLI. The commands uninstall both the sfdx and sf executables.

1sudo rm -rf /usr/local/sfdx
2sudo rm -rf /usr/local/lib/sfdx
3sudo rm -rf /usr/local/bin/sfdx
4sudo rm -rf ~/.local/share/sfdx ~/.config/sfdx ~/.cache/sfdx
5sudo rm -rf ~/Library/Caches/sfdx
6sudo rm -rf /usr/local/sf
7sudo rm -rf /usr/local/bin/sf
8sudo rm -rf ~/.local/share/sf ~/.config/sf ~/.cache/sf
9sudo rm -rf ~/Library/Caches/sf

Windows

These steps uninstall both the sfdx and sf executables:

  1. Select Start > Control Panel > Programs > Programs and Features.
  2. Select SFDX CLI, and click Uninstall.
  3. Inside your home directory, delete these two directories:
    • .config\sfdx
    • .config\sf

If Salesforce CLI is still installed, delete these directories:

  • %LOCALAPPDATA%\sfdx
  • %LOCALAPPDATA%\sf

npm

These steps uninstall both the sfdx and sf executables from your computer.

  1. From a terminal or command prompt, run these npm commands to uninstall the two executables:
    1npm uninstall sfdx-cli --global
    2npm uninstall @salesforce/cli --global
  2. Inside your home directory, delete these two directories.
    • Library/Caches/sfdx (On Windows: Library\Caches\sfdx)
    • Library/Caches/sf (On Windows: Library\Caches\sf)

Remove Authorization and Log Files

After uninstalling Salesforce CLI, your computer still has data specific to your CLI usage, such as log files and authorization information about the orgs you’ve logged into or created. Retaining these files is useful if you later reinstall Salesforce CLI, because you don’t have to reauthorize these orgs and you can view your old logs. But if you want to remove these files too, run these commands.

On macOS or Linux:

1sudo rm -rf ~/.sfdx
2sudo rm -rf ~/.sf

On Windows, delete these directories in your home directory:

  • .sfdx
  • .sf

Uninstall a Plugin

Use the plugins:uninstall command to uninstall a plug-in you’ve previously installed.

Let’s say, for example, that you previously installed a specific version of the auth plug-in, but now you want to go back to the latest version. Uninstalling the plug-in takes you back to the core version that’s bundled with the CLI. Enter this command from a terminal or Windows command prompt:

1sfdx plugins:uninstall auth

If the plug-in is standalone and not bundled with the CLI, then uninstalling it removes it from Salesforce CLI.