Newer Version Available
CLI Runtime Configuration Values
To set a configuration value for the current project:
1sfdx force:config:set name=<value>For local configuration values, you must issue this command from within the Salesforce DX project directory.
To set the value for all your projects:
1sfdx force:config:set name=<value> --globalYou can issue global commands anywhere or within any project, yet they apply to all the Salesforce CLI commands you run.
You can view the local and global configuration values that you have set. The output lists the local values for the project directory from which you are running the command and all global values.
1sfdx force:config:listTo return one or more previously set configuration values, use force:config:get. It is often useful to specify JSON output for this command for easier parsing in a continuous integration (CI) environment. For example, to return the value of defaultusername and defaultdevhubusername:
1sfdx force:config:get defaultusername defaultdevhubusername --jsonTo unset a configuration value, set it to no value. For example, to unset the instanceUrl configuration value:
1sfdx force:config:set instanceUrl=You can set these CLI configuration values.
| Configuration Value Name | Description |
|---|---|
| apiVersion | The API version for a specific project or all projects. Normally, the Salesforce
CLI assumes that you’re using the same version of the CLI as your production org.
However, let’s say you decide to use the pre-release version of the CLI (v43 in Summer
‘18), but your production org is running the current API version (v42 in Spring ‘18).
In this case, you’d want to set this value to match the API version of your production
org (v42). This examples sets the API version for all projects (globally).
Be sure not to confuse this CLI configuration value with the sourceApiVersion project configuration value, which has a similar name. |
| defaultusername | The username for an org that all commands run against by default. |
| defaultdevhubusername | The username of your Dev Hub org that the force:org:create command defaults to. |
| instanceUrl | The URL of the Salesforce instance that is hosting your org. |