Newer Version Available

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

Create a Scratch Org User

You sometimes need other users to test with different profiles and permission sets.

Use the force:user:create command to create a user. Specify the --setalias parameter to assign a simple name to the user that you can reference in later CLI commands. When the command completes, it outputs the new username and user ID.

Users are associated with a specific scratch org and Developer Hub. Specify the scratch org or Developer Hub username or alias at the command line if they aren’t already set by default in your environment. If you try to create a user for a non-scratch org, the force:user:create command fails.

The force:user:create command uses default and generated values for the new user, such as the user’s username, profile, and locale. You can customize the new user by creating a definition file and specifying it with the --definitionfile parameter.

View the list of users associated with a scratch org with the force:user:list command. The (A) on the left identifies the administrator user that was created at the same time that the scratch org was created.

Display details about a user with the force:user:display command.