1

This article (Select the Salesforce Release for a Scratch Org) describes the ability to globally configure the default api version for created scratch orgs via the force:config:set command:

sfdx force:config:set apiversion=46.0 --global

Which sets the apiversion key in ~/.sfdx/sfdx-config.json.

Is there a published listing (or programmatic way to query) of all the available keys we can set in sfdx-config.json? That is, where can I find a full enumeration of global configuration values which can be set on my machine?

I would love to, for example, be able to change my system-wide default durationDays value from 7 to 1.

3

There are 2 different config files. One for the CLI configs (the one you referenced) and one for the scratch org configuration. This last one has a default and is a different file under the config folder called project-scratch-def.json. You can have many files for different scratch org configurations in a single project. When you create a scratch ORG you are forced to provide this file as a mandatory parameter on the create command. Unfortunately the parameter you would like to use is specified per scratch ORG (cannot be set globaly in the CLI config file)

CLI config file: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_cli_config_values.htm

Scratch Org definition file: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_scratch_orgs_def_file.htm

That said, you could create a global scratch ORG file that you always reference when creating your scratch orgs. It does not have to be project dependent nor stored in the project for it to be provided to the create command.

  • It looks like the first article you linked gives info on the sfdx-project.json file in the project directory - I'm thinking of the global sfdx-config.json file. I've updated my question to clarify the request. – Thom B Nov 12 at 17:53
  • Updated answer to point at the correct file (it has limited parameters unfortunately) – Glen De Marcos Nov 12 at 18:44
  • Thank you! At least now I have a page to keep an eye on :). – Thom B Nov 12 at 19:14
0

You can check this URL for the possible keys of the JSON file at this URL.

  • It looks like the article you linked gives info on the sfdx-project.json file in the project directory - I'm thinking of the global sfdx-config.json file. I've updated my question to clarify the request. – Thom B Nov 12 at 17:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.