Press enter to see results or esc to cancel.

Understand the complete setup of Salesforce CLI plugin

In the previous blog post we have seen what is sfdx and installation of Salesforce CLI and usage of commands. In this blog post we will try to check the complete setup of Salesforce CLI plugin.

We have installed the Salesforce CLI on our machine.
What if there are some updates available?
How do you update the plugin?
What if you don’t want to auto update the CLI?
There will be some project requirements that needs older version of CLI and some requires the newer version, How do you approach in that use case?
Well I have covered most of them in this blog post.
sfdx plugins –core this command will return all the core plugins available and contributing towards sfdx-cli.
sfdx plgins --core
How do you update the Salesforce CLI Plugin?
To update the plugin, Open the command prompt and enter sfdx update. If there is any update available system will update to the latest version. If there is none, you will be shown with CLI is already on the latest version.
sfdx update

How to auto disable the updates?

Salesforce automatically checks for the updates. In case if you want to disable the updates, we need to set the SFDX_AUTOUPDATE_DISABLE environment variable to true.

Tip: For windows machine use “set SFDX_AUTOUPDATE_DISABLE=true” to set the environment variable.

Once you set the environment variable to true the updates are stopped and you won’t be able to install the latest versions.

sfdx set 

What are these CLI environment variables and how to use them? 
 

You can set CLI environment variables to set certain values that Salesforce CLI and SFDX use. Like in the above example we have set SFDX_AUTOUPDATE_DISABLE to true to disable the update.

Please refer to this documentation for all the available CLI Environment Variables.

 
How to install specific version of CLI? 
 
Run this command sfdx plugins:install salesforcedx@47. Where you can change the 47 to different number like 47.1.0 / 47.8.1 like that to get the specific version of CLI.
How to Uninstall CLI and salesforcedx plugin? 
  1. In windows go to Start > Control Panel > Programs > Programs and Features then select Salesforce CLI and uninstall it.
  2. TO uninstall salesforcedx you can use this command: sfdx plugins:uninstall salesforcedx

How to use the Salesforce CLI behind a Company Firewall?

Please refer to this documentation.

These are some basic setups we can do at the initial stage going forward with the process we will set the run time variables also. I will cover that in another blog post.

If you want to refer the entire setup documentation please refer here.

Thanks for reading 🙂 In case if you have any specific question feel free to drop a comment.