Skip to content

sfdx-hardis by Cloudity Banner

sfdx-hardis

Presented at Dreamforce 23!

Version Downloads/week Downloads/total Docker Pulls GitHub stars GitHub contributors Mega-Linter Secured with Trivy License PRs Welcome

Toolbox for Salesforce DX, by Cloudity, natively compliant with most platforms and tools

Native Integrations

It will allow you to:

Please see the full list of commands in Online documentation

sfdx-hardis commands are also available with UI in SFDX Hardis Visual Studio Code Extension

VsCode SFDX Hardis

See Dreamforce presentation

See Dreamforce presentation

Installation

With IDE

You can install Visual Studio Code extension VsCode SFDX Hardis

Once installed, click on Hardis Group button in VsCode left bar, and follow the additional installation instructions

Installation tutorial

As SFDX Plugin

Pre-requisites

  • Install Node.js (recommended version)
  • Install Salesforce DX by running npm install @salesforce/cli --global command line

Plugin installation

sfdx plugins:install sfdx-hardis

For advanced use, please also install dependencies

sf plugins install @salesforce/plugin-packaging
sfdx plugins:install sfdmu
sfdx plugins:install sfdx-git-delta
sfdx plugins:install sfdx-essentials
sfdx plugins:install texei-sfdx-plugin

If you are using CI/CD scripts, use echo y | sfdx plugins:install ... to bypass prompt.

Docker

You can use sfdx-hardis docker images to run in CI

See Dockerfile

Usage

sfdx hardis:<COMMAND> <OPTIONS>

Articles

Here are some articles about sfdx-hardis

  • English

Questions/Answers Salesforce Developers Podcast sfdx-hardis: A release management tool for open-source Assisted solving of Salesforce deployments errors Handle Salesforce API versions Deprecation like a pro How to mass download notes and attachments files from a Salesforce org How to freeze / unfreeze users during a Salesforce deployment How to detect bad words in Salesforce records using SFDX Data Loader and sfdx-hardis Reactivate all the sandbox users with .invalid emails in 3 clicks Invalid scope:Mine, not allowed ? Deploy your ListViews anyway !

Contributing

Anyone is welcome to contribute to this sfdx-hardis

  • Install Node.js (recommended version)
  • Install typescript by running npm install typescript --global
  • Install yarn by running npm install yarn --global
  • Install Salesforce DX by running npm install @salesforce/cli --global command line
  • Fork this repo and clone it (or just clone if you are an internal contributor)
  • At the root of the repository:
    • Run yarn to install dependencies
    • Run sf plugins link to link the local sfdx-hardis to SFDX CLI
    • Run tsc --watch to transpile typescript into js everytime you update a TS file
  • Debug commands using NODE_OPTIONS=--inspect-brk sfdx hardis:somecommand -someparameter somevalue

Dependencies

sfdx-hardis partially relies on the following SFDX Open-Source packages

Contributors

Commands

hardis:auth

Command Title
hardis:auth:login Login

hardis:cache

Command Title
hardis:cache:clear Clear sfdx-hardis cache

hardis:config

Command Title
hardis:config:get Deploy metadata sources to org

hardis:doc

Command Title
hardis:doc:extract:permsetgroups Generate project documentation
hardis:doc:plugin:generate Generate SFDX Plugin Documentation

hardis:lint

Command Title
hardis:lint:access check permission access
hardis:lint:metadatastatus check inactive metadatas
hardis:lint:missingattributes check missing description on custom fields
hardis:lint:unusedmetadatas check unused labels and custom permissions

hardis:mdapi

Command Title
hardis:mdapi:deploy sfdx-hardis wrapper for sfdx force:mdapi:deploy that displays tips to solve deployment errors.

hardis:misc

Command Title
hardis:misc:toml2csv TOML to CSV

hardis:org

Command Title
hardis:org:configure:data Configure Data project
hardis:org:configure:files Configure File export project
hardis:org:configure:monitoring Configure org monitoring
hardis:org:connect Connect to an org
hardis:org:create Create sandbox org
hardis:org:data:delete Delete data
hardis:org:data:export Export data
hardis:org:data:import Import data
hardis:org:diagnose:audittrail Diagnose content of Setup Audit Trail
hardis:org:diagnose:legacyapi Check for legacy API use
hardis:org:diagnose:licenses List licenses subscribed and used in a Salesforce org
hardis:org:diagnose:unusedlicenses Detect unused Permission Set Licenses
hardis:org:diagnose:unusedusers Detect unused Users in Salesforce
hardis:org:files:export Export files
hardis:org:fix:listviewmine Fix listviews with
hardis:org:generate:packagexmlfull Generate Full Org package.xml
hardis:org:monitor:all Monitor org
hardis:org:monitor:backup Backup DX sources
hardis:org:monitor:limits Check org limits
hardis:org:purge:apexlog Purge Apex Logs
hardis:org:purge:flow Purge Flow versions
hardis:org:retrieve:packageconfig Retrieve package configuration from an org
hardis:org:retrieve:sources:analytics Retrieve CRM Analytics configuration from an org
hardis:org:retrieve:sources:dx Retrieve sfdx sources from org
hardis:org:retrieve:sources:dx2 Retrieve sfdx sources from org (2)
hardis:org:retrieve:sources:metadata Retrieve sfdx sources from org
hardis:org:retrieve:sources:retrofit Retrofit changes from an org
hardis:org:select Select org
hardis:org:test:apex Run apex tests
hardis:org:user:activateinvalid Reactivate sandbox invalid users
hardis:org:user:freeze Freeze user logins
hardis:org:user:unfreeze Unfreeze user logins

hardis:package

Command Title
hardis📦create Create a new package
hardis📦install Install packages in an org
hardis📦mergexml Merge package.xml files
hardis📦version:create Create a new version of a package
hardis📦version:list Create a new version of a package
hardis📦version:promote Promote new versions of package(s)

hardis:project

Command Title
hardis:project:audit:apiversion Audit Metadatas API Version
hardis:project:audit:callincallout Audit CallIns and CallOuts
hardis:project:audit:duplicatefiles Find duplicate sfdx files
hardis:project:audit:remotesites Audit Remote Sites
hardis:project:clean:emptyitems Clean retrieved empty items in dx sources
hardis:project:clean:flowpositions Clean Flow Positions
hardis:project:clean:hiddenitems Clean retrieved hidden items in dx sources
hardis:project:clean:listviews Replace Mine by Everything in ListViews
hardis:project:clean:manageditems Clean retrieved managed items in dx sources
hardis:project:clean:minimizeprofiles Clean profiles of Permission Set attributes
hardis:project:clean:orgmissingitems Clean SFDX items using target org definition
hardis:project:clean:references Clean references in dx sources
hardis:project:clean:retrievefolders Retrieve dashboards, documents and report folders in DX sources
hardis:project:clean:standarditems Clean retrieved standard items in dx sources
hardis:project:clean:systemdebug Clean System debug
hardis:project:clean:xml Clean retrieved empty items in dx sources
hardis:project:configure:auth Configure authentication
hardis:project:convert:profilestopermsets Convert Profiles into Permission Sets
hardis:project:create Login
hardis:project:deploy:sources:dx Deploy sfdx sources to org
hardis:project:deploy:sources:metadata Deploy metadata sources to org
hardis:project:fix:v53flexipages Fix flexipages for v53
hardis:project:generate:gitdelta Generate Git Delta
hardis:project:lint Lint
hardis:project:metadata:findduplicates XML duplicate values finder

hardis:scratch

Command Title
hardis:scratch:create Create and initialize scratch org
hardis:scratch:delete Delete scratch orgs(s)
hardis:scratch:pool:create Create and configure scratch org pool
hardis:scratch:pool:localauth Authenticate locally to scratch org pool
hardis:scratch:pool:refresh Refresh scratch org pool
hardis:scratch:pool:reset Reset scratch org pool
hardis:scratch:pool:view View scratch org pool info
hardis:scratch:pull Scratch PULL
hardis:scratch:push Scratch PUSH

hardis:source

Command Title
hardis:source:deploy sfdx-hardis wrapper for sfdx force:source:deploy that displays tips to solve deployment errors.
hardis:source:push sfdx-hardis wrapper for sfdx force:source:push that displays tips to solve deployment errors.
hardis:source:retrieve sfdx-hardis wrapper for sfdx force:source:retrieve

hardis:work

Command Title
hardis:work:new New work task
hardis:work:refresh Refresh work task
hardis:work:resetselection Select again
hardis:work:save Save work task
hardis:work:ws WebSocket operations