Newer Version Available
CLI Runtime Configuration Values
To set a configuration value for the current project:
1sfdx config:set name=<value>
2sf 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
2sf 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’re running the command and all global values.
1sfdx config:list
2sf config list1List Config
2==========================================================
3| Name Value Location
4| ─────────────────── ─────────────────────────── ────────
5| org-instance-url https://test.salesforce.com Local
6| org-max-query-limit 20000 Local
7| target-dev-hub DevHub LocalTo return one or more previously set configuration values, use config get. It’s 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 (target-org) and defaultdevhubusername (target-dev-hub):
1sfdx config:get defaultusername defaultdevhubusername --json
2sf config get target-org target-dev-hub --jsonTo unset a configuration value, run the config unset command. For example, to unset the instanceUrl (org-instance-url) configuration value:
1sfdx config:unset instanceUrl
2sf config unset org-instance-urlYou can set these CLI configuration values.
- apiVersion (sfdx), org-api-version (sf)
- 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.This example sets the API version for all projects (globally) to 51.0.
1sfdx config:set apiVersion=57.0 --global 2sf config set org-api-version=57.0 --globalBe sure not to confuse this CLI configuration value with the sourceApiVersion project configuration value, which has a similar name.
Environment variable: SFDX_API_VERSION (sfdx), SF_ORG_API_VERSION (sf)
1SFDX_API_VERSION=57.0 - customOrgMetadataTemplates (sfdx), org-custom-metadata-templates (sf)
- Specifies either a local directory or a cloned GitHub repository that contains the
default custom code templates used by the force:project:create command. The GitHub URL points to either the root
directory that contains your templates or to a subdirectory on a branch in the repo that
contains your templates. For example:
1sfdx config:set customOrgMetadataTemplates=https://github.com/mygithubacct/salesforcedx-templates 2sf config set org-custom-metadata-templates=https://github.com/mygithubacct/salesforcedx-templatesEnvironment variable: SFDX_CUSTOM_ORG_METADATA_TEMPLATES (sfdx), SF_ORG_CUSTOM_METADATA_TEMPLATES (sf)
1SFDX_CUSTOM_ORG_METADATA_TEMPLATES=https://github.com/mygithubacct/salesforcedx-templates - defaultusername (sfdx), target-org (sf)
- The username for an org that all commands run against by default.
1sfdx config:set defaultusername=test-scratch-org@example.com 2sf config set target-org=test-scratch-org@example.comEnvironment variable: SFDX_DEFAULTUSERNAME (sfdx), SF_TARGET_ORG (sf)
1SFDX_DEFAULTUSERNAME=test-scratch-org@example.com - defaultdevhubusername (sfdx), target-dev-hub (sf)
- The username for your default Dev Hub org.
1sfdx config:set defaultdevhubusername=my-dev-hub@devhub.org 2sf config set target-dev-hub=my-dev-hub@devhub.orgEnvironment variable: SFDX_DEFAULTDEVHUBUSERNAME (sfdx), SF_TARGET_DEV_HUB (sf)
1SFDX_DEFAULTDEVHUBUSERNAME=my-dev-hub@devhub.org - disableTelemetry (sfdx), disable-telemetry (sf)
- 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 2sf config set disable-telemetry=trueEnvironment variable: SFDX_DISABLE_TELEMETRY (sfdx), SF_DISABLE_TELEMETRY (sf)
- instanceUrl (sfdx), org-instance-url (sf)
- The URL of the Salesforce instance that is hosting your org. Default value is https://login.salesforce.com. We recommend that you set
this value to the My Domain login URL for your org. You can find the My Domain login URL
on the My Domain page in Setup.
1sfdx config:set instanceUrl=https://yoda.my.salesforce.com 2sf config set org-instance-url=https://yoda.my.salesforce.comEnvironment variable: SFDX_INSTANCE_URL (sfdx), SF_ORG_INSTANCE_URL (sf)
1SFDX_INSTANCE_URL=https://yoda.my.salesforce.com - maxQueryLimit (sfdx), org-max-query-limit (sf)
- 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 2sf config set org-max-query-limit=20000Environment variable: SFDX_MAX_QUERY_LIMIT (sfdx), SF_ORG_MAX_QUERY_LIMIT (sf)
1SFDX_MAX_QUERY_LIMIT=200000
- restDeploy (sfdx), org-metadata-rest-deploy (sf)
- 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 2sf config set org-metadata-rest-deploy=trueEnvironment variable: SFDX_REST_DEPLOY (sfdx), SF_ORG_METADATA_REST_DEPLOY (sf)