org Commands
org:create
Command Syntax
- sfdx force:org:create
- [-f DEFINITIONFILE]
- [-n]
- [-c]
- [-i CLIENTID]
- [-s]
- [-a SETALIAS]
- [-w WAIT]
- [-d DURATIONDAYS]
- [-v TARGETDEVHUBUSERNAME]
- [--json]
- [--loglevel LOGLEVEL]
Parameters
- -f | --definitionfile DEFINITIONFILE
- Optional
-
Path to a scratch org definition file. Either --definitionfile or --definitionjson is required.
- Type: filepath
- -n | --nonamespace
- Optional
-
Creates the scratch org with no namespace. Useful when using a scratch org to test installations of packages with namespaces.
- Type: flag
- -c | --noancestors
- Optional
-
Do not include second-generation package ancestors in the scratch org.
- Type: flag
- -i | --clientid CLIENTID
- Optional
-
Connected app consumer key, as configured in your Dev Hub.
- Type: string
- -s | --setdefaultusername
- Optional
-
Sets the created org as the default username.
- Type: flag
- -a | --setalias SETALIAS
- Optional
-
Sets an alias for for the created scratch org.
- Type: string
- -w | --wait WAIT
- Optional
-
Sets the streaming client socket timeout, in minutes. If the streaming client socket has no contact from the server for a number of minutes, the client exits. Specify a longer wait time if timeouts occur frequently.
- Type: minutes
- Default value: 6
- -d | --durationdays DURATIONDAYS
- Optional
-
Sets the duration of the scratch org, in days. Valid values are from 1-30. The default is 7 days.
- Type: number
- -v | --targetdevhubusername TARGETDEVHUBUSERNAME
- Optional
-
A username or alias for the target Dev Hub org. Overrides the default Dev Hub org.
- Type: string
- --json
- Optional
-
Format output as JSON.
- Type: flag
- --loglevel LOGLEVEL
- Optional
-
The logging level for this command invocation. Logs are stored in $HOME/.sfdx/sfdx.log.
- Type: string
- Permissible values are: trace, debug, info, warn, error, fatal
- Default value: error
Help for org:create
To set up a connected app for your new scratch org, specify the value that was returned when you created a connected app in your Dev Hub org as --clientid.
Examples:
1$ sfdx force:org:create -f config/enterprise-scratch-def.json -a TestOrg11$ sfdx force:org:create -a MyDevOrg -s -v me@myhub.org edition=Developer1$ sfdx force:org:create -f config/enterprise-scratch-def.json -a OrgWithOverrides username=testuser1@mycompany.orgorg:delete
Command Syntax
- sfdx force:org:delete
- [-p]
- -u TARGETUSERNAME
- [-v TARGETDEVHUBUSERNAME]
- [--json]
- [--loglevel LOGLEVEL]
Parameters
- -p | --noprompt
- Optional
-
No prompt to confirm deletion.
- Type: flag
- -u | --targetusername TARGETUSERNAME
- Required
-
A username or alias for the target org.
- Type: string
- -v | --targetdevhubusername TARGETDEVHUBUSERNAME
- Optional
-
A username or alias for the target Dev Hub org. Overrides the default Dev Hub org.
- Type: string
- --json
- Optional
-
Format output as JSON.
- Type: flag
- --loglevel LOGLEVEL
- Optional
-
The logging level for this command invocation. Logs are stored in $HOME/.sfdx/sfdx.log.
- Type: string
- Permissible values are: trace, debug, info, warn, error, fatal
- Default value: error
Help for org:delete
To mark the org for deletion without being prompted to confirm, specify --noprompt.
Examples:
1$ sfdx force:org:delete -u me@my.org1$ sfdx force:org:delete -u MyOrgAlias -porg:display
Command Syntax
- sfdx force:org:display
- [-u TARGETUSERNAME]
- [--json]
- [--loglevel LOGLEVEL]
- [--verbose]
Parameters
- -u | --targetusername TARGETUSERNAME
- Optional
-
A username or alias for the target org. Overrides the default target org.
- Type: string
- --json
- Optional
-
Format output as JSON.
- Type: flag
- --loglevel LOGLEVEL
- Optional
-
The logging level for this command invocation. Logs are stored in $HOME/.sfdx/sfdx.log.
- Type: string
- Permissible values are: trace, debug, info, warn, error, fatal
- Default value: error
- --verbose
- Optional
-
Emit additional command output to stdout.
- Type: flag
Help for org:display
Output includes your access token, client ID, connected status, org ID, instance URL, username, and alias, if applicable.
Use --verbose to include the SFDX auth URL. Including --verbose displays the sfdxAuthUrl property only if you authenticated to the org using force:auth:web:login (not force:auth:jwt:grant).
Examples:
1$ sfdx force:org:display1$ sfdx force:org:display -u me@my.org1$ sfdx force:org:display -u TestOrg1 --json1$ sfdx force:org:display -u TestOrg1 --json > tmp/MyOrgDesc.jsonorg:list
Command Syntax
- sfdx force:org:list
- [--all]
- [--clean]
- [-p]
- [--json]
- [--loglevel LOGLEVEL]
Parameters
- --all
- Optional
-
Lists all authenticated orgs, including expired, deleted, and unknown-status scratch orgs.
- Type: flag
- --clean
- Optional
-
Remove all local org authorizations for deleted or expired orgs.
- Type: flag
- -p | --noprompt
- Optional
-
Do not prompt for confirmation.
- Type: flag
- --json
- Optional
-
Format output as JSON.
- Type: flag
- --loglevel LOGLEVEL
- Optional
-
The logging level for this command invocation. Logs are stored in $HOME/.sfdx/sfdx.log.
- Type: string
- Permissible values are: trace, debug, info, warn, error, fatal
- Default value: error
Help for org:list
Examples:
1$ sfdx force:org:list1$ sfdx force:org:list --verbose --json1$ sfdx force:org:list --verbose --json > tmp/MyOrgList.jsonorg:open
Command Syntax
- sfdx force:org:open
- [-p PATH]
- [-r]
- [-u TARGETUSERNAME]
- [--json]
- [--loglevel LOGLEVEL]
Parameters
- -p | --path PATH
- Optional
-
Navigation URL path (not including domain).
- Type: string
- -r | --urlonly
- Optional
-
Displays a navigation URL, but doesn’t launch your browser.
- Type: flag
- -u | --targetusername TARGETUSERNAME
- Optional
-
A username or alias for the target org. Overrides the default target org.
- Type: string
- --json
- Optional
-
Format output as JSON.
- Type: flag
- --loglevel LOGLEVEL
- Optional
-
The logging level for this command invocation. Logs are stored in $HOME/.sfdx/sfdx.log.
- Type: string
- Permissible values are: trace, debug, info, warn, error, fatal
- Default value: error
Help for org:open
Opens your default scratch org, or another org that you specify.
To open a specific page, specify the portion of the URL after "yourInstance.salesforce.com/" as --path.
For example, specify "--path lightning" to open Lightning Experience, or specify "--path /apex/YourPage" to open a Visualforce page.
To generate a URL but not launch your browser, specify --urlonly.
Examples:
1$ sfdx force:org:open1$ sfdx force:org:open -u me@my.org1$ sfdx force:org:open -u MyTestOrg11$ sfdx force:org:open -r -p lightningorg:shape:create (Pilot)
Command Syntax
- sfdx force:org:shape:create
- [-u TARGETUSERNAME]
- [--json]
- [--loglevel LOGLEVEL]
Parameters
- -u | --targetusername TARGETUSERNAME
- Optional
-
A username or alias for the target org. Overrides the default target org.
- Type: string
- --json
- Optional
-
Format output as JSON.
- Type: flag
- --loglevel LOGLEVEL
- Optional
-
The logging level for this command invocation. Logs are stored in $HOME/.sfdx/sfdx.log.
- Type: string
- Permissible values are: trace, debug, info, warn, error, fatal
- Default value: error
Help for org:shape:create
Examples:
1$ sfdx force:org:shape:create -u me@my.org1$ sfdx force:org:shape:create -u me@my.org --json --loglevel debugorg:shape:delete (Pilot)
Command Syntax
- sfdx force:org:shape:delete
- [-p]
- -u TARGETUSERNAME
- [--json]
- [--loglevel LOGLEVEL]
Parameters
- -p | --noprompt
- Optional
-
Do not prompt for confirmation.
- Type: flag
- -u | --targetusername TARGETUSERNAME
- Required
-
Username for the target org.
- Type: string
- --json
- Optional
-
Format output as JSON.
- Type: flag
- --loglevel LOGLEVEL
- Optional
-
The logging level for this command invocation. Logs are stored in $HOME/.sfdx/sfdx.log.
- Type: string
- Permissible values are: trace, debug, info, warn, error, fatal
- Default value: error
Help for org:shape:delete
Examples:
1$ sfdx force:org:shape:delete -u me@my.org1$ sfdx force:org:shape:delete -u MyOrgAlias -p1$ sfdx force:org:shape:delete -u me@my.org --json1$ sfdx force:org:shape:delete -u me@my.org -p --json > tmp/MyOrgShapeDelete.jsonorg:shape:list (Pilot)
Command Syntax
- sfdx force:org:shape:list
- [--json]
- [--loglevel LOGLEVEL]
Parameters
- --json
- Optional
-
Format output as JSON.
- Type: flag
- --loglevel LOGLEVEL
- Optional
-
The logging level for this command invocation. Logs are stored in $HOME/.sfdx/sfdx.log.
- Type: string
- Permissible values are: trace, debug, info, warn, error, fatal
- Default value: error
Help for org:shape:list
Examples:
1$ sfdx force:org:shape:list1$ sfdx force:org:shape:list --json1$ sfdx force:org:shape:list --json > tmp/MyOrgShapeList.json