org Commands (Deprecated)

Use the org commands to manage the orgs you use with Salesforce CLI. Create and delete scratch orgs, list your created and authorized orgs, and open orgs in your browser.

force:org:clone (Deprecated)

Clone a sandbox org.

As of February 9, 2023, this command is deprecated and we no longer update this topic.

Don't worry, this command and its flags continue to work the same as before, and any scripts that use the command won’t break. However, we recommend that you start using the equivalent sf-style org create sandbox command instead. Here’s how the flags changed between the old and new commands; if a flag isn't listed, the old and new names are the same:

  • Removed flag: --loglevel
  • Changed flag name: Old name --apiversion. New name: --api-version.
  • Changed flag name: Old name --targetusername. New name: --target-org, with new short name -o.
  • Changed flag name: Old name --targetdevhubusername. New name: --target-hub-org.
  • Changed flag name: Old name --noprompt. New name: --no-prompt.
  • Changed flag name: Old name --definitionfile. New name: --definition-file.
  • Changed flag name: Old name --setalias. New name: --alias.
  • Changed flag name: Old name --setdefaultusername. New name: --set-default, with new short name -d.

For background information about this change, read this blog post, which describes how we've updated many of the existing sfdx commands to use the improvements we made in sf. We improved this particular command on February 9, 2023.

Warning

Help for force:org:clone

There are two ways to clone a sandbox: either specify a sandbox definition file or provide key=value pairs at the command line. Key-value pairs at the command-line override their equivalent sandbox definition file values. In either case, you must specify both the "SandboxName" and "SourceSandboxName" options to set the names of the new sandbox and the one being cloned, respectively.

Set the --targetusername (-u) parameter to a production org with sandbox licenses. The --type (-t) parameter is required and must be set to "sandbox".

Examples for force:org:clone

Command Syntax

sfdx force:org:clone
[--json]
[--loglevel LOGLEVEL]
[-u TARGETUSERNAME]
[--apiversion APIVERSION]
-t TYPE
[-f DEFINITIONFILE]
[-s]
[-a SETALIAS]
[-w WAIT]

Parameters

--json
Optional

Format output as JSON.

Type: boolean
--loglevel LOGLEVEL
Optional

The logging level for this command invocation. Logs are stored in $HOME/.sf/sf.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
-t | --type TYPE
Required

Type of org to create.

Type: enum
Permissible values are: sandbox
-f | --definitionfile DEFINITIONFILE
Optional

Path to the sandbox definition file.

Type: filepath
-s | --setdefaultusername
Optional

Set the cloned org as your default.

Type: boolean
-a | --setalias SETALIAS
Optional

Alias for the cloned 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 minutes

force:org:create (Deprecated)

Create a scratch or sandbox org .

As of February 9, 2023, this command is deprecated and we no longer update this topic.

Don't worry, this command and its flags continue to work the same as before, and any scripts that use the command won’t break. However, we recommend that you start using one of these two equivalent sf-style commmands instead (one for scratch orgs and one for sandboxes):

Here’s how the flags changed between the old and new commands; if a flag isn't listed, the old and new names are the same:

  • Removed flag: --loglevel
  • Changed flag name: Old name --apiversion. New name: --api-version.
  • Changed flag name: Old name --targetusername. New name: --target-org, with new short name -o.
  • Changed flag name: Old name --targetdevhubusername. New name: --target-hub-org.
  • Changed flag name: Old name --noprompt. New name: --no-prompt.
  • Changed flag name: Old name --clientid. New name: --client-id.
  • Changed flag name: Old name --definitionfile. New name: --definition-file.
  • Changed flag name: Old name --durationdays. New name: --duration-days, with new short name -y.
  • Changed flag name: Old name --noancestors. New name: --no-ancestors.
  • Changed flag name: Old name --nonamespace. New name: --no-namespace, with new short name -m.
  • Changed flag name: Old name --setalias. New name: --alias.
  • Changed flag name: Old name --setdefaultusername. New name: --set-default, with new short name -d.

For background information about this change, read this blog post, which describes how we've updated many of the existing sfdx commands to use the improvements we made in sf. We improved this particular command on February 9, 2023.

Warning

Help for force:org:create

Creates a scratch org or a sandbox org using the values specified in a configuration file or key=value pairs that you specify on the command line. Values specified on the command line override values in the configuration file. Specify a configuration file or provide key=value pairs while creating a scratch org or a sandbox. When creating scratch orgs, —targetdevhubusername (-v) must be a Dev Hub org. When creating sandboxes, the --targetusername (-u) must be a production org with sandbox licenses. The —type (-t) is required if creating a sandbox.

Examples for force:org:create

Command Syntax

sfdx force:org:create
[--json]
[--loglevel LOGLEVEL]
[-v TARGETDEVHUBUSERNAME]
[-u TARGETUSERNAME]
[--apiversion APIVERSION]
[-t TYPE]
[-f DEFINITIONFILE]
[-n]
[-c]
[-i CLIENTID]
[-s]
[-a SETALIAS]
[-w WAIT]
[-d DURATIONDAYS]

Parameters

--json
Optional

Format output as JSON.

Type: boolean
--loglevel LOGLEVEL
Optional

The logging level for this command invocation. Logs are stored in $HOME/.sf/sf.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
-t | --type TYPE
Optional

Type of org to create.

Type: enum
Permissible values are: scratch, sandbox
Default value: scratch
-f | --definitionfile DEFINITIONFILE
Optional

Path to an org definition file.

Type: filepath
-n | --nonamespace
Optional

Create the scratch org with no namespace.

Type: boolean
-c | --noancestors
Optional

Do not include second-generation package ancestors in the scratch org.

Type: boolean
-i | --clientid CLIENTID
Optional

Connected app consumer key; not supported for sandbox org creation.

Type: string
-s | --setdefaultusername
Optional

Set the created org as the default username.

Type: boolean
-a | --setalias SETALIAS
Optional

Alias for the created org.

Type: string
-w | --wait WAIT
Optional

The streaming client socket timeout (in minutes).

Type: minutes
Default value: 6 minutes
-d | --durationdays DURATIONDAYS
Optional

Duration of the scratch org (in days) (default:7, min:1, max:30).

Type: integer
Default value: 7

Aliases for force:org:create

force:org:delete (Deprecated)

Mark a scratch or sandbox org for deletion .

As of February 9, 2023, this command is deprecated and we no longer update this topic.

Don't worry, this command and its flags continue to work the same as before, and any scripts that use the command won’t break. However, we recommend that you start using one of these two equivalent sf-style commmands instead (one for scratch orgs and one for sandboxes):

Here’s how the flags changed between the old and new commands; if a flag isn't listed, the old and new names are the same:

  • Removed flag: --loglevel
  • Changed flag name: Old name --apiversion. New name: --api-version.
  • Changed flag name: Old name --targetusername. New name: --target-org, with new short name -o.
  • Changed flag name: Old name --targetdevhubusername. New name: --target-hub-org.
  • Changed flag name: Old name --noprompt. New name: --no-prompt.

For background information about this change, read this blog post, which describes how we've updated many of the existing sfdx commands to use the improvements we made in sf. We improved this particular command on February 9, 2023.

Warning

Help for force:org:delete

To mark the org for deletion without being prompted to confirm, specify --noprompt.

Examples for force:org:delete

Command Syntax

sfdx force:org:delete
[--json]
[--loglevel LOGLEVEL]
[-v TARGETDEVHUBUSERNAME]
[-u TARGETUSERNAME]
[--apiversion APIVERSION]
[-p]

Parameters

--json
Optional

Format output as JSON.

Type: boolean
--loglevel LOGLEVEL
Optional

The logging level for this command invocation. Logs are stored in $HOME/.sf/sf.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
-p | --noprompt
Optional

No prompt to confirm deletion.

Type: boolean

force:org:display (Deprecated)

Get the description for the current or target org.

As of February 9, 2023, this command is deprecated and we no longer update this topic.

Don't worry, this command and its flags continue to work the same as before, and any scripts that use the command won’t break. However, we recommend that you start using the equivalent sf-style org display command instead. Here’s how the flags changed between the old and new commands; if a flag isn't listed, the old and new names are the same:

  • Removed flag: --loglevel
  • Changed flag name: Old name --apiversion. New name: --api-version.
  • Changed flag name: Old name --targetusername. New name: --target-org, with new short name -o.
  • Changed flag name: Old name --targetdevhubusername. New name: --target-hub-org.
  • Changed flag name: Old name --noprompt. New name: --no-prompt.

For background information about this change, read this blog post, which describes how we've updated many of the existing sfdx commands to use the improvements we made in sf. We improved this particular command on February 9, 2023.

Warning

Help for force: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. WARNING: The SFDX auth URL contains sensitive information, such as a refresh token that can be used to access an org. Don't share or distribute this URL or token.

Including --verbose displays the sfdxAuthUrl property only if you authenticated to the org using auth:web:login (not auth:jwt:grant)

Examples for force:org:display

Command Syntax

sfdx force:org:display
[--json]
[--loglevel LOGLEVEL]
[-u TARGETUSERNAME]
[--apiversion APIVERSION]
[--verbose]

Parameters

--json
Optional

Format output as JSON.

Type: boolean
--loglevel LOGLEVEL
Optional

The logging level for this command invocation. Logs are stored in $HOME/.sf/sf.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
--verbose
Optional

Emit additional command output to stdout.

Type: boolean

force:org:list (Deprecated)

List all orgs you’ve created or authenticated to.

As of February 9, 2023, this command is deprecated and we no longer update this topic.

Don't worry, this command and its flags continue to work the same as before, and any scripts that use the command won’t break. However, we recommend that you start using the equivalent sf-style org list command instead. Here’s how the flags changed between the old and new commands; if a flag isn't listed, the old and new names are the same:

  • Removed flag: --loglevel
  • Changed flag name: Old name --apiversion. New name: --api-version.
  • Changed flag name: Old name --targetusername. New name: --target-org, with new short name -o.
  • Changed flag name: Old name --targetdevhubusername. New name: --target-hub-org.
  • Changed flag name: Old name --noprompt. New name: --no-prompt.
  • Changed flag name: Old name --skipconnectionstatus. New name: --skip-connection-status.

For background information about this change, read this blog post, which describes how we've updated many of the existing sfdx commands to use the improvements we made in sf. We improved this particular command on February 9, 2023.

Warning

Examples for force:org:list

Command Syntax

sfdx force:org:list
[--json]
[--loglevel LOGLEVEL]
[--verbose]
[--all]
[--clean]
[-p]
[--skipconnectionstatus]

Parameters

--json
Optional

Format output as JSON.

Type: boolean
--loglevel LOGLEVEL
Optional

The logging level for this command invocation. Logs are stored in $HOME/.sf/sf.log.

Type: enum
Permissible values are: trace, debug, info, warn, error, fatal, TRACE, DEBUG, INFO, WARN, ERROR, FATAL
Default value: warn
--verbose
Optional

Emit additional command output to stdout.

Type: boolean
--all
Optional

Include expired, deleted, and unknown-status scratch orgs.

Type: boolean
--clean
Optional

Remove all local org authorizations for non-active scratch orgs. Use auth:logout to remove non-scratch orgs.

Type: boolean
-p | --noprompt
Optional

Do not prompt for confirmation.

Type: boolean
--skipconnectionstatus
Optional

Skip retrieving the connection status of non-scratch orgs.

Type: boolean

force:org:open (Deprecated)

Open your default scratch org, or another specified org.

As of February 9, 2023, this command is deprecated and we no longer update this topic.

Don't worry, this command and its flags continue to work the same as before, and any scripts that use the command won’t break. However, we recommend that you start using the equivalent sf-style org open command instead. Here’s how the flags changed between the old and new commands; if a flag isn't listed, the old and new names are the same:

  • Removed flag: --loglevel
  • Changed flag name: Old name --apiversion. New name: --api-version.
  • Changed flag name: Old name --targetusername. New name: --target-org, with new short name -o.
  • Changed flag name: Old name --targetdevhubusername. New name: --target-hub-org.
  • Changed flag name: Old name --noprompt. New name: --no-prompt.
  • Changed flag name: Old name --urlonly. New name: --url-only.

For background information about this change, read this blog post, which describes how we've updated many of the existing sfdx commands to use the improvements we made in sf. We improved this particular command on February 9, 2023.

Warning

Help for force:org:open

To open a specific page, specify the portion of the URL after "https://MyDomainName.my.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 it in your browser, specify --urlonly.

To open in a specific browser, use the --browser parameter. Supported browsers are "chrome", "edge", and "firefox". If you don't specify --browser, the org opens in your default browser.

Examples for force:org:open

Command Syntax

sfdx force:org:open
[--json]
[--loglevel LOGLEVEL]
[-u TARGETUSERNAME]
[--apiversion APIVERSION]
[-b BROWSER]
[-p PATH]
[-r]

Parameters

--json
Optional

Format output as JSON.

Type: boolean
--loglevel LOGLEVEL
Optional

The logging level for this command invocation. Logs are stored in $HOME/.sf/sf.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
-b | --browser BROWSER
Optional

Browser where the org opens.

Type: string
Permissible values are: chrome, edge, firefox
-p | --path PATH
Optional

Navigation URL path.

Type: string
-r | --urlonly
Optional

Display navigation URL, but don’t launch browser.

Type: boolean

force:org:shape:create (Deprecated)

Create a scratch org configuration (shape) based on the specified source org.

As of January 26, 2023, this command is deprecated and we no longer update this topic.

Don't worry, this command and its flags continue to work the same as before, and any scripts that use the command won’t break. However, we recommend that you start using the equivalent sf-style org create shape command instead. Here’s how the flags changed between the old and new commands; if a flag isn't listed, the old and new names are the same:

  • Removed flag: --loglevel
  • Changed flag name: Old name --apiversion. New name: --api-version.
  • Changed flag name: Old name --targetusername. New name: --target-org, with new short name -o.

For background information about this change, read this blog post, which describes how we've updated many of the existing sfdx commands to use the improvements we made in sf. We improved this particular command on January 26, 2023.

Warning

Examples for force:org:shape:create

Command Syntax

sfdx force:org:shape:create
[--json]
[--loglevel LOGLEVEL]
[-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/.sf/sf.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

force:org:shape:delete (Deprecated)

Delete all org shapes for a target org.

As of January 26, 2023, this command is deprecated and we no longer update this topic.

Don't worry, this command and its flags continue to work the same as before, and any scripts that use the command won’t break. However, we recommend that you start using the equivalent sf-style org delete shape command instead. Here’s how the flags changed between the old and new commands; if a flag isn't listed, the old and new names are the same:

  • Removed flag: --loglevel
  • Changed flag name: Old name --apiversion. New name: --api-version.
  • Changed flag name: Old name --targetusername. New name: --target-org, with new short name -o.
  • Changed flag name: Old name --noprompt. New name: --no-prompt.

For background information about this change, read this blog post, which describes how we've updated many of the existing sfdx commands to use the improvements we made in sf. We improved this particular command on January 26, 2023.

Warning

Examples for force:org:shape:delete

Command Syntax

sfdx force:org:shape:delete
[--json]
[--loglevel LOGLEVEL]
[-u TARGETUSERNAME]
[--apiversion APIVERSION]
[-p]

Parameters

--json
Optional

Format output as JSON.

Type: boolean
--loglevel LOGLEVEL
Optional

The logging level for this command invocation. Logs are stored in $HOME/.sf/sf.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
-p | --noprompt
Optional

Do not prompt for confirmation.

Type: boolean

force:org:shape:list (Deprecated)

List all org shapes you’ve created.

As of January 26, 2023, this command is deprecated and we no longer update this topic.

Don't worry, this command and its flags continue to work the same as before, and any scripts that use the command won’t break. However, we recommend that you start using the equivalent sf-style org list shape command instead. Here’s how the flags changed between the old and new commands; if a flag isn't listed, the old and new names are the same:

  • Removed flag: --loglevel
  • Removed flag: --verbose
  • Changed flag name: Old name --apiversion. New name: --api-version.

For background information about this change, read this blog post, which describes how we've updated many of the existing sfdx commands to use the improvements we made in sf. We improved this particular command on January 26, 2023.

Warning

Examples for force:org:shape:list

Command Syntax

sfdx force:org:shape:list
[--json]
[--loglevel LOGLEVEL]
[--verbose]

Parameters

--json
Optional

Format output as JSON.

Type: boolean
--loglevel LOGLEVEL
Optional

The logging level for this command invocation. Logs are stored in $HOME/.sf/sf.log.

Type: enum
Permissible values are: trace, debug, info, warn, error, fatal, TRACE, DEBUG, INFO, WARN, ERROR, FATAL
Default value: warn
--verbose
Optional

Emit additional command output to stdout.

Type: boolean

force:org:snapshot:create (Pilot) (Deprecated)

Create a snapshot of a scratch org.

As of January 26, 2023, this command is deprecated and we no longer update this topic.

Don't worry, this command and its flags continue to work the same as before, and any scripts that use the command won’t break. However, we recommend that you start using the equivalent sf-style org create snapshot command instead. Here’s how the flags changed between the old and new commands; if a flag isn't listed, the old and new names are the same:

  • Removed flag: --loglevel
  • Changed flag name: Old name --apiversion. New name: --api-version.
  • Changed flag name: Old name --targetdevhubusername. New name: --target-hub-org.
  • Changed flag name: Old name --snapshotname. New name: --name.
  • Changed flag name: Old name --sourceorg. New name: --source-org.

For background information about this change, read this blog post, which describes how we've updated many of the existing sfdx commands to use the improvements we made in sf. We improved this particular command on January 26, 2023.

Warning

We provide the force:org:snapshot:create command to selected customers through an invitation-only pilot program that requires agreement to specific terms and conditions. Pilot programs are subject to change, and we can’t guarantee acceptance. The force:org:snapshot:create command isn’t generally available unless or until Salesforce announces its general availability in documentation or in press releases or public statements. We can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features. You can provide feedback and suggestions for the force:org:snapshot:create command in the W19 Pilot: Scratch Org Snapshots group in the Trailblazer Community.

Note

Help for force:org:snapshot:create

A snapshot is a point-in-time copy of a scratch org. The copy is stored in Salesforce and referenced by its unique name in a scratch org definition file.

Use "sfdx force:org:snapshot:get" to get details, including status, about a snapshot creation request.

To create a scratch org from a snapshot, include the "snapshot" entry (instead of "edition") in the scratch org definition file and set it to the name of the snapshot. Then use "sfdx force:org:create" to create the scratch org.

Examples for force:org:snapshot:create

Create a snapshot called "Dependencies" using the source scratch org ID:

Create a snapshot called "NightlyBranch" using the source scratch org username:

Command Syntax

sfdx force:org:snapshot:create
[--json]
[--loglevel LOGLEVEL]
[-v TARGETDEVHUBUSERNAME]
[--apiversion APIVERSION]
-o SOURCEORG
-n SNAPSHOTNAME
[-d DESCRIPTION]

Parameters

--json
Optional

Format output as JSON.

Type: boolean
--loglevel LOGLEVEL
Optional

The logging level for this command invocation. Logs are stored in $HOME/.sf/sf.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
--apiversion APIVERSION
Optional

Override the API version used for API requests made by this command.

Type: string
-o | --sourceorg SOURCEORG
Required

The org ID, or a locally authenticated username or alias, of the scratch org to snapshot.

Type: string
-n | --snapshotname SNAPSHOTNAME
Required

The unique name of the snapshot. Use this name to create scratch orgs from the snapshot.

Type: string
-d | --description DESCRIPTION
Optional

A description of the snapshot. Use this description to document the contents of the snapshot.

We suggest that you include a reference point, such as a version control system tag or commit ID.'

Type: string

force:org:snapshot:delete (Pilot) (Deprecated)

Delete a scratch org snapshot.

As of January 26, 2023, this command is deprecated and we no longer update this topic.

Don't worry, this command and its flags continue to work the same as before, and any scripts that use the command won’t break. However, we recommend that you start using the equivalent sf-style org delete snapshot command instead. Here’s how the flags changed between the old and new commands; if a flag isn't listed, the old and new names are the same:

  • Removed flag: --loglevel
  • Changed flag name: Old name --apiversion. New name: --api-version.
  • Changed flag name: Old name --targetdevhubusername. New name: --target-hub-org.

For background information about this change, read this blog post, which describes how we've updated many of the existing sfdx commands to use the improvements we made in sf. We improved this particular command on January 26, 2023.

Warning

We provide the force:org:snapshot:delete command to selected customers through an invitation-only pilot program that requires agreement to specific terms and conditions. Pilot programs are subject to change, and we can’t guarantee acceptance. The force:org:snapshot:delete command isn’t generally available unless or until Salesforce announces its general availability in documentation or in press releases or public statements. We can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features. You can provide feedback and suggestions for the force:org:snapshot:delete command in the W19 Pilot: Scratch Org Snapshots group in the Trailblazer Community.

Note

Help for force:org:snapshot:delete

Dev Hub admins can delete any snapshot, while users can delete only theirs unless a Dev Hub admin gives the user Modify All permissions.

Examples for force:org:snapshot:delete

Delete a snapshot from the default Dev Hub using the snapshot ID:

Delete a snapshot from the specified Dev Hub using the snapshot name:

Command Syntax

sfdx force:org:snapshot:delete
[--json]
[--loglevel LOGLEVEL]
[-v TARGETDEVHUBUSERNAME]
[--apiversion APIVERSION]
-s SNAPSHOT

Parameters

--json
Optional

Format output as JSON.

Type: boolean
--loglevel LOGLEVEL
Optional

The logging level for this command invocation. Logs are stored in $HOME/.sf/sf.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
--apiversion APIVERSION
Optional

Override the API version used for API requests made by this command.

Type: string
-s | --snapshot SNAPSHOT
Required

The name or ID (starts with 0Oo) of the snapshot to delete.

Type: string

force:org:snapshot:get (Pilot) (Deprecated)

Get details about a scratch org snapshot.

As of January 26, 2023, this command is deprecated and we no longer update this topic.

Don't worry, this command and its flags continue to work the same as before, and any scripts that use the command won’t break. However, we recommend that you start using the equivalent sf-style org get snapshot command instead. Here’s how the flags changed between the old and new commands; if a flag isn't listed, the old and new names are the same:

  • Removed flag: --loglevel
  • Changed flag name: Old name --apiversion. New name: --api-version.
  • Changed flag name: Old name --targetdevhubusername. New name: --target-hub-org.

For background information about this change, read this blog post, which describes how we've updated many of the existing sfdx commands to use the improvements we made in sf. We improved this particular command on January 26, 2023.

Warning

We provide the force:org:snapshot:get command to selected customers through an invitation-only pilot program that requires agreement to specific terms and conditions. Pilot programs are subject to change, and we can’t guarantee acceptance. The force:org:snapshot:get command isn’t generally available unless or until Salesforce announces its general availability in documentation or in press releases or public statements. We can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features. You can provide feedback and suggestions for the force:org:snapshot:get command in the W19 Pilot: Scratch Org Snapshots group in the Trailblazer Community.

Note

Help for force:org:snapshot:get

Snapshot creation can take a while. Use this command with the snapshot name or ID to check its creation status. Once the status changes to Active, you can use the snapshot to create scratch orgs.

To create a snapshot, use the "sfdx force:org:snapshot:create" command. To retrieve a list of all snapshots, use "sfdx force:org:snapshot:list".

Examples for force:org:snapshot:get

Get snapshot details using its ID:

Get snapshot details using its name:

Command Syntax

sfdx force:org:snapshot:get
[--json]
[--loglevel LOGLEVEL]
[-v TARGETDEVHUBUSERNAME]
[--apiversion APIVERSION]
-s SNAPSHOT

Parameters

--json
Optional

Format output as JSON.

Type: boolean
--loglevel LOGLEVEL
Optional

The logging level for this command invocation. Logs are stored in $HOME/.sf/sf.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
--apiversion APIVERSION
Optional

Override the API version used for API requests made by this command.

Type: string
-s | --snapshot SNAPSHOT
Required

The name or ID (starts with 0Oo) of the snapshot to retrieve.

Type: string

force:org:snapshot:list (Pilot) (Deprecated)

List scratch org snapshots.

As of January 26, 2023, this command is deprecated and we no longer update this topic.

Don't worry, this command and its flags continue to work the same as before, and any scripts that use the command won’t break. However, we recommend that you start using the equivalent sf-style org list snapshot command instead. Here’s how the flags changed between the old and new commands; if a flag isn't listed, the old and new names are the same:

  • Removed flag: --loglevel
  • Changed flag name: Old name --apiversion. New name: --api-version.
  • Changed flag name: Old name --targetdevhubusername. New name: --target-hub-org.

For background information about this change, read this blog post, which describes how we've updated many of the existing sfdx commands to use the improvements we made in sf. We improved this particular command on January 26, 2023.

Warning

We provide the force:org:snapshot:list command to selected customers through an invitation-only pilot program that requires agreement to specific terms and conditions. Pilot programs are subject to change, and we can’t guarantee acceptance. The force:org:snapshot:list command isn’t generally available unless or until Salesforce announces its general availability in documentation or in press releases or public statements. We can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features. You can provide feedback and suggestions for the force:org:snapshot:list command in the W19 Pilot: Scratch Org Snapshots group in the Trailblazer Community.

Note

Help for force:org:snapshot:list

You can view all the snapshots in a Dev Hub that you have access to. If you’re an admin, you can see all snapshots associated with the Dev Hub org. If you’re a user, you can see only your snapshots unless a Dev Hub admin gives you View All permissions.

To create a snapshot, use the "sfdx force:org:snapshot:create" command. To get details about a snapshot request, use "sfdx force:org:snapshot:get".

Examples for force:org:snapshot:list

List snapshots in the default Dev Hub:

List snapshots in the Dev Hub with the specified username:

Command Syntax

sfdx force:org:snapshot:list
[--json]
[--loglevel LOGLEVEL]
[-v TARGETDEVHUBUSERNAME]
[--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/.sf/sf.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
--apiversion APIVERSION
Optional

Override the API version used for API requests made by this command.

Type: string

force:org:status (Deprecated)

Report status of sandbox creation or clone and authenticate to it.

As of February 9, 2023, this command is deprecated and we no longer update this topic.

Don't worry, this command and its flags continue to work the same as before, and any scripts that use the command won’t break. However, we recommend that you start using the equivalent sf-style org resume sandbox command instead. Here’s how the flags changed between the old and new commands; if a flag isn't listed, the old and new names are the same:

  • Removed flag: --loglevel
  • Changed flag name: Old name --apiversion. New name: --api-version.
  • Changed flag name: Old name --targetusername. New name: --target-org, with new short name -o.
  • Changed flag name: Old name --targetdevhubusername. New name: --target-hub-org.
  • Changed flag name: Old name --noprompt. New name: --no-prompt.
  • Changed flag name: Old name --setdefaultusername. New name: --set-default, with new short name -d.

For background information about this change, read this blog post, which describes how we've updated many of the existing sfdx commands to use the improvements we made in sf. We improved this particular command on February 9, 2023.

Warning

Help for force:org:status

Use this command to check the status of your sandbox creation or clone and, if the sandbox is ready, authenticate to it.

Use the --wait (-w) parameter to specify the number of minutes that the command waits for the sandbox creation or clone to complete before returning control of the terminal to you.

Set the --targetusername (-u) parameter to the username or alias of the production org that contains the sandbox license.

Examples for force:org:status

Command Syntax

sfdx force:org:status
[--json]
[--loglevel LOGLEVEL]
[-u TARGETUSERNAME]
[--apiversion APIVERSION]
-n SANDBOXNAME
[-s]
[-a SETALIAS]
[-w WAIT]

Parameters

--json
Optional

Format output as JSON.

Type: boolean
--loglevel LOGLEVEL
Optional

The logging level for this command invocation. Logs are stored in $HOME/.sf/sf.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 | --sandboxname SANDBOXNAME
Required

Name of the sandbox org to check status for.

Type: string
-s | --setdefaultusername
Optional

Set the created or cloned org as your default.

Type: boolean
-a | --setalias SETALIAS
Optional

Alias for the created or cloned org.

Type: string
-w | --wait WAIT
Optional

Number of minutes to wait while polling for status.

Type: minutes
Default value: 6 minutes