Here are the new and changed features in recent updates of Salesforce CLI and the salesforcedx
plug-in.
We publish the latest
plug-in and CLI on Thursdays. At the same time we also publish the latest-rc
release candidate plug-in and CLI. The release candidates contain changes that will likely be in the final official version.
Run sfdx version
to display the version of Salesforce CLI installed on your computer. Run sfdx plugins --core
to display the version of the installed salesforcedx
plug-in.
Run sfdx update
to update both the CLI and the salesforcedx
plug-in to the latest available version.
If you use autocomplete, run sfdx autocomplete --refresh-cache
after you update the salesforcedx
plug-in to ensure that autocomplete works correctly on any new commands.
Click here for the v49 release notes.
These changes are in the release candidate plug-in (salesforcedx@latest-rc
). We plan to include these changes in the next official release. This list isn't final and is subject to change.
-
NEW: Use the SFDX_DNS_TIMEOUT environment variable to configure how long the
force:org
commands wait for a response when checking if an org is connected. Set the variable to the number of seconds before the commands time out. Default value is 3. -
FIX: We've improved the error message returned when you run
force:user:password:generate
using API version 51.0 and EnableSetPasswordInApi is configured as a security setting in your scratch org definition file. EnableSetPasswordInApi is now a scratch org feature instead of a Metadata API setting. Here's an example of configuring it as a feature in your scratch org definition file:"features": ["EnableSetPasswordInApi","MultiCurrency"],
This change is a result of the field
Settings.securitySettings.passwordPolicies.enableSetPasswordInApi
being removed in version 51.0 of the Metadata API. (GitHub issue #798)
NOTE: This release also includes the changes in the 50.13.3 (January 14, 2021) release that we rolled back.
- FIX: We've improved the message returned when you delete a sandbox with
force:org:delete
. The new message clarifies that sandboxes created withforce:org:create|clone
are marked for deletion. (GitHub issue #769)
- We aren't releasing a Salesforce CLI patch this week.
- We aren't releasing a Salesforce CLI patch this week.
NOTE: We rolled back this release on January 15, 2021. See this announcement for details. The changes in this release will be included in the next release.
-
NEW: Create a static resource in your local project directory with the
force:staticresource:create
command. Examples of static resources include code libraries in a ZIP file, images, JSON files, and style sheets.The default content type (mime type) is
application/zip
; use the--contenttype
parameter to specify a different content type, such asapplication/json
. The command generates theMyResource.resource-meta.xml
file in the current directory; use-d | --outputdir
to generate it in a different directory. Static resources must reside in themain/default/staticresources
directory under your package directory. For example:$ cd myprojectdir/force-app $ sfdx force:staticresource:create -n MyResource --contenttype application/json -d main/default/staticresources
-
CHANGE: Now that the
auth
commands (such asforce:auth:jwt:grant
andforce:auth:web:login
) are in their own GitHub repo, they no longer show up in thesfdx help force
output. Runsfdx help auth
instead. The Salesforce CLI Command Reference will soon list these commands in only theauth
namespace.We continue to alias the
auth
commands to theirforce:auth
equivalents. So, for example,force:auth:jwt:grant
continues to work. We'll announce when we plan to deprecate theforce
versions of these commands. We’ll then follow our standard deprecation policy, which gives you ample time to update your scripts. -
CHANGE: We deprecated the
force:source:project:upgrade
command. The command upgrades files between old CLI releases and its functionality is no longer needed. -
FIX: The
force:source:retrieve -n <PackageName>
command retrieves custom object subcomponents, such as custom fields. Previously the command retrieved just the custom object itself. (GitHub issue #644) -
FIX: The
force:source:pull
command correctly retrieves static resources after you've updated them in the Salesforce user interface. -
FIX: Commands whose
-u
parameter accepts an access token as a value, in addition to a username, are working correctly. An example isforce:user:password:generate
. Previously you'd get an error such asThe username <string> was not found for scratch org 00D…
(GitHub issue #290) -
FIX: The
force:source:retrieve|pull -m "CustomObject:MyCustomObject__c"
commands correctly retrieve a field whose name is the same as the custom object itself. (GitHub issue #579) -
FIX: We've updated the CLI to use the graceful-fs npm package. As a result, the CLI can process a lot more files, and some errors no longer occur. Previously, for example, you sometimes got the error
EMFILE: too many open files
when runningforce:source:convert
on Windows. -
FIX: The
auth:jwt:grant
command correctly authenticates on Windows. Previously, if you installed or upgraded the CLI on Windows using npm, you’d get the error messageERROR running auth:jwt:grant: We encountered a JSON web token error, which is likely not an issue with Salesforce CLI.
(GitHub issue #757) -
FIX: The
force:source:retrieve|pull -m "MutingPermissionSet:Name"
commands correctly retrieve muting permission sets. Previously you'd get the error messageERROR running force:source:retrieve: "cannot read property 'metadataName' of undefined"
. (GitHub issue #339)
- We aren't releasing a Salesforce CLI patch this week.
- We aren't releasing a Salesforce CLI patch on any of these weeks. Have a happy and safe holiday season.
- We aren't releasing a Salesforce CLI patch this week. Have a happy and safe Thanksgiving!
-
FIX: The
force:source:push|pull|status|deploy|retrieve
commands work with duplicate rules. Previously you'd get the messageNo results found
and the rule wouldn't be recognized by thesource
commands. (GitHub issue #685) -
FIX: The
force:source:retrieve
andforce:mdapi:convert -m <LightningComponentBundle>
commands work with Lightning Web Component CSS style components. Previously you’d get the errorERROR running force:mdapi:convert: Cannot read property 'fileName' of undefined
. Also, forforce:source:retrieve
, the metadata files weren't being copied to their proper location in the project. (GitHub issues #496, #563, and #655)
-
CHANGE: The
force:apex:log:list
command displays results in descending order. Previously it displayed results in ascending order. (Salesforce Extensions for VS Code GitHub issue #2698) -
FIX: The
force:source:convert
command works on custom labels. Previously you'd get the errorERROR running force:source:convert: The package root directory is empty
. (GitHub issue #684) -
FIX: The
force:source:convert
andforce:source:deploy
commands work with the EmailTemplate and EmailFolder metadata types. Previously you’d get an error such asCannot find folder: ExampleFolder
. (GitHub issue #609 and #612)
- We aren't releasing a Salesforce CLI patch this week.
- FIX: We fixed various issues with the
.forceignore
file and it works as expected. In particular, we updated the version dependencies of the core plug-in libraries and improved how the CLI handles trailing slashes in file entries. (GitHub issue #690)
-
NEW: As part of open-sourcing Salesforce CLI, we've broken out the source for the authorization commands, such as
force:auth:jwt:grant
, into their own GitHub repo. These commands are now in theauth
namespace. For example:$ sfdx auth:jwt:grant -u [email protected] -f ./server.key -i 345234
As we broke out the commands, we took the opportunity to also refactor the code. We’re keeping the current
force:auth:*
commands based on the original code. Test out the new commands and let us know if they behave differently or unexpectedly. We plan to alias theforce:auth:*
commands to the newauth:*
commands in the future. Update your CI/CD scripts and let us know if you run into any issues with the new commands. -
CHANGE: The following org shape commands are now beta; they were pilot in v49.
force:org:shape:create
force:org:shape:delete
force:org:shape:list
-
CHANGE: A clarification to last week’s
.forceignore
release note: To start using the new internal parser that follows the.gitignore
patterns and rules, add this line to the top of your.forceignore
file:# .forceignore v2
If you don't add this line to your
.forceignore
file, theforce:source:*
commands continue to use the old parser. The commands warn you about invalid entries so you can start updating them at your convenience. -
FIX: These release notes now include the version of the CLI npm package (
sfdx-cli
) released each week, such as 7.77.1. (GitHub issue #683)
Welcome to the first release of version 50 of the salesforcedx
CLI plug-in in Winter '21.
Update Salesforce CLI to v50 by running sfdx update
.
$ sfdx update
If you are installing Salesforce CLI for the first time, see Install Salesforce CLI to install the CLI for your operating system, then run sfdx update
.
Run sfdx plugins --core
to display the version of Salesforce CLI and the installed salesforcedx
plug-in.
$ sfdx plugins --core
@oclif/plugin-autocomplete 0.1.5 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.2.0 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.9.0 (core)
@oclif/plugin-update 1.3.10 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.4.3 (core)
alias 1.1.2 (core)
config 1.1.8 (core)
generator 1.1.3 (core)
salesforcedx 50.1.1 (core) // salesforcedx plug-in version
├─ templates 50.1.0 (core)
├─ custom-metadata 1.0.10 (core)
├─ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
├─ apex 0.1.0 (core)
└─ salesforce-alm 50.1.1 (core)
sfdx-cli 7.76.1 (core) // Salesforce CLI version
If you installed the pre-release version of the salesforcedx
v50 plug-in, uninstall it and update the CLI. We’re no longer updating the pre-release v50 plug-in.
$ sfdx plugins:uninstall salesforcedx
$ sfdx update
-
force:package:version:displayancestry
Create visualizations of your package or package version's ancestry tree. View the visualization in Salesforce CLI or use the
--dotcode
parameter to generate output that you can use in graph visualization software. -
force:package:version:delete
-
force:package:delete
Deletes the package or package version.
You can't recover deleted packages or package versions, or specify them as dependencies. New installations of the package will fail. You can’t delete released versions of second-generation managed packages.
These commands were deprecated in v49 and removed in v50. You can continue using them by installing the Lightning Testing Service CLI Plug-in. Salesforce doesn't support or update this plug-in.
force:lightning:test:install
force:lightning:test:run
-
force:package:create --errornotificationusername (-o)
-
force:package:update --errornotificationusername (-o)
Designate an active Dev Hub org user to receive email notifications for unhandled Apex exceptions, as well as install, upgrade, or uninstall failures associated with your packages. Specify the username during package creation, or when you update the package with the
force:package:update
command.
-
When parsing the
.forceignore
file, Salesforce CLI uses the same rules and patterns as git uses with the.gitignore
file. As a result, some entries in your existing.forceignore
files might be invalid. Theforce:source:*
commands warn you about any invalid entries. -
FIX: The
force:source:convert
command works correctly when you individually convert two or more custom fields of the same custom object.For example, let’s say your custom object Flower__c has two custom fields: Color__c and Size__c. Previously, this command would convert only one custom field, now it correctly converts all specified fields:
$ sfdx force:source:convert -m CustomField:Flower__c.Color__c,CustomField:Flower__c.Size__c
This fix also applies when using the
-x
parameter to specify a manifest file that lists these fields individually. The fix also applies toforce:source:deploy
, which executes a convert before it deploys. (GitHub issue #628) -
As previously announced, we've reorganized the Salesforce DX Developer and Setup Guides to improve their usability and better align with how the Salesforce developer tools have evolved over time. In particular, we've moved most of the CLI Configuration and Tips topics to the Salesforce CLI Setup Guide and the Dev Hub topics to the Developer Guide. You might need to refresh your bookmarks.
TIP: If a bookmark to one of these guides no longer works, try changing the first two
setup
parts of the URL todev
, or vice versa. For example, the old URL to the CLI Runtime Configuration Values topic was:https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_cli_config_values.htm
Now it's:
https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_dev_cli_config_values.htm