user Commands
force:user:create
Command Syntax
- sfdx force:user:create
- [--json]
- [--loglevel LOGLEVEL]
- [-v TARGETDEVHUBUSERNAME]
- [-u TARGETUSERNAME]
- [--apiversion APIVERSION]
- [-f DEFINITIONFILE]
- [-a SETALIAS]
Parameters
- --json
- Optional
-
Format output as JSON.
- Type: boolean
- --loglevel LOGLEVEL
- Optional
-
The logging level for this command invocation. Logs are stored in $HOME/.sfdx/sfdx.log.
- Type: enum
- Permissible values are: trace, debug, info, warn, error, fatal, TRACE, DEBUG, INFO, WARN, ERROR, FATAL
- Default value: warn
- -v | --targetdevhubusername TARGETDEVHUBUSERNAME
- Optional
-
A username or alias for the target Dev Hub org. Overrides the default Dev Hub org.
- Type: string
- -u | --targetusername TARGETUSERNAME
- Optional
-
A username or alias for the target org. Overrides the default target org.
- Type: string
- --apiversion APIVERSION
- Optional
-
Override the API version used for API requests made by this command.
- Type: string
- -f | --definitionfile DEFINITIONFILE
- Optional
-
File path to a user definition.
- Type: filepath
- -a | --setalias SETALIAS
- Optional
-
Sets an alias for the created username to reference within the CLI.
- Type: string
Help for force:user:create
Create a user for a scratch org, optionally setting an alias for use by the CLI, assigning permission sets (e.g., permsets=ps1,ps2), generating a password (e.g., generatepassword=true), and setting User sObject fields.
Examples:
1$ sfdx force:user:create1$ sfdx force:user:create -a testuser1 -f config/project-user-def.json1$ sfdx force:user:create username=testuser1@my.org email=me@my.org permsets=DreamHouse1$ sfdx force:user:create -f config/project-user-def.json email=me@my.org generatepassword=trueforce:user:display
Command Syntax
- sfdx force:user:display
- [--json]
- [--loglevel LOGLEVEL]
- [-v TARGETDEVHUBUSERNAME]
- [-u TARGETUSERNAME]
- [--apiversion APIVERSION]
Parameters
- --json
- Optional
-
Format output as JSON.
- Type: boolean
- --loglevel LOGLEVEL
- Optional
-
The logging level for this command invocation. Logs are stored in $HOME/.sfdx/sfdx.log.
- Type: enum
- Permissible values are: trace, debug, info, warn, error, fatal, TRACE, DEBUG, INFO, WARN, ERROR, FATAL
- Default value: warn
- -v | --targetdevhubusername TARGETDEVHUBUSERNAME
- Optional
-
A username or alias for the target Dev Hub org. Overrides the default Dev Hub org.
- Type: string
- -u | --targetusername TARGETUSERNAME
- Optional
-
A username or alias for the target org. Overrides the default target org.
- Type: string
- --apiversion APIVERSION
- Optional
-
Override the API version used for API requests made by this command.
- Type: string
Help for force:user:display
Output includes the profile name, org ID, access token, instance URL, login URL, and alias if applicable.
Examples:
1$ sfdx force:user:display1$ sfdx force:user:display -u me@my.org --jsonforce:user:list
Command Syntax
- sfdx force:user:list
- [--json]
- [--loglevel LOGLEVEL]
- [-v TARGETDEVHUBUSERNAME]
- [-u TARGETUSERNAME]
- [--apiversion APIVERSION]
Parameters
- --json
- Optional
-
Format output as JSON.
- Type: boolean
- --loglevel LOGLEVEL
- Optional
-
The logging level for this command invocation. Logs are stored in $HOME/.sfdx/sfdx.log.
- Type: enum
- Permissible values are: trace, debug, info, warn, error, fatal, TRACE, DEBUG, INFO, WARN, ERROR, FATAL
- Default value: warn
- -v | --targetdevhubusername TARGETDEVHUBUSERNAME
- Optional
-
A username or alias for the target Dev Hub org. Overrides the default Dev Hub org.
- Type: string
- -u | --targetusername TARGETUSERNAME
- Optional
-
A username or alias for the target org. Overrides the default target org.
- Type: string
- --apiversion APIVERSION
- Optional
-
Override the API version used for API requests made by this command.
- Type: string
Help for force:user:list
The original scratch org admin is marked with "(A)"
Examples:
1$ sfdx force:user:list1$ sfdx force:user:list -u me@my.org --json1$ sfdx force:user:list --json > tmp/MyUserList.jsonforce:user:password:generate
Command Syntax
- sfdx force:user:password:generate
- [--json]
- [--loglevel LOGLEVEL]
- [-v TARGETDEVHUBUSERNAME]
- [-u TARGETUSERNAME]
- [--apiversion APIVERSION]
- [-o ONBEHALFOF]
Parameters
- --json
- Optional
-
Format output as JSON.
- Type: boolean
- --loglevel LOGLEVEL
- Optional
-
The logging level for this command invocation. Logs are stored in $HOME/.sfdx/sfdx.log.
- Type: enum
- Permissible values are: trace, debug, info, warn, error, fatal, TRACE, DEBUG, INFO, WARN, ERROR, FATAL
- Default value: warn
- -v | --targetdevhubusername TARGETDEVHUBUSERNAME
- Optional
-
A username or alias for the target Dev Hub org. Overrides the default Dev Hub org.
- Type: string
- -u | --targetusername TARGETUSERNAME
- Optional
-
A username or alias for the target org. Overrides the default target org.
- Type: string
- --apiversion APIVERSION
- Optional
-
Override the API version used for API requests made by this command.
- Type: string
- -o | --onbehalfof ONBEHALFOF
- Optional
-
A comma-separated list of usernames for which to generate passwords.
- Type: array
Help for force:user:password:generate
Generates and sets a random password for one or more scratch org users.
If you haven’t set a default Dev Hub, or if your scratch org isn’t associated with your default Dev Hub, --targetdevhubusername is required.
To see a password that was previously generated, run "sfdx force:user:display".
Examples:
1$ sfdx force:user:password:generate1$ sfdx force:user:password:generate -u me@my.org --json1$ sfdx force:user:password:generate -o "user1@my.org,user2@my.org,user3@my.org"force:user:permset:assign
Command Syntax
- sfdx force:user:permset:assign
- [--json]
- [--loglevel LOGLEVEL]
- [-u TARGETUSERNAME]
- [--apiversion APIVERSION]
- -n PERMSETNAME
- [-o ONBEHALFOF]
Parameters
- --json
- Optional
-
Format output as JSON.
- Type: boolean
- --loglevel LOGLEVEL
- Optional
-
The logging level for this command invocation. Logs are stored in $HOME/.sfdx/sfdx.log.
- Type: enum
- Permissible values are: trace, debug, info, warn, error, fatal, TRACE, DEBUG, INFO, WARN, ERROR, FATAL
- Default value: warn
- -u | --targetusername TARGETUSERNAME
- Optional
-
A username or alias for the target org. Overrides the default target org.
- Type: string
- --apiversion APIVERSION
- Optional
-
Override the API version used for API requests made by this command.
- Type: string
- -n | --permsetname PERMSETNAME
- Required
-
The name of the permission set to assign.
- Type: string
- -o | --onbehalfof ONBEHALFOF
- Optional
-
Comma-separated list of usernames or aliases to assign the permission set to.
- Type: array
Help for force:user:permset:assign
Defaults to the defaultusername.
Examples:
1$ sfdx force:user:permset:assign -n DreamHouse1$ sfdx force:user:permset:assign -n DreamHouse -u me@my.org1$ sfdx force:user:permset:assign -n DreamHouse -o "user1@my.org,user2,user3"