Newer Version Available
Override or Add Definition File Options at the Command Line
Some CLI commands, such as force:org:create and
force:user:create, use a JSON definition file to
determine the characteristics of the org or user they create. The definition file contains one
or more options. You can override some options by specifying them as name-value pairs at the
command line. You can also specify options that aren’t in the definition file. This technique
allows multiple users or continuous integration jobs to share a base definition file and then
customize options when they run the command.
Let’s say you use the following JSON definition file to create a scratch org. By default, the scratch org definition is named project-scratch-def.json.
1{
2 "orgName": "Acme",
3 "country": "US",
4 "edition": "Enterprise",
5 "hasSampleData": "true",
6 "features": ["MultiCurrency", "AuthorApex"],
7 "settings": {
8 "mobileSettings": {
9 "enableS1EncryptedStoragePref2": true
10 },
11 “chatterSettings” : {
12 "enableChatter": true
13 },
14 "nameSettings": {
15 "enableNameSuffix": false
16 }
17
18 }
19}To create an Enterprise Edition scratch org that uses all the options in the file, run this command.
1sfdx force:org:create --definitionfile project-scratch-def.jsonYou can then use the same definition file to create a Developer Edition scratch org that doesn’t have sample data by overriding the edition and hasSampleData options.
1sfdx force:org:create --definitionfile project-scratch-def.json edition=Developer hasSampleData=falseUse commas to separate multiple array values, and enclose them in double quotes. For example, to change the features option:
1sfdx force:org:create --definitionfile project-scratch-def.json features="MultiCurrency,PersonAccounts"This example shows how to add the adminEmail option, which doesn’t exist in the definition file.
1sfdx force:org:create --definitionfile project-scratch-def.json adminEmail=john@doe.org