Newer Version Available

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

CLI Runtime Configuration Values

You can set CLI runtime configuration values for your current project or for all projects. You can set two kinds of configuration values: global and local. Global values apply to all projects on your computer. Local values apply to a specific project. Local values override global values when commands are run from within a Salesforce DX project directory.

To set a configuration value for the current project:

1sfdx 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 config:set name=<value> --global

You 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 config:list
1=== Config
2Name                   Value                  Location
3─────────────────────  ─────────────────────  ────────
4apiVersion             50.0                   Local
5defaultdevhubusername  my-dev-hub@force.com   Global

To return one or more previously set configuration values, use 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 config:get defaultusername defaultdevhubusername --json

To unset a configuration value, run the config:unset command. For example, to unset the instanceUrl configuration value:

1sfdx config:unset instanceUrl

Alternately, you can set all CLI configuration values as environment variables. Environment variables override configuration values.

Note

You can set these CLI configuration values.

apiVersion
The API version for a specific project or all projects. Normally, the CLI assumes that you’re using the same version of the CLI as the Dev Hub org.

Let’s say you decide to use the pre-release version of the CLI (v43 in Summer ‘18). But your Dev Hub org is running the current API version (v42 in Spring ‘18). In this case, set this value to match the API version of your Dev Hub org (v42).

This example sets the API version for all projects (globally).
1sfdx config:set apiVersion=42.0 --global

Be sure not to confuse this CLI configuration value with the sourceApiVersion project configuration value, which has a similar name.

Environment variable: SFDX_API_VERSION

1SFDX_API_VERSION=42.0
defaultusername
The username for an org that all commands run against by default.
1sfdx config:set defaultusername=test-scratch-org@example.com

Environment variable: SFDX_DEFAULTUSERNAME

1SFDX_DEFAULTUSERNAME=test-scratch-org@example.com
defaultdevhubusername
The username for your default Dev Hub org.
1sfdx config:set defaultdevhubusername=my-dev-hub@devhub.org

Environment variable: SFDX_DEFAULTDEVHUBUSERNAME

1SFDX_DEFAULTDEVHUBUSERNAME=my-dev-hub@devhub.org
disableTelemetry
By default, the CLI collects usage information, user environment information, and crash reports. This option enables you to opt out.
1sfdx config:set disableTelemetry=true

Environment variable: SFDX_DISABLE_TELEMETRY

instanceUrl
The URL of the Salesforce instance that is hosting your org. Default value is https://login.salesforce.com.
1sfdx config:set instanceUrl=https://yoda.my.salesforce.com

Environment variable: SFDX_INSTANCE_URL

1SFDX_INSTANCE_URL=https://yoda.my.salesforce.com
maxQueryLimit
The maximum number of Salesforce records returned by a CLI command. Default value is 10,000.

For example, let’s say you run sfdx force:mdapi:listmetadata -m Role on a Salesforce org that has 15,000 roles. By default the command displays only 10,000 roles. A message warns you that the command retrieved only some of the roles. To see all of them, set this config value to a larger number.

1sfdx config:set maxQueryLimit=20000

Environment variable: SFDX_MAX_QUERY_LIMIT

1SFDX_MAX_QUERY_LIMIT=200000
restDeploy
If true, the CLI uses Metadata REST API for deployments. By default, Salesforce CLI uses SOAP. Deployments using REST aren’t bound by the 39 MB .zip file size limit that applies to SOAP deployments.
1sfdx config:set restDeploy=true

Environment variable: SFDX_REST_DEPLOY

1SFDX_REST_DEPLOY=true