Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including sfdx-essentials with all npm packages installed. Try it out:

sfdx-essentials lists no main file and has no index.js, so it can't be directly required. If this is a mistake, please let us know. It may however contain internal files that you can require manually:

// require("sfdx-essentials/[??]")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

sfdx-essentials v0.4.11

Tools to cover the lacks of missing required functions of SFDX

Salesforce DX Essentials

Version Downloads/week License


Sometimes ... Salesforce tools are delivered without the mandatory capabilities allowing the advanced developments of partners and clients to survive.

Sometimes ... Salesforce R&D team shows some understanding, but sometimes ... not at all, even when a new SFDC Platform version prevents to generate a managed package.

So after the third plugin I needed to create during a few weeks (not for fun, but to allow our managed package to survive!) , I decided to join them on a single plugin: SFDX Essentials , and to publish it as open source , by solidarity with fellow victims of savage platform upgrades :)

Command list

essentials:filter-metadatasFilter metadatas generated from a SFDX Project in order to be able to deploy only part of them on an org
essentials:filter-xml-contentFilter content of metadatas (XML) in order to be able to deploy only part of them on an org
essentials:change-dependency-versionReplace other managed packages dependency version number ( very useful when you build a managed package over another managed package, like Financial Services Cloud )
essentials:fix-lightning-attributes-namesReplace reserved lightning attribute names in lightning components and apex classes ( if you named a lightning attribute like a custom apex class, since Summer 18 you simply can not generate a managed package again)
essentials:uncommentUncomment lines in sfdx/md files (useful to manage @Deprecated annotations with managed packages)
essentials:check-sfdx-project-consistencyCheck consistency between a SFDX project files and package.xml files

Please contribute :)


    sfdx plugins:install sfdx-essentials
  • Windows users: sfdx plugin generator is bugged on windows (hardcode call of linux rm instruction) , so you may use Git Bash to run this code ( at least while it installs the plugin dependencies )


Its seems that sfdx plugins:update and sfdx update does not always work, in that case , uninstall then reinstall the plugin

    sfdx plugins:uninstall sfdx-essentials
    sfdx plugins:install sfdx-essentials



Allows to filter metadatas folder generated by sfdx force:source:convert , using your own package.xml file

This can help if you need to deploy only part of the result of sfdx force:source:convert into a org, by filtering the result (usually in mdapi_output_dir) to keep only the items referenced in your own package.xml file

WARNING: This version does not support all the metadata types yet, please contribute if you are in a hurry :)

  $ sfdx essentials:filter-metadatas OPTIONS

  -i, --inputfolder=inputfolder    Input folder (default: "." )
  -o, --outputfolder=outputfolder  Output folder (default: filteredMetadatas)
  -p, --packagexml=packagexml      package.xml file path

     Package.xml types currently managed:

     - ApexClass
     - ApexComponent
     - ApexPage
     - ApexTrigger
     - AuraDefinitionBundle
     - BusinessProcess
     - ContentAsset
     - CustomApplication
     - CustomField
     - CustomLabel
     - CustomMetadata
     - CustomObject
     - CustomObjectTranslation
     - CustomSite
     - CustomTab
     - Document
     - EmailTemplate
     - EscalationRules
     - FlexiPage
     - GlobalValueSet
     - GlobalValueSetTranslation
     - HomePageLayout
     - ListView
     - Layout
     - NamedCredential
     - Network
     - PermissionSet
     - Profile
     - QuickAction
     - RecordType
     - RemoteSiteSetting
     - Report
     - SiteDotCom
     - StandardValueSet
     - StandardValueSetTranslation
     - StaticResource
     - Translations
     - WebLink
     - Workflow

See conversion tables


  $ sfdx essentials:filter-metadatas -p myPackage.xml

  $ sfdx essentials:filter-metadatas -i md_api_output_dir -p myPackage.xml -o md_api_filtered_output_dir

  $ sfdx force:source:convert -d tmp/deployDemoQuali/
  $ sfdx essentials:filter-metadatas -i tmp/deployDemoQuali/ -p myPackage.xml -o tmp/deployDemoQualiFiltered/
  $ sfdx force:mdapi:deploy -d tmp/deployDemoQualiFiltered/ -w 60 -u DemoQuali

See code: src/commands/essentials/filter-metadatas.ts


When you perform deployments from one org to another, the features activated in the target org may not fit the content of the sfdx/metadata files extracted from the source org.

You may need to filter some elements in the XML files, for example in the Profiles

This script requires a filter-config.json file following this example

    "filters" : [
            "name" : "ProfileFiltering",
            "description" :"Remove unwanted stuff in profiles",
            "folders":      [
            "file_extensions":   [
            "exclude_list" : [
                    "identifier_tag" : "name",
                    "values" : [
                    "identifier_tag" : "tab",
                    "values" : [
  $ sfdx essentials:filter-xml-content OPTIONS

  -i, --inputfolder=inputfolder    Input folder (default: "." )
  -o, --outputfolder=outputfolder  Output folder (default: Input Folder + _xml_content_filtered)
  -p, --configFile=configFile      JSON file containing configuration. Default: filter-config.json

  $ sfdx essentials:filter-xml-content -i "retrieveUnpackaged" 

See code: src/commands/essentials/filter-xml-content.ts


Allows to change an external package dependency version

  $ sfdx essentials:change-dependency-version OPTIONS

  -f, --folder=folder              SFDX project folder containing files
  -j, --majorversion=majorversion  Major version
  -m, --minorversion=minorversion  Minor version
  -n, --namespace=namespace        Namespace of the managed package

  $ sfdx essentials:change-dependency-version -n FinServ -j 214 -m 7

See code: src/commands/essentials/change-dependency-version.ts


If you named a lightning attribute like a custom apex class, since Summer 18 you simply can not generate a managed package again.

This command lists all custom apex classes and custom objects names , then replaces all their references in lightning components and also in apex classes with their camelCase version.

Ex : MyClass_x attribute would be renamed myClassX

  $ sfdx essentials:fix-lightning-attributes-names OPTIONS

  -f, --folder=folder              SFDX project folder containing files (usually 'force-app/main/default'). Default : '.'

  $ sfdx essentials:fix-lightning-attributes-names 

See code: src/commands/essentials/fix-lightning-attributes-names.ts


Once you flagged a packaged method as @Deprecated , you can not deploy it in an org not used for generating a managed package

This commands allows to uncomment desired lines just before making a deployment

Before :

global static List<OrgDebugOption__c> setDebugOption() {
    return null;

After :

@Deprecated // Uncommented by sfdx essentials:uncomment (
global static List<OrgDebugOption__c> setDebugOption() {
    return null;
  $ sfdx essentials:uncomment OPTIONS

  -f, --folder=folder              SFDX project folder containing files (usually 'force-app/main/default'). Default : '.'
  -k, --uncommentKey=someString              Uncomment key. Default : 'SFDX_ESSENTIALS_UNCOMMENT'

  $ sfdx essentials:uncomment --folder "./Projects/DevRootSource/tmp/deployPackagingDxcDevFiltered" --uncommentKey "SFDX_ESSENTIALS_UNCOMMENT_DxcDev_"

See code: src/commands/essentials/uncomment.ts


Allows to compare the content of a SFDX and the content of one or several package.xml files ( append, if several )

  $ sfdx essentials:check-sfdx-project-consistency OPTIONS

  -p, --folder=folder              List of package.xml files path
  -i, --inputfolder=someString              SFDX Project folder . Default : '.'

  $  sfdx essentials:check-sfdx-project-consistency -p "./Config/packageXml/package_DevRoot_Managed.xml,./Config/packageXml/package_DevRoot_xDemo.xml" -i "./Projects/DevRootSource/force-app/main/default"

See code: src/commands/essentials/check-sfdx-project-consistency.ts

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free