Salesforce CLI Plug-In Developer Guide
Winter '24 (API version 59.0)
Summer '23 (API version 58.0)
Spring '23 (API version 57.0)
Winter '23 (API version 56.0)
Summer '22 (API version 55.0)
Spring '22 (API version 54.0)
Winter '22 (API version 53.0)
Summer '21 (API version 52.0)
Spring '21 (API version 51.0)
Winter '21 (API version 50.0)
Summer '20 (API version 49.0)
Spring '20 (API version 48.0)
Winter '20 (API version 47.0)
Summer '19 (API version 46.0)
Spring '19 (API version 45.0)
Winter '19 (API version 44.0)
Test Your Salesforce CLI Plug-In
Debug Your Salesforce CLI Plug-In
Resources for Salesforce CLI Plug-In Development
Salesforce CLI Plug-In Developer Guide
Discover how to develop your own plug-ins for Salesforce CLI.
Explore the Salesforce CLI architecture. Learn how to generate a plug-in using Salesforce
Plug-In Generator, use Salesforce’s libraries to add functionality to your plug-in, and debug
issues. Learn about our suggested style guidelines for naming and messages and our recommended
best practices for plug-ins.
-
Salesforce CLI Plug-Ins
A plug-in adds functionality to Salesforce CLI. Some plug-ins are provided by Salesforce and are installed by default when you install the CLI. Some plug-ins, built by Salesforce and others, you install. When you have a requirement that an existing plug-in doesn’t meet, you can build your own using Node.js. -
Salesforce CLI Architecture
Before you get started with adding functionality to Salesforce CLI, let’s take a high-level look at how the CLI and its dependencies and plug-ins work together. -
Get Started with Salesforce CLI Plug-In Generation
Set up your computer for Salesforce CLI plug-in generation, and then generate a plug-in. -
Naming and Messages for Salesforce CLI Plug-Ins
Before you dive into coding, take some time to plan your naming strategy. And it’s never too early to start thinking about the messages you display for your users. -
Customize Your Salesforce CLI Plug-In
To customize your plug-in, duplicate and update the generated files. You can customize your commands’ parameters, properties, error-handling, and output. -
Test Your Salesforce CLI Plug-In
While you’re coding and customizing your plug-in, be sure to write associated tests for each new feature to ensure that it’s working as you expect. In your test suites, include both unit tests and more complex integration, smoke, and end-to-end tests. To help you with latter, we’ve created a library of testing utilities that you add to your environment as a Yarn developer dependency. -
Debug Your Salesforce CLI Plug-In
We recommend using the Visual Studio Code (VS Code) editor, with Salesforce Extensions for VS Code, for your plug-in development. Included in the .vscode directory of Salesforce Plug-In Generator’s generated plug-ins is a launch.json config file. This config file allows you to attach a debugger to the Node process when running your commands. -
Best Practices for Salesforce CLI Plug-In Development
We suggest that you follow these patterns when developing plug-ins for Salesforce CLI. -
Resources for Salesforce CLI Plug-In Development
Bookmark these resources so that you can refer to them as you develop plug-ins.