Newer Version Available

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

CLI Configuration Values

You can set CLI configuration values for your current project or for all projects.

To set a configuration value for the current project:

1sfdx force:config:set name=<value>

To set the value for all your projects:

1sfdx force:config:set name=<value> --global

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:list

To 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 --json

To 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
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.

The Salesforce CLI stores local configuration values in PROJECT_DIR/.sfdx/sfdx-config.json and global values in USER_HOME_DIR/.sfdx/sfdx-config.json. Do not edit or remove these files. Use force:config:list to view CLI configuration information.

Warning