Salesforce CLI: New and Changed Commands

We release changes to Salesforce CLI regularly. Read the weekly release notes to learn about recent updates for v48 of the core CLI plug-ins. For more information about the pre-release version, see v49 of the Salesforce CLI Command Reference.

New Commands

These commands were added in a weekly patch of CLI v48.

We introduced three new commands to offer you Lightning Web Components test functionality.

force:lightning:lwc:test:create
Creates a Lightning Web Components test with boilerplate code inside.
force:lightning:lwc:test:run
Invokes Lightning Web Components Jest unit tests.
force:lightning:lwc:test:setup
Installs Jest unit testings tools for Lightning Web Components.

We introduced a new topic (cmdt) and five new commands in this topic for managing custom metadata types.

force:cmdt:create
Creates a custom metadata type in the current project.
force:cmdt:field:create
Generates a custom metadata field based on the provided field type.
force:cmdt:generate
Generates a custom metadata type and all its records for the provided sObject.
force:cmdt:record:create
Creates a record for a given custom metadata type in the current project.
force:cmdt:record:insert
Creates custom metadata type records from a comma-separated values (CSV) file.

Changed Command

This command was changed in a weekly patch of CLI v48.

force:project:create
We added a package.json file to the standard and Analytics Salesforce DX templates. To create these templates, run force:project:create --template=standard or force:project:create --template=analytics. Use the package.json file to work with lightning web components.

Deprecated Commands

These commands, which were previously marked as deprecated, were removed from salesforcedx v49. Use sfdx commands instead, which produces similar output.

force:doc:commands:list
force:doc:commands:display

New Parameters

This parameter was added to a weekly patch of CLI v48.

force:org:list --skipconnectionstatus
Removes the Connected Status column from the org list output to improve performance of the command.

This parameter was added to the CLI pre-release v49.

force:package:create --orgdependent (beta)
For unlocked packages only, allows the package to depend on unpackaged metadata in the installation org.
Note

Note

As a beta feature, Org-Dependent Unlocked Packages is a preview and isn’t part of the “Services” under your master subscription agreement with Salesforce. Use this feature at your sole discretion, and make your purchase decisions only on the basis of generally available products and features. Salesforce doesn’t guarantee general availability of this feature within any particular time frame or at all, and we can discontinue it at any time. This feature is for evaluation purposes only, not for production use. It’s offered as is and isn’t supported, and Salesforce has no liability for any harm or damage arising out of or in connection with it. All restrictions, Salesforce reservation of rights, obligations concerning the Services, and terms for related Non-Salesforce Applications and Content apply equally to your use of this feature. You can provide feedback and suggestions for Org-Dependent Unlocked Packages Trailblazer Community.

JSON Output for All Commands

JSON output for all commands is now sent to stdout by default. This behavior is equivalent to setting the SFDX_JSON_TO_STDOUT environment variable to true. If you currently rely on parsing errors from stderr when using the --json parameter, either update your tools and scripts to instead use stdout or set SFDX_JSON_TO_STDOUT to false. CLI commands usually send more warnings and errors to stderr even when you set --json.