Is there any way to change definition of default user created for scratch org?

I would like the default Administrator user to have properties

UserPreferencesUserDebugModePref UserPreferencesApexPagesDeveloperMode

set to true.

I know that I could create a config file adminUser.json with content

"ProfileName":"System Administrator",
"LastName":"Debug Mode Admin"}

and I could execute two commands

call sfdx force:org:create -s -d 30 -f config/DE.json -a ScratchOrg
call sfdx force:user:create -f config/adminUser.json -a DebugModeAdmin

but I don't want two users to be created but rather I would like the default user created by force:org:create command to have debug mode set. Is this possible? How can this be achieved?


You can use data update command from CLI to update the User record after Scratch Org creation. Refer here for documentation on SFDX data commands: https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_force_data.htm

Refer this thread which does it with a cli plugin so that name/id field doesn't has to be hard-coded. How to customize the auto-generated user of a DX scratch org

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