The Salesforce CLI is one of the most important development tools in our ecosystem. The CLI is Salesforce Developers’ everyday companion for building, testing, deploying, and more. In addition, the CLI is fundamental to DevOps practices, such as continuous integration, where automation is key. After seven years of general availability, we’re now entering a new chapter for the Salesforce CLI.

This post is the first of a two-part blog series on sf (v2), the new and improved Salesforce CLI. In Part 1, we’ll take a look at what’s new with the Salesforce CLI sf (v2). Then, in the second part of the series, we’ll dive into how you can migrate from sfdx-style commands and flags to the new sf-style commands and flag patterns.

Announcing sf (v2) General Availability (GA)

About two years ago, the Salesforce CLI team embarked on a unification initiative with a vision to unify the various CLI experiences across the Salesforce ecosystem. We announced the next evolution of our Salesforce CLI with a new executable called sf. Building sf as a separate CLI gave us an opportunity to design, test, and launch not only a new command structure for rapid cross-cloud development, but also a more user-friendly, performant, and intuitive CLI.

Today, we’re excited to announce the General Availability (GA) of the second version (v2) of sf. This is a major version of the sf CLI which is smart enough to understand all your sfdx commands, as well as the sf commands, with much faster install and update times. The sf (v2) CLI is everything that is sf and sfdx. After you install sf (v2), you’ll have access to all the sfdx and sf commands, and you can continue to run any of them.

Embrace the future of Salesforce development

The sf (v2) CLI is our path forward. It enables you to experience faster updates and installs as the install/download size has been greatly reduced.

This means that all new capabilities are going to come only via sf (v2), and we’re going to stop publishing updates to sfdx (except for security-related fixes). Furthermore, all new CLI plugin fixes and features will only go into sf (v2).

Diagram summarizing the evolutions of the Salesforce CLI

After significant UX research, we have introduced new sf-style commands and flag patterns to provide a better user experience. However, if you are concerned about the efforts required for migrating from sfdx to sf, we have good news for you! You can still use the sfdx commands, and the sf CLI will still respond the same way. In addition, you will have only one set of CLI plugins instead of one for sfdx and one for sf (v1). (Note: If you have installed plugins, any plugins in sf will be readily available in sf(v2). However, any plugins in sfdx are not automatically available in sf(v2). Please install the ones you need using sf plugins install).

My name is sf (v2), but I will still respond if you call me sfdx or sf(v1)!

Get started with the Salesforce CLI sf (v2)

To get hands-on with the sf (v2), follow the installation instructions, which will show you how to move to sf (v2) and how to revert back to your current CLI installation if need be.

Note on installing the Salesforce CLI sf (v2):

We created an alias for sfdx within sf (v2), so that you do not need to update your scripts from sfdx to sf. Since sf (v2) is going to use the alias sfdx, you’ll need to uninstall sfdx so that name is available to sf(v2)

The sf (v2) CLI cannot be installed on a machine that has sfdx installed. Per the installation instructions for sf (v2), you must first uninstall sfdx. If you don’t first uninstall sfdx and instead proceed with attempting to install sf via the npm package @salesforce/cli, which now hosts sf (v2), the installation will fail. Please be aware that your CI shouldn’t install sfdx, just sf(v2).

What’s next?

Please stay tuned for more information on moving from sfdx-style commands to sf-style commands in the final part of this blog series.

As you explore sf (v2), remember to report any bugs, feature requests, or surprising behaviors via the CLI GitHub repository. We’re excited to hear from you, and as always, we thank you for your support!

Resources

About the authors

Pooja Reddivari is a Senior Manager of Product Management in the Platform Developer Tools & Experience organization at Salesforce. She is passionate about building scalable and resilient products that delight developers and customers. Pooja has worked in the enterprise, education, and fintech verticals with 12+ years of experience as an engineering and product management professional. Follow her on Twitter @poojasalesforc1 and on LinkedIn.

Philippe Ozil is a Principal Developer Advocate at Salesforce where he focuses on the Salesforce Platform. He writes technical content and speaks frequently at conferences. He is a full-stack developer and enjoys working on DevOps, robotics, and VR projects. Follow him on Twitter @PhilippeOzil or check his GitHub projects @pozil.

Get the latest Salesforce Developer blog posts and podcast episodes via Slack or RSS.

Add to Slack Subscribe to RSS