Newer Version Available
Uninstall Salesforce CLI or Plugins
macOS or Linux
Enter all these commands in a terminal to remove Salesforce CLI. The commands uninstall both sfdx (v7) and sf (v1 and v2).
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/sfWindows
These steps uninstall both sfdx (v7) and sf (v1 and v2):
- Select .
- Select @salesforce/cli, and click Uninstall.
- 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
- To uninstall sfdx (v7), run this npm command from a terminal or command
prompt:
1npm uninstall sfdx-cli --globalTo uninstall sf (v1 or v2), run this command:
1npm uninstall @salesforce/cli --global - 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 ~/.sfOn Windows, delete these directories in your home directory:
- .sfdx
- .sf
Uninstall a Plugin
Use the plugins:uninstall command to uninstall a plugin you’ve previously installed.
Let’s say, for example, that you previously installed a specific version of the auth plugin, but now you want to go back to the latest version. Uninstalling the plugin takes you back to the core version that’s bundled with the CLI. Enter this command from a terminal or Windows command prompt:
1sf plugins:uninstall authIf the plugin is standalone and not bundled with the CLI, then uninstalling it removes it from Salesforce CLI.