sfdx-hardis

4.28.4 • Public • Published

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

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

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.

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

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

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

sfdx hardis:auth:login [-r <string>] [-h] [-s] [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

Login to salesforce org

USAGE
  $ sfdx hardis:auth:login [-r <string>] [-h] [-s] [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel 
  trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS
  -d, --debug                                                                       Activate debug mode (more logs)
  -h, --devhub                                                                      Also connect associated DevHub
  -r, --instanceurl=instanceurl                                                     URL of org instance
  -s, --scratchorg                                                                  Scratch org
  --json                                                                            format output as json

  --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)  [default: warn] logging level for
                                                                                    this command invocation

  --skipauth                                                                        Skip authentication check when a
                                                                                    default username is required

  --websocket=websocket                                                             Websocket host:port for VsCode SFDX
                                                                                    Hardis UI integration

EXAMPLE
  $ sfdx hardis:auth:login

See code: lib/commands/hardis/auth/login.js

sfdx hardis:cache:clear [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

Clear cache generated by sfdx-hardis

USAGE
  $ sfdx hardis:cache:clear [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel 
  trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS
  -d, --debug                                                                       Activate debug mode (more logs)
  --json                                                                            format output as json

  --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)  [default: warn] logging level for
                                                                                    this command invocation

  --skipauth                                                                        Skip authentication check when a
                                                                                    default username is required

  --websocket=websocket                                                             Websocket host:port for VsCode SFDX
                                                                                    Hardis UI integration

EXAMPLE
  $ sfdx hardis:cache:clear

See code: lib/commands/hardis/cache/clear.js

sfdx hardis:config:get [-l <string>] [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

Returns sfdx-hardis project config for a given level

USAGE
  $ sfdx hardis:config:get [-l <string>] [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel 
  trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS
  -d, --debug                                                                       Activate debug mode (more logs)

  -l, --level=project|branch|user                                                   [default: project] project,branch or
                                                                                    user

  --json                                                                            format output as json

  --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)  [default: warn] logging level for
                                                                                    this command invocation

  --skipauth                                                                        Skip authentication check when a
                                                                                    default username is required

  --websocket=websocket                                                             Websocket host:port for VsCode SFDX
                                                                                    Hardis UI integration

EXAMPLE
  $ sfdx hardis:project:deploy:sources:metadata

See code: lib/commands/hardis/config/get.js

sfdx hardis:doc:extract:permsetgroups [-o <string>] [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

Generate markdown files with project documentation

USAGE
  $ sfdx hardis:doc:extract:permsetgroups [-o <string>] [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel 
  trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS
  -d, --debug                                                                       Activate debug mode (more logs)

  -o, --outputfile=outputfile                                                       Force the path and name of output
                                                                                    report file. Must end with .csv

  --json                                                                            format output as json

  --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)  [default: warn] logging level for
                                                                                    this command invocation

  --skipauth                                                                        Skip authentication check when a
                                                                                    default username is required

  --websocket=websocket                                                             Websocket host:port for VsCode SFDX
                                                                                    Hardis UI integration

EXAMPLE
  $ sfdx hardis:doc:extract:permsetgroups

See code: lib/commands/hardis/doc/extract/permsetgroups.js

sfdx hardis:doc:plugin:generate [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

Generate Markdown documentation ready for HTML conversion with mkdocs

USAGE
  $ sfdx hardis:doc:plugin:generate [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel 
  trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS
  -d, --debug                                                                       Activate debug mode (more logs)
  --json                                                                            format output as json

  --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)  [default: warn] logging level for
                                                                                    this command invocation

  --skipauth                                                                        Skip authentication check when a
                                                                                    default username is required

  --websocket=websocket                                                             Websocket host:port for VsCode SFDX
                                                                                    Hardis UI integration

DESCRIPTION
  After the first run, you need to update manually:

  - mkdocs.yml
  - .github/workflows/build-deploy-docs.yml
  - docs/javascripts/gtag.js , if you want Google Analytics tracking

  Then, activate Github pages, with "gh_pages" as target branch

  At each merge into master/main branch, the GitHub Action build-deploy-docs will rebuild documentation and publish it 
  in GitHub pages

EXAMPLE
  $ sfdx hardis:doc:plugin:generate

See code: lib/commands/hardis/doc/plugin/generate.js

sfdx hardis:lint:access [-e <string>] [-i <string>] [-f <string>] [-o <string>] [-d] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

Check if elements(apex class and field) are at least in one permission set

USAGE
  $ sfdx hardis:lint:access [-e <string>] [-i <string>] [-f <string>] [-o <string>] [-d] [--websocket <string>] 
  [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel 
  trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS
  -d, --debug                                                                       Activate debug mode (more logs)

  -e, --elementsignored=elementsignored                                             Ignore specific elements separated
                                                                                    by commas

  -f, --folder=folder                                                               [default: force-app] Root folder

  -i, --ignorerights=ignorerights                                                   Ignore permission sets or profiles

  -o, --outputfile=outputfile                                                       Force the path and name of output
                                                                                    report file. Must end with .csv

  -u, --targetusername=targetusername                                               username or alias for the target
                                                                                    org; overrides default target org

  --apiversion=apiversion                                                           override the api version used for
                                                                                    api requests made by this command

  --json                                                                            format output as json

  --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)  [default: warn] logging level for
                                                                                    this command invocation

  --skipauth                                                                        Skip authentication check when a
                                                                                    default username is required

  --websocket=websocket                                                             Websocket host:port for VsCode SFDX
                                                                                    Hardis UI integration

EXAMPLES
  $ sfdx hardis:lint:access
  $ sfdx hardis:lint:access -e "ApexClass:ClassA, CustomField:Account.CustomField"
  $ sfdx hardis:lint:access -i "PermissionSet:permissionSetA, Profile"

See code: lib/commands/hardis/lint/access.js

sfdx hardis:lint:metadatastatus [-d] [-o <string>] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

Check if elements(flows) are inactive in the project

USAGE
  $ sfdx hardis:lint:metadatastatus [-d] [-o <string>] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion 
  <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS
  -d, --debug                                                                       Activate debug mode (more logs)

  -o, --outputfile=outputfile                                                       Force the path and name of output
                                                                                    report file. Must end with .csv

  -u, --targetusername=targetusername                                               username or alias for the target
                                                                                    org; overrides default target org

  --apiversion=apiversion                                                           override the api version used for
                                                                                    api requests made by this command

  --json                                                                            format output as json

  --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)  [default: warn] logging level for
                                                                                    this command invocation

  --skipauth                                                                        Skip authentication check when a
                                                                                    default username is required

  --websocket=websocket                                                             Websocket host:port for VsCode SFDX
                                                                                    Hardis UI integration

EXAMPLE
  $ sfdx hardis:lint:metadatastatus

See code: lib/commands/hardis/lint/metadatastatus.js

sfdx hardis:lint:missingattributes [-d] [-o <string>] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

Check if elements(custom fields) aren't description

USAGE
  $ sfdx hardis:lint:missingattributes [-d] [-o <string>] [--websocket <string>] [--skipauth] [-u <string>] 
  [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS
  -d, --debug                                                                       Activate debug mode (more logs)

  -o, --outputfile=outputfile                                                       Force the path and name of output
                                                                                    report file. Must end with .csv

  -u, --targetusername=targetusername                                               username or alias for the target
                                                                                    org; overrides default target org

  --apiversion=apiversion                                                           override the api version used for
                                                                                    api requests made by this command

  --json                                                                            format output as json

  --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)  [default: warn] logging level for
                                                                                    this command invocation

  --skipauth                                                                        Skip authentication check when a
                                                                                    default username is required

  --websocket=websocket                                                             Websocket host:port for VsCode SFDX
                                                                                    Hardis UI integration

EXAMPLE
  $ sfdx hardis:lint:missingattributes

See code: lib/commands/hardis/lint/missingattributes.js

sfdx hardis:lint:unusedmetadatas [-d] [-o <string>] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

Check if elements (custom labels and custom permissions) are used in the project

USAGE
  $ sfdx hardis:lint:unusedmetadatas [-d] [-o <string>] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion 
  <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS
  -d, --debug                                                                       Activate debug mode (more logs)

  -o, --outputfile=outputfile                                                       Force the path and name of output
                                                                                    report file. Must end with .csv

  -u, --targetusername=targetusername                                               username or alias for the target
                                                                                    org; overrides default target org

  --apiversion=apiversion                                                           override the api version used for
                                                                                    api requests made by this command

  --json                                                                            format output as json

  --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)  [default: warn] logging level for
                                                                                    this command invocation

  --skipauth                                                                        Skip authentication check when a
                                                                                    default username is required

  --websocket=websocket                                                             Websocket host:port for VsCode SFDX
                                                                                    Hardis UI integration

EXAMPLE
  $ sfdx hardis:lint:unusedmetadatas

See code: lib/commands/hardis/lint/unusedmetadatas.js

sfdx hardis:mdapi:deploy [-d <directory>] [-w <minutes>] [-q <id> | -l NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg | -r <array> | -o | -g | -c] [-f <filepath>] [-s] [--soapdeploy] [--purgeondelete] [--debug] [--websocket <string>] [-u <string>] [--apiversion <string>] [--verbose] [--concise] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

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

USAGE
  $ sfdx hardis:mdapi:deploy [-d <directory>] [-w <minutes>] [-q <id> | -l 
  NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg | -r <array> | -o | -g | -c] [-f <filepath>] [-s] 
  [--soapdeploy] [--purgeondelete] [--debug] [--websocket <string>] [-u <string>] [--apiversion <string>] [--verbose] 
  [--concise] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS
  -c, --checkonly                                                                   checkOnly
  -d, --deploydir=deploydir                                                         deployDir
  -f, --zipfile=zipfile                                                             zipFile
  -g, --ignorewarnings                                                              ignoreWarnings
  -l, --testlevel=(NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg)      [default: NoTestRun] testLevel
  -o, --ignoreerrors                                                                ignoreErrors
  -q, --validateddeployrequestid=validateddeployrequestid                           validatedDeployRequestId
  -r, --runtests=runtests                                                           [default: ] runTests
  -s, --singlepackage                                                               singlePackage

  -u, --targetusername=targetusername                                               username or alias for the target
                                                                                    org; overrides default target org

  -w, --wait=wait                                                                   [default: [object Object]] wait

  --apiversion=apiversion                                                           override the api version used for
                                                                                    api requests made by this command

  --concise                                                                         concise

  --debug                                                                           debug

  --json                                                                            format output as json

  --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)  [default: warn] logging level for
                                                                                    this command invocation

  --purgeondelete                                                                   purgeOnDelete

  --soapdeploy                                                                      soapDeploy

  --verbose                                                                         verbose

  --websocket=websocket                                                             websocket

DESCRIPTION
  [![Assisted solving of Salesforce deployments 
  errors](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-deployment-errors.jpg)](http
  s://nicolas.vuillamy.fr/assisted-solving-of-salesforce-deployments-errors-47f3666a9ed0)

  [See documentation of Salesforce 
  command](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_fo
  rce_mdapi.htm#cli_reference_force_mdapi_deploy)

See code: lib/commands/hardis/mdapi/deploy.js

sfdx hardis:misc:toml2csv -f <string> [-t <string>] [-l <array>] [-s] [-o <string>] [-d] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

Split TOML file into distinct CSV files

USAGE
  $ sfdx hardis:misc:toml2csv -f <string> [-t <string>] [-l <array>] [-s] [-o <string>] [-d] [--websocket <string>] 
  [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel 
  trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS
  -d, --debug                                                                       Activate debug mode (more logs)
  -f, --tomlfile=tomlfile                                                           (required) Input TOML file path

  -l, --filtersections=filtersections                                               [default: ] List of sections to
                                                                                    process (if not set, all sections
                                                                                    will be processed)

  -o, --outputdir=outputdir                                                         Output directory

  -s, --skiptransfo                                                                 Do not apply transformation to input
                                                                                    data

  -t, --transfoconfig=transfoconfig                                                 Path to JSON config file for mapping
                                                                                    and transformation

  -u, --targetusername=targetusername                                               username or alias for the target
                                                                                    org; overrides default target org

  --apiversion=apiversion                                                           override the api version used for
                                                                                    api requests made by this command

  --json                                                                            format output as json

  --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)  [default: warn] logging level for
                                                                                    this command invocation

  --skipauth                                                                        Skip authentication check when a
                                                                                    default username is required

  --websocket=websocket                                                             Websocket host:port for VsCode SFDX
                                                                                    Hardis UI integration

EXAMPLES
  $ sfdx hardis:misc:toml2csv --tomlfile 'D:/clients/toto/V1_full.txt' 
  $ sfdx hardis:misc:toml2csv --skiptransfo --tomlfile 'D:/clients/toto/V1_full.txt' 
  $ sfdx hardis:misc:toml2csv --skiptransfo --tomlfile 'D:/clients/toto/V1_full.txt' --outputdir 'C:/tmp/rrrr'
  $ NODE_OPTIONS=--max_old_space_size=9096 sfdx hardis:misc:toml2csv --skiptransfo --tomlfile './input/V1.txt' 
  --outputdir './output' --filtersections 'COMPTES,SOUS'

See code: lib/commands/hardis/misc/toml2csv.js

sfdx hardis:org:configure:data [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

Configure Data Export/Import with a SFDX Data Loader Project

USAGE
  $ sfdx hardis:org:configure:data [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel 
  trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS
  -d, --debug                                                                       Activate debug mode (more logs)
  --json                                                                            format output as json

  --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)  [default: warn] logging level for
                                                                                    this command invocation

  --skipauth                                                                        Skip authentication check when a
                                                                                    default username is required

  --websocket=websocket                                                             Websocket host:port for VsCode SFDX
                                                                                    Hardis UI integration

DESCRIPTION
  See article:

  [![How to detect bad words in Salesforce records using SFDX Data Loader and 
  sfdx-hardis](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-badwords.jpg)](https://
  nicolas.vuillamy.fr/how-to-detect-bad-words-in-salesforce-records-using-sfdx-data-loader-and-sfdx-hardis-171db40a9bac)

EXAMPLE
  $ sfdx hardis:org:configure:data

See code: lib/commands/hardis/org/configure/data.js

sfdx hardis:org:configure:files [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

Configure export of file attachments from a Salesforce org

USAGE
  $ sfdx hardis:org:configure:files [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel 
  trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS
  -d, --debug                                                                       Activate debug mode (more logs)
  --json                                                                            format output as json

  --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)  [default: warn] logging level for
                                                                                    this command invocation

  --skipauth                                                                        Skip authentication check when a
                                                                                    default username is required

  --websocket=websocket                                                             Websocket host:port for VsCode SFDX
                                                                                    Hardis UI integration

DESCRIPTION
  See article below

  [![How to mass download notes and attachments files from a Salesforce 
  org](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-mass-download.jpg)](https://nic
  olas.vuillamy.fr/how-to-mass-download-notes-and-attachments-files-from-a-salesforce-org-83a028824afd)

EXAMPLE
  $ sfdx hardis:org:configure:files

See code: lib/commands/hardis/org/configure/files.js

sfdx hardis:org:configure:monitoring [--orginstanceurl <string>] [-d] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

Configure monitoring of an org

USAGE
  $ sfdx hardis:org:configure:monitoring [--orginstanceurl <string>] [-d] [--websocket <string>] [--skipauth] [-u 
  <string>] [--apiversion <string>] [--json] [--loglevel 
  trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS
  -d, --debug                                                                       Activate debug mode (more logs)

  -u, --targetusername=targetusername                                               username or alias for the target
                                                                                    org; overrides default target org

  --apiversion=apiversion                                                           override the api version used for
                                                                                    api requests made by this command

  --json                                                                            format output as json

  --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)  [default: warn] logging level for
                                                                                    this command invocation

  --orginstanceurl=orginstanceurl                                                   Org instance url (technical param,
                                                                                    do not use manually)

  --skipauth                                                                        Skip authentication check when a
                                                                                    default username is required

  --websocket=websocket                                                             Websocket host:port for VsCode SFDX
                                                                                    Hardis UI integration

EXAMPLE
  $ sfdx hardis:org:configure:monitoring

See code: lib/commands/hardis/org/configure/monitoring.js

sfdx hardis:org:connect [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

Connect to an org without setting it as default username, then proposes to open the org in web browser

USAGE
  $ sfdx hardis:org:connect [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel 
  trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS
  -d, --debug                                                                       Activate debug mode (more logs)
  --json                                                                            format output as json

  --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)  [default: warn] logging level for
                                                                                    this command invocation

  --skipauth                                                                        Skip authentication check when a
                                                                                    default username is required

  --websocket=websocket                                                             Websocket host:port for VsCode SFDX
                                                                                    Hardis UI integration

DESCRIPTION


EXAMPLE
  $ sfdx hardis:org:connect

See code: lib/commands/hardis/org/connect.js

sfdx hardis:org:create [-d] [--websocket <string>] [--skipauth] [-v <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

Create and initialize sandbox org

USAGE
  $ sfdx hardis:org:create [-d] [--websocket <string>] [--skipauth] [-v <string>] [--apiversion <string>] [--json] 
  [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS
  -d, --debug                                                                       Activate debug mode (more logs)

  -v, --targetdevhubusername=targetdevhubusername                                   username or alias for the dev hub
                                                                                    org; overrides default dev hub org

  --apiversion=apiversion                                                           override the api version used for
                                                                                    api requests made by this command

  --json                                                                            format output as json

  --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)  [default: warn] logging level for
                                                                                    this command invocation

  --skipauth                                                                        Skip authentication check when a
                                                                                    default username is required

  --websocket=websocket                                                             Websocket host:port for VsCode SFDX
                                                                                    Hardis UI integration

EXAMPLE
  $ sfdx hardis:org:create

See code: lib/commands/hardis/org/create.js

sfdx hardis:org:data:delete [-p <string>] [-d] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

Delete data in org using sfdmu

USAGE
  $ sfdx hardis:org:data:delete [-p <string>] [-d] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion 
  <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS
  -d, --debug                                                                       Activate debug mode (more logs)
  -p, --path=path                                                                   Path to the sfdmu workspace folder

  -u, --targetusername=targetusername                                               username or alias for the target
                                                                                    org; overrides default target org

  --apiversion=apiversion                                                           override the api version used for
                                                                                    api requests made by this command

  --json                                                                            format output as json

  --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)  [default: warn] logging level for
                                                                                    this command invocation

  --skipauth                                                                        Skip authentication check when a
                                                                                    default username is required

  --websocket=websocket                                                             Websocket host:port for VsCode SFDX
                                                                                    Hardis UI integration

EXAMPLE
  $ sfdx hardis:org:data:delete

See code: lib/commands/hardis/org/data/delete.js

sfdx hardis:org:data:export [-p <string>] [-d] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

Export data from an org using a SFDX Data Loader Project

USAGE
  $ sfdx hardis:org:data:export [-p <string>] [-d] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion 
  <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS
  -d, --debug                                                                       Activate debug mode (more logs)
  -p, --path=path                                                                   Path to the sfdmu workspace folder

  -u, --targetusername=targetusername                                               username or alias for the target
                                                                                    org; overrides default target org

  --apiversion=apiversion                                                           override the api version used for
                                                                                    api requests made by this command

  --json                                                                            format output as json

  --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)  [default: warn] logging level for
                                                                                    this command invocation

  --skipauth                                                                        Skip authentication check when a
                                                                                    default username is required

  --websocket=websocket                                                             Websocket host:port for VsCode SFDX
                                                                                    Hardis UI integration

DESCRIPTION
  See article:

  [![How to detect bad words in Salesforce records using SFDX Data Loader and 
  sfdx-hardis](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-badwords.jpg)](https://
  nicolas.vuillamy.fr/how-to-detect-bad-words-in-salesforce-records-using-sfdx-data-loader-and-sfdx-hardis-171db40a9bac)

EXAMPLE
  $ sfdx hardis:org:data:export

See code: lib/commands/hardis/org/data/export.js

sfdx hardis:org:data:import [-p <string>] [-d] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

Import/Load data in an org using a SFDX Data Loader Project

USAGE
  $ sfdx hardis:org:data:import [-p <string>] [-d] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion 
  <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS
  -d, --debug                                                                       Activate debug mode (more logs)
  -p, --path=path                                                                   Path to the sfdmu workspace folder

  -u, --targetusername=targetusername                                               username or alias for the target
                                                                                    org; overrides default target org

  --apiversion=apiversion                                                           override the api version used for
                                                                                    api requests made by this command

  --json                                                                            format output as json

  --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)  [default: warn] logging level for
                                                                                    this command invocation

  --skipauth                                                                        Skip authentication check when a
                                                                                    default username is required

  --websocket=websocket                                                             Websocket host:port for VsCode SFDX
                                                                                    Hardis UI integration

DESCRIPTION
  See article:

  [![How to detect bad words in Salesforce records using SFDX Data Loader and 
  sfdx-hardis](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-badwords.jpg)](https://
  nicolas.vuillamy.fr/how-to-detect-bad-words-in-salesforce-records-using-sfdx-data-loader-and-sfdx-hardis-171db40a9bac)

EXAMPLE
  $ sfdx hardis:org:data:import

See code: lib/commands/hardis/org/data/import.js

sfdx hardis:org:diagnose:audittrail [-e <string>] [-t <number>] [-o <string>] [-d] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

Export Audit trail into a CSV file with selected criteria, and highlight suspect actions

USAGE
  $ sfdx hardis:org:diagnose:audittrail [-e <string>] [-t <number>] [-o <string>] [-d] [--websocket <string>] 
  [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel 
  trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS
  -d, --debug                                                                       Activate debug mode (more logs)

  -e, --excludeusers=excludeusers                                                   Comma-separated list of usernames to
                                                                                    exclude

  -o, --outputfile=outputfile                                                       Force the path and name of output
                                                                                    report file. Must end with .csv

  -t, --lastndays=lastndays                                                         Number of days to extract from today
                                                                                    (included)

  -u, --targetusername=targetusername                                               username or alias for the target
                                                                                    org; overrides default target org

  --apiversion=apiversion                                                           override the api version used for
                                                                                    api requests made by this command

  --json                                                                            format output as json

  --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)  [default: warn] logging level for
                                                                                    this command invocation

  --skipauth                                                                        Skip authentication check when a
                                                                                    default username is required

  --websocket=websocket                                                             Websocket host:port for VsCode SFDX
                                                                                    Hardis UI integration

DESCRIPTION
  Regular setup actions performed in major orgs are filtered.

  - ""
     - createScratchOrg
     - changedsenderemail
     - deleteScratchOrg
     - loginasgrantedtopartnerbt
  - Certificate and Key Management
     - insertCertificate
  - Data Management
     - queueMembership
  - Email Administration
     - dkimRotationPreparationSuccessful
     - dkimRotationSuccessful
  - Groups
     - groupMembership
  - Holidays
     - holiday_insert
  - Inbox mobile and legacy desktop apps
     - enableSIQUserNonEAC
  - Manage Users
     - activateduser
     - createduser
     - changedcommunitynickname
     - changedemail
     - changedfederationid
     - changedpassword
     - changedinteractionuseroffon
     - changedinteractionuseronoff
     - changedmarketinguseroffon
     - changedmarketinguseronoff
     - changedprofileforuser
     - changedprofileforusercusttostd
     - changedprofileforuserstdtocust
     - changedroleforusertonone
     - changedroleforuser
     - changedroleforuserfromnone
     - changedUserEmailVerifiedStatusUnverified
     - changedUserEmailVerifiedStatusVerified
     - changedUserPhoneNumber
     - changedUserPhoneVerifiedStatusUnverified
     - deactivateduser
     - deleteAuthenticatorPairing
     - deleteTwoFactorInfo2
     - deleteTwoFactorTempCode
     - frozeuser
     - insertAuthenticatorPairing
     - insertTwoFactorInfo2
     - insertTwoFactorTempCode
     - lightningloginenroll
     - PermSetAssign
     - PermSetGroupAssign
     - PermSetGroupUnassign
     - PermSetLicenseAssign
     - PermSetUnassign
     - PermSetLicenseUnassign
     - registeredUserPhoneNumber
     - resetpassword
     - suOrgAdminLogin
     - suOrgAdminLogout
     - useremailchangesent
  - Reporting Snapshots
     - createdReportJob
     - deletedReportJob
  - Sandboxes
     - DeleteSandbox

  By default, deployment user defined in .sfdx-hardis.yml targetUsername property will be excluded.

  You can define additional users to exclude in .sfdx-hardis.yml **monitoringExcludeUsernames** property.

  You can also add more sections / actions considered as not suspect using property **monitoringAllowedSectionsActions**

  Example:

  ```yaml
  monitoringExcludeUsernames:
     - deploymentuser@cloudity.com
     - marketingcloud@cloudity.com
     - integration-user@cloudity.com

  monitoringAllowedSectionsActions:
     "Some section": [] // Will ignore all actions from such section
     "Some other section": ["actionType1","actionType2","actionType3"] // Will ignore only those 3 actions from section 
  "Some other section". Other actions in the same section will be considered as suspect.

EXAMPLES $ sfdx hardis:org:diagnose:audittrail $ sfdx hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com $ sfdx hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com,bertrand@titi.com $ sfdx hardis:org:diagnose:audittrail --lastndays 5


_See code: [lib/commands/hardis/org/diagnose/audittrail.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/org/diagnose/audittrail.js)_

## `sfdx hardis:org:diagnose:legacyapi [-e <string>] [-l <number>] [-o <string>] [-d] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Checks if an org uses retired or someday retired API version

USAGE $ sfdx hardis:org:diagnose:legacyapi [-e ] [-l ] [-o ] [-d] [--websocket ] [--skipauth] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs)

-e, --eventtype=eventtype [default: ApiTotalUsage] Type of EventLogFile event to analyze

-l, --limit=limit [default: 999] Number of latest EventLogFile events to analyze

-o, --outputfile=outputfile Force the path and name of output report file. Must end with .csv

-u, --targetusername=targetusername username or alias for the target org; overrides default target org

--apiversion=apiversion override the api version used for api requests made by this command

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

DESCRIPTION See article below

[Handle Salesforce API versions Deprecation like a pro](https://ni colas.vuillamy.fr/handle-salesforce-api-versions-deprecation-like-a-pro-335065f52238)

EXAMPLES $ sfdx hardis:org:diagnose:legacyapi $ sfdx hardis:org:diagnose:legacyapi -u hardis@myclient.com $ sfdx hardis:org:diagnose:legacyapi --outputfile 'c:/path/to/folder/legacyapi.csv' $ sfdx hardis:org:diagnose:legacyapi -u hardis@myclient.com --outputfile ./tmp/legacyapi.csv


_See code: [lib/commands/hardis/org/diagnose/legacyapi.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/org/diagnose/legacyapi.js)_

## `sfdx hardis:org:diagnose:unusedlicenses [-o <string>] [-d] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

When you assign a Permission Set to a user, and that this Permission Set is related to a Permission Set License, a Permission Set License Assignment is automatically created for the user.

USAGE $ sfdx hardis:org:diagnose:unusedlicenses [-o ] [-d] [--websocket ] [--skipauth] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs)

-o, --outputfile=outputfile Force the path and name of output report file. Must end with .csv

-u, --targetusername=targetusername username or alias for the target org; overrides default target org

--apiversion=apiversion override the api version used for api requests made by this command

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

DESCRIPTION But when you unassign this Permission Set from the user, the Permission Set License Assignment is not deleted.

 This leads that you can be **charged for Permission Set Licenses that are not used** !

 This command detects such useless Permission Set Licenses Assignments and suggests to delete them.

 Many thanks to [Vincent Finet](https://www.linkedin.com/in/vincentfinet/) for the inspiration during his great 

speaker session at French Touch Dreamin '23, and his kind agreement for reusing such inspiration in this command :)

EXAMPLES $ sfdx hardis:org:diagnose:unusedlicenses $ sfdx hardis:org:diagnose:unusedlicenses --fix


_See code: [lib/commands/hardis/org/diagnose/unusedlicenses.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/org/diagnose/unusedlicenses.js)_

## `sfdx hardis:org:files:export [-p <string>] [-c <number>] [-t <number>] [-s <number>] [-d] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Export file attachments from a Salesforce org

USAGE $ sfdx hardis:org:files:export [-p ] [-c ] [-t ] [-s ] [-d] [--websocket ] [--skipauth] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -c, --chunksize=chunksize [default: 1000] Number of records to add in a chunk before it is processed

-d, --debug Activate debug mode (more logs)

-p, --path=path Path to the file export project

-s, --startchunknumber=startchunknumber Chunk number to start from

-t, --polltimeout=polltimeout [default: 300000] Timeout in MS for Bulk API calls

-u, --targetusername=targetusername username or alias for the target org; overrides default target org

--apiversion=apiversion override the api version used for api requests made by this command

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

DESCRIPTION See article below

[How to mass download notes and attachments files from a Salesforce org](https://nic olas.vuillamy.fr/how-to-mass-download-notes-and-attachments-files-from-a-salesforce-org-83a028824afd)

EXAMPLE $ sfdx hardis:org:files:export


_See code: [lib/commands/hardis/org/files/export.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/org/files/export.js)_

## `sfdx hardis:org:fix:listviewmine [-l <string>] [-d] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Fix listviews whose scope Mine has been replaced by Everything

USAGE $ sfdx hardis:org:fix:listviewmine [-l ] [-d] [--websocket ] [--skipauth] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs)

-l, --listviews=listviews Comma-separated list of listviews following format Object:ListViewName Example: Contact:MyContacts,Contact:MyActiveContacts,Opportunity:MYClosedOpportunities

-u, --targetusername=targetusername username or alias for the target org; overrides default target org

--apiversion=apiversion override the api version used for api requests made by this command

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

DESCRIPTION [Invalid scope:Mine, not allowed ? Deploy your ListViews anyway !](https:// nicolas.vuillamy.fr/invalid-scope-mine-not-allowed-deploy-your-listviews-anyway-443aceca8ac7)

List of ListViews can be:

  • read from .sfdx-hardis.yml file in property listViewsToSetToMine
  • sent in argument listviews

Note: property listViewsToSetToMine can be auto-generated by command hardis:work:save if .sfdx-hardis.yml contains the following configuration

autoCleanTypes:
   - listViewsMine
  • Example of sfdx-hardis.yml property listViewsToSetToMine:
listViewsToSetToMine:
   - "force-app/main/default/objects/Operation__c/listViews/MyCurrentOperations.listView-meta.xml"
   - "force-app/main/default/objects/Operation__c/listViews/MyFinalizedOperations.listView-meta.xml"
   - "force-app/main/default/objects/Opportunity/listViews/Default_Opportunity_Pipeline.listView-meta.xml"
   - "force-app/main/default/objects/Opportunity/listViews/MyCurrentSubscriptions.listView-meta.xml"
   - "force-app/main/default/objects/Opportunity/listViews/MySubscriptions.listView-meta.xml"
   - "force-app/main/default/objects/Account/listViews/MyActivePartners.listView-meta.xml"
  • If manually written, this could also be:
listViewsToSetToMine:
   - "Operation__c:MyCurrentOperations"
   - "Operation__c:MyFinalizedOperations"
   - "Opportunity:Default_Opportunity_Pipeline"
   - "Opportunity:MyCurrentSubscriptions"
   - "Opportunity:MySubscriptions"
   - "Account:MyActivePartners"

Troubleshooting: if you need to run this command from an alpine-linux based docker image, use this workaround in your dockerfile:

# Do not use puppeteer embedded chromium
RUN apk add --update --no-cache chromium
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"
ENV CHROMIUM_PATH="/usr/bin/chromium-browser"
ENV PUPPETEER_EXECUTABLE_PATH="$\{CHROMIUM_PATH}" // remove \ before {

EXAMPLES $ sfdx hardis:org:fix:listviewmine $ sfdx hardis:org:fix:listviewmine --listviews Opportunity:MySubscriptions,Account:MyActivePartners


_See code: [lib/commands/hardis/org/fix/listviewmine.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/org/fix/listviewmine.js)_

## `sfdx hardis:org:generate:packagexmlfull [--outputfile <string>] [-d] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Generates full org package.xml, including managed items

USAGE $ sfdx hardis:org:generate:packagexmlfull [--outputfile ] [-d] [--websocket ] [--skipauth] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs)

-u, --targetusername=targetusername username or alias for the target org; overrides default target org

--apiversion=apiversion override the api version used for api requests made by this command

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--outputfile=outputfile Output package.xml file

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLES $ sfdx hardis:org:generate:packagexmlfull $ sfdx hardis:org:generate:packagexmlfull --outputfile /tmp/packagexmlfull.xml $ sfdx hardis:org:generate:packagexmlfull --targetusername nico@example.com


_See code: [lib/commands/hardis/org/generate/packagexmlfull.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/org/generate/packagexmlfull.js)_

## `sfdx hardis:org:monitor:all [-d] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Monitor org, generate reports and sends notifications

USAGE $ sfdx hardis:org:monitor:all [-d] [--websocket ] [--skipauth] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs)

-u, --targetusername=targetusername username or alias for the target org; overrides default target org

--apiversion=apiversion override the api version used for api requests made by this command

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

DESCRIPTION You can disable some commands defining either a monitoringDisable property in .sfdx-hardis.yml, or a comma separated list in env variable MONITORING_DISABLE

Example in .sfdx-hardis.yml:

monitoringDisable:
   - METADATA_STATUS
   - MISSING_ATTRIBUTES
   - UNUSED_METADATAS

Example in env var:

MONITORING_DISABLE=METADATA_STATUS,MISSING_ATTRIBUTES,UNUSED_METADATAS

A default list of monitoring commands is used, if you want to override it you can define property monitoringCommands in your .sfdx-hardis.yml file

Example:

monitoringCommands:
   - title: My Custom command
     command: sfdx my:custom:command
   - title: My Custom command 2
     command: sfdx my:other:custom:command

EXAMPLE $ sfdx hardis:org:monitor:all


_See code: [lib/commands/hardis/org/monitor/all.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/org/monitor/all.js)_

## `sfdx hardis:org:monitor:backup [-o <string>] [-d] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Retrieve sfdx sources in the context of a monitoring backup

USAGE $ sfdx hardis:org:monitor:backup [-o ] [-d] [--websocket ] [--skipauth] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs)

-o, --outputfile=outputfile Force the path and name of output report file. Must end with .csv

-u, --targetusername=targetusername username or alias for the target org; overrides default target org

--apiversion=apiversion override the api version used for api requests made by this command

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

DESCRIPTION You can remove more metadata types from backup, especially in case you have too many metadatas and that provokes a crash, using:

  • Manual update of manifest/package-skip-items.xml config file (then commit & push in the same branch)

  • Environment variable MONITORING_BACKUP_SKIP_METADATA_TYPES (example: MONITORING_BACKUP_SKIP_METADATA_TYPES=CustomLabel,StaticResource,Translation): that will be applied to all monitoring branches.

EXAMPLE $ sfdx hardis:org:monitor:backup


_See code: [lib/commands/hardis/org/monitor/backup.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/org/monitor/backup.js)_

## `sfdx hardis:org:purge:apexlog [-z] [-d] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Purge apex logs in selected org

USAGE $ sfdx hardis:org:purge:apexlog [-z] [-d] [--websocket ] [--skipauth] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs)

-u, --targetusername=targetusername username or alias for the target org; overrides default target org

-z, --[no-]prompt Prompt for confirmation (true by default, use --no-prompt to skip)

--apiversion=apiversion override the api version used for api requests made by this command

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLES $ sfdx hardis:org:purge:apexlog $ sfdx hardis:org:purge:apexlog --targetusername nicolas.vuillamy@gmail.com


_See code: [lib/commands/hardis/org/purge/apexlog.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/org/purge/apexlog.js)_

## `sfdx hardis:org:purge:flow [-z] [-n <string>] [-s <string>] [-f] [-r <string>] [-d] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Purge Obsolete flow versions to avoid the 50 max versions limit. Filters on Status and Name

USAGE $ sfdx hardis:org:purge:flow [-z] [-n ] [-s ] [-f] [-r ] [-d] [--websocket ] [--skipauth] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs)

-f, --[no-]allowpurgefailure Allows purges to fail without exiting with 1. Use --no-allowpurgefailure to disable

-n, --name=name Filter according to Name criteria

-r, --instanceurl=instanceurl [default: https://login.salesforce.com] URL of org instance

-s, --status=status Filter according to Status criteria

-u, --targetusername=targetusername username or alias for the target org; overrides default target org

-z, --[no-]prompt Prompt for confirmation (true by default, use --no-prompt to skip)

--apiversion=apiversion override the api version used for api requests made by this command

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLES $ sfdx hardis:org:purge:flow --targetusername nicolas.vuillamy@gmail.com Found 1 records: ID MASTERLABEL VERSIONNUMBER DESCRIPTION STATUS 30109000000kX7uAAE TestFlow 2 test flowwww Obsolete Are you sure you want to delete this list of records (y/n)?: y Successfully deleted record: 30109000000kX7uAAE. Deleted the following list of records: ID MASTERLABEL VERSIONNUMBER DESCRIPTION STATUS 30109000000kX7uAAE TestFlow 2 test flowwww Obsolete

$ sfdx hardis:org:purge:flow --targetusername nicolas.vuillamy@gmail.com --status "Obsolete,Draft,InvalidDraft --name TestFlow" Found 4 records: ID MASTERLABEL VERSIONNUMBER DESCRIPTION STATUS 30109000000kX7uAAE TestFlow 2 test flowwww Obsolete 30109000000kX8EAAU TestFlow 6 test flowwww InvalidDraft 30109000000kX8AAAU TestFlow 5 test flowwww InvalidDraft 30109000000kX89AAE TestFlow 4 test flowwww Draft Are you sure you want to delete this list of records (y/n)?: n No record deleted


_See code: [lib/commands/hardis/org/purge/flow.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/org/purge/flow.js)_

## `sfdx hardis:org:retrieve:packageconfig [-d] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Retrieve package configuration from an org

USAGE $ sfdx hardis:org:retrieve:packageconfig [-d] [--websocket ] [--skipauth] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs)

-u, --targetusername=targetusername username or alias for the target org; overrides default target org

--apiversion=apiversion override the api version used for api requests made by this command

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLES $ sfdx hardis:org:retrieve:packageconfig sfdx hardis:org:retrieve:packageconfig -u myOrg


_See code: [lib/commands/hardis/org/retrieve/packageconfig.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/org/retrieve/packageconfig.js)_

## `sfdx hardis:org:retrieve:sources:analytics [-d] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Retrieve all CRM Analytics sources from an org, with workarounds for SFDX bugs

USAGE $ sfdx hardis:org:retrieve:sources:analytics [-d] [--websocket ] [--skipauth] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs)

-u, --targetusername=targetusername username or alias for the target org; overrides default target org

--apiversion=apiversion override the api version used for api requests made by this command

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLE $ sfdx hardis:org:retrieve:sources:analytics


_See code: [lib/commands/hardis/org/retrieve/sources/analytics.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/org/retrieve/sources/analytics.js)_

## `sfdx hardis:org:retrieve:sources:dx [-f <string>] [-t <string>] [-k <string>] [-m <string>] [-o] [-r <string>] [-d] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Retrieve Salesforce DX project from org

USAGE $ sfdx hardis:org:retrieve:sources:dx [-f ] [-t ] [-k ] [-m ] [-o] [-r ] [-d] [--websocket ] [--skipauth] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs) -f, --folder=folder [default: .] Folder

-k, --keepmetadatatypes=keepmetadatatypes Comma separated list of metadatas types that will be the only ones to be retrieved

-m, --filteredmetadatas=filteredmetadatas Comma separated list of Metadatas keys to remove from PackageXml file

-o, --shape Updates project-scratch-def.json from org shape

-r, --instanceurl=instanceurl URL of org instance

-t, --tempfolder=tempfolder [default: ./tmp] Temporary folder

-u, --targetusername=targetusername username or alias for the target org; overrides default target org

--apiversion=apiversion override the api version used for api requests made by this command

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLE $ sfdx hardis:org:retrieve:sources:dx


_See code: [lib/commands/hardis/org/retrieve/sources/dx.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/org/retrieve/sources/dx.js)_

## `sfdx hardis:org:retrieve:sources:dx2 [-x <string>] [-t <string>] [-d] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Retrieve Salesforce DX project from org

USAGE $ sfdx hardis:org:retrieve:sources:dx2 [-x ] [-t ] [-d] [--websocket ] [--skipauth] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs)

-t, --template=template sfdx-hardis package.xml Template name. ex: wave

-u, --targetusername=targetusername username or alias for the target org; overrides default target org

-x, --packagexml=packagexml Path to package.xml file

--apiversion=apiversion override the api version used for api requests made by this command

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLE $ sfdx hardis:org:retrieve:sources:dx2


_See code: [lib/commands/hardis/org/retrieve/sources/dx2.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/org/retrieve/sources/dx2.js)_

## `sfdx hardis:org:retrieve:sources:metadata [-f <string>] [-p <string>] [--includemanaged] [-r <string>] [-d] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Retrieve Salesforce DX project from org

USAGE $ sfdx hardis:org:retrieve:sources:metadata [-f ] [-p ] [--includemanaged] [-r ] [-d] [--websocket ] [--skipauth] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs) -f, --folder=folder [default: .] Folder -p, --packagexml=packagexml Path to package.xml manifest file -r, --instanceurl=instanceurl URL of org instance

-u, --targetusername=targetusername username or alias for the target org; overrides default target org

--apiversion=apiversion override the api version used for api requests made by this command

--includemanaged Include items from managed packages

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLES $ sfdx hardis:org:retrieve:sources:metadata $ SFDX_RETRIEVE_WAIT_MINUTES=200 sfdx hardis:org:retrieve:sources:metadata


_See code: [lib/commands/hardis/org/retrieve/sources/metadata.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/org/retrieve/sources/metadata.js)_

## `sfdx hardis:org:retrieve:sources:retrofit [--commit] [--commitmode updated|all] [--push] [--pushmode default|mergerequest] [--productionbranch <string>] [--retrofittargetbranch <string>] [-d] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Retrieve changes from org link to a ref branch not present in sources

USAGE $ sfdx hardis:org:retrieve:sources:retrofit [--commit] [--commitmode updated|all] [--push] [--pushmode default|mergerequest] [--productionbranch ] [--retrofittargetbranch ] [-d] [--websocket ] [--skipauth] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs)

-u, --targetusername=targetusername username or alias for the target org; overrides default target org

--apiversion=apiversion override the api version used for api requests made by this command

--commit If true, a commit will be performed after the retrofit

--commitmode=(updated|all) [default: updated] Defines if we commit all retrieved updates, or all updates including creations

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--productionbranch=productionbranch Name of the git branch corresponding to the org we want to perform the retrofit on. Can be defined in productionBranch property in .sfdx-hardis.yml

--push If true, a push will be performed after the retrofit

--pushmode=(default|mergerequest) [default: default] Defines if we send merge request options to git push arguments

--retrofittargetbranch=retrofittargetbranch Name of branch the merge request will have as target Can be defined in retrofitBranch property in .sfdx-hardis.yml

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

DESCRIPTION This command need to be triggered from a branch that is connected to a SF org. It will then retrieve all changes not present in that branch sources, commit them and create a merge request against the default branch. If a merge request already exists, it will simply add a new commit.

 Define the following properties in **.sfdx-hardis.yml**

 - **productionBranch** : Name of the git branch that is corresponding to production org
 - **retrofitBranch** : Name of the git branch that will be used as merge request target

 List of metadata to retrieve can be set in three way, in order of priority :

 - `CI_SOURCES_TO_RETROFIT`: env variable (can be defined in CI context)
 - `sourcesToRetrofit` property in `.sfdx-hardis.yml`
 - Default list:

   - CompactLayout
   - CustomApplication
   - CustomField
   - CustomLabel
   - CustomLabels
   - CustomMetadata
   - CustomObject
   - CustomObjectTranslation
   - CustomTab
   - DuplicateRule
   - EmailTemplate
   - FlexiPage
   - GlobalValueSet
   - Layout
   - ListView
   - MatchingRules
   - PermissionSet
   - RecordType
   - StandardValueSet
   - Translations
   - ValidationRule

 You can also ignore some files even if they have been updated in production. To do that, define property 

retrofitIgnoredFiles in .sfdx-hardis.yml

 Example of full retrofit configuration:

 ```yaml
 productionBranch: master
 retrofitBranch: preprod
 retrofitIgnoredFiles:
 - force-app/main/default/applications/MyApp.app-meta.xml
 - force-app/main/default/applications/MyOtherApp.app-meta.xml
 - force-app/main/default/flexipages/MyFlexipageContainingDashboards.flexipage-meta.xml
 ```

EXAMPLES $ sfdx hardis:org:retrieve:sources:retrofit sfdx hardis:org:retrieve:sources:retrofit --productionbranch master --commit --commitmode updated sfdx hardis:org:retrieve:sources:retrofit --productionbranch master --retrofitbranch preprod --commit --commitmode updated --push --pushmode mergerequest


_See code: [lib/commands/hardis/org/retrieve/sources/retrofit.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/org/retrieve/sources/retrofit.js)_

## `sfdx hardis:org:select [-h] [-s] [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Interactive org selection for user

USAGE $ sfdx hardis:org:select [-h] [-s] [-d] [--websocket ] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs) -h, --devhub Also connect associated DevHub

-s, --scratch Select scratch org related to default DevHub

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLE $ sfdx hardis:org:select


_See code: [lib/commands/hardis/org/select.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/org/select.js)_

## `sfdx hardis:org:test:apex [-l NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg] [-d] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Run apex tests in Salesforce org

USAGE $ sfdx hardis:org:test:apex [-l NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg] [-d] [--websocket ] [--skipauth] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs)

-l, --testlevel=(NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg) [default: RunLocalTests] Level of tests to apply to validate deployment

-u, --targetusername=targetusername username or alias for the target org; overrides default target org

--apiversion=apiversion override the api version used for api requests made by this command

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

DESCRIPTION If following configuration is defined, it will fail if apex coverage target is not reached:

  • Env APEX_TESTS_MIN_COVERAGE_ORG_WIDE or .sfdx-hardis property apexTestsMinCoverageOrgWide
  • Env APEX_TESTS_MIN_COVERAGE_ORG_WIDE or .sfdx-hardis property apexTestsMinCoverageOrgWide

You can override env var SFDX_TEST_WAIT_MINUTES to wait more than 60 minutes

EXAMPLE $ sfdx hardis:org:test:apex


_See code: [lib/commands/hardis/org/test/apex.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/org/test/apex.js)_

## `sfdx hardis:org:user:activateinvalid [-p <string>] [-d] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Update sandbox users so their email is valid

USAGE $ sfdx hardis:org:user:activateinvalid [-p ] [-d] [--websocket ] [--skipauth] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs)

-p, --profiles=profiles Comma-separated list of profiles names that you want to reactive users assigned to and with a .invalid email

-u, --targetusername=targetusername username or alias for the target org; overrides default target org

--apiversion=apiversion override the api version used for api requests made by this command

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

DESCRIPTION Example: replaces toto@company.com.dev.invalid with toto@company.com.dev.invalid

See article below

[Reactivate all the sandbox users with .invalid emails in 3 clicks](https:// nicolas.vuillamy.fr/reactivate-all-the-sandbox-users-with-invalid-emails-in-3-clicks-2265af4e3a3d)

EXAMPLES $ sfdx hardis:org:user:activateinvalid $ sfdx hardis:org:user:activateinvalid --targetusername myuser@myorg.com $ sfdx hardis:org:user:activateinvalid --profiles 'System Administrator,MyCustomProfile' --targetusername myuser@myorg.com


_See code: [lib/commands/hardis/org/user/activateinvalid.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/org/user/activateinvalid.js)_

## `sfdx hardis:org:user:freeze [-n <string>] [-p <string>] [-e <string>] [-m <number>] [-d] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Mass freeze users in org before a maintenance or go live

USAGE $ sfdx hardis:org:user:freeze [-n ] [-p ] [-e ] [-m ] [-d] [--websocket ] [--skipauth] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs)

-e, --excludeprofiles=excludeprofiles List of profiles that you want to NOT freeze, separated by commas

-m, --maxuserdisplay=maxuserdisplay [default: 100] Maximum users to display in logs

-n, --name=name Filter according to Name criteria

-p, --includeprofiles=includeprofiles List of profiles that you want to freeze, separated by commas

-u, --targetusername=targetusername username or alias for the target org; overrides default target org

--apiversion=apiversion override the api version used for api requests made by this command

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

DESCRIPTION See user guide in the following article

https://medium.com/@dimitrimonge/freeze-unfreeze-users-during-salesforce-deployment-8a1488bf8dd3

[How to freeze / unfreeze users during a Salesforce deployment](https://med ium.com/@dimitrimonge/freeze-unfreeze-users-during-salesforce-deployment-8a1488bf8dd3)

EXAMPLES $ sfdx hardis:org:user:freeze $ sfdx hardis:org:user:freeze --targetusername myuser@myorg.com $ sfdx hardis:org:user:freeze --includeprofiles 'Standard' $ sfdx hardis:org:user:freeze --excludeprofiles 'System Administrator,Some Other Profile'


_See code: [lib/commands/hardis/org/user/freeze.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/org/user/freeze.js)_

## `sfdx hardis:org:user:unfreeze [-n <string>] [-p <string>] [-e <string>] [-m <number>] [-d] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Mass unfreeze users in org after a maintenance or go live

USAGE $ sfdx hardis:org:user:unfreeze [-n ] [-p ] [-e ] [-m ] [-d] [--websocket ] [--skipauth] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs)

-e, --excludeprofiles=excludeprofiles List of profiles that you want to NOT unfreeze, separated by commas

-m, --maxuserdisplay=maxuserdisplay [default: 100] Maximum users to display in logs

-n, --name=name Filter according to Name criteria

-p, --includeprofiles=includeprofiles List of profiles that you want to unfreeze, separated by commas

-u, --targetusername=targetusername username or alias for the target org; overrides default target org

--apiversion=apiversion override the api version used for api requests made by this command

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

DESCRIPTION See user guide in the following article

https://medium.com/@dimitrimonge/freeze-unfreeze-users-during-salesforce-deployment-8a1488bf8dd3

[How to freeze / unfreeze users during a Salesforce deployment](https://med ium.com/@dimitrimonge/freeze-unfreeze-users-during-salesforce-deployment-8a1488bf8dd3)

EXAMPLES $ sfdx hardis:org:user:unfreeze $ sfdx hardis:org:user:unfreeze --targetusername myuser@myorg.com $ sfdx hardis:org:user:unfreeze --includeprofiles 'Standard' $ sfdx hardis:org:user:unfreeze --excludeprofiles 'System Administrator,Some Other Profile'


_See code: [lib/commands/hardis/org/user/unfreeze.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/org/user/unfreeze.js)_

## `sfdx hardis:package:create [-d] [--websocket <string>] [--skipauth] [-v <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Create a new package

USAGE $ sfdx hardis:package:create [-d] [--websocket ] [--skipauth] [-v ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs)

-v, --targetdevhubusername=targetdevhubusername username or alias for the dev hub org; overrides default dev hub org

--apiversion=apiversion override the api version used for api requests made by this command

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLE $ sfdx hardis:package:create


_See code: [lib/commands/hardis/package/create.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/package/create.js)_

## `sfdx hardis:package:install [-p <string>] [-d] [--websocket <string>] [-k <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Install a package in an org using its id (starting with **04t**)

USAGE $ sfdx hardis:package:install [-p ] [-d] [--websocket ] [-k ] [--skipauth] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs)

-k, --installationkey=installationkey installation key for key-protected package (default: null)

-p, --package=package Package Version Id to install (04t...)

-u, --targetusername=targetusername username or alias for the target org; overrides default target org

--apiversion=apiversion override the api version used for api requests made by this command

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

DESCRIPTION Assisted menu to propose to update installedPackages property in .sfdx-hardis.yml

EXAMPLE $ sfdx hardis:package:install


_See code: [lib/commands/hardis/package/install.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/package/install.js)_

## `sfdx hardis:package:mergexml [-f <string>] [-p <string>] [-x <string>] [-r <string>] [--websocket <string>] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Select and merge package.xml files

USAGE $ sfdx hardis:package:mergexml [-f ] [-p ] [-x ] [-r ] [--websocket ] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -f, --folder=folder [default: manifest] Root folder

-p, --packagexmls=packagexmls Comma separated list of package.xml files to merge. Will be prompted to user if not provided

-r, --result=result Result package.xml file name

-x, --pattern=pattern [default: /**/package.xml] Name criteria to list package.xml files

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLES $ sfdx hardis:package:mergexml $ sfdx hardis:package:mergexml --folder packages --pattern /**/*.xml --result myMergedPackage.xml $ sfdx hardis:package:mergexml --packagexmls "config/mypackage1.xml,config/mypackage2.xml,config/mypackage3.xml" --result myMergedPackage.xml


_See code: [lib/commands/hardis/package/mergexml.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/package/mergexml.js)_

## `sfdx hardis:package:version:create [-d] [-p <string>] [-k <string>] [--deleteafter] [-i] [--websocket <string>] [--skipauth] [-v <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Create a new version of an unlocked package

USAGE $ sfdx hardis:package:version:create [-d] [-p ] [-k ] [--deleteafter] [-i] [--websocket ] [--skipauth] [-v ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs)

-i, --install Install package version on default org after generation

-k, --installkey=installkey Package installation key

-p, --package=package Package identifier that you want to use to generate a new package version

-v, --targetdevhubusername=targetdevhubusername username or alias for the dev hub org; overrides default dev hub org

--apiversion=apiversion override the api version used for api requests made by this command

--deleteafter Delete package version after creating it

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLE $ sfdx hardis:package:version:create


_See code: [lib/commands/hardis/package/version/create.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/package/version/create.js)_

## `sfdx hardis:package:version:list [-d] [--websocket <string>] [--skipauth] [-v <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

List versions of unlocked package

USAGE $ sfdx hardis:package:version:list [-d] [--websocket ] [--skipauth] [-v ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs)

-v, --targetdevhubusername=targetdevhubusername username or alias for the dev hub org; overrides default dev hub org

--apiversion=apiversion override the api version used for api requests made by this command

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLE $ sfdx hardis:package:version:list


_See code: [lib/commands/hardis/package/version/list.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/package/version/list.js)_

## `sfdx hardis:package:version:promote [-d] [-d] [--websocket <string>] [--skipauth] [-v <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Promote package(s) version(s): convert it from beta to released

USAGE $ sfdx hardis:package:version:promote [-d] [-d] [--websocket ] [--skipauth] [-v ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --auto Auto-detect which versions of which packages need to be promoted

-d, --debug Activate debug mode (more logs)

-v, --targetdevhubusername=targetdevhubusername username or alias for the dev hub org; overrides default dev hub org

--apiversion=apiversion override the api version used for api requests made by this command

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLES $ sfdx hardis:package:version:promote $ sfdx hardis:package:version:promote --auto


_See code: [lib/commands/hardis/package/version/promote.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/package/version/promote.js)_

## `sfdx hardis:project:audit:apiversion [-m <number>] [-f] [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Audit API version

USAGE $ sfdx hardis:project:audit:apiversion [-m ] [-f] [-d] [--websocket ] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs)

-f, --failiferror Fails (exit code 1) if an error is found

-m, --minimumapiversion=minimumapiversion [default: 20] Minimum allowed API version

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLE $ sfdx hardis:project:audit:apiversion


_See code: [lib/commands/hardis/project/audit/apiversion.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/project/audit/apiversion.js)_

## `sfdx hardis:project:audit:callincallout [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Generate list of callIn and callouts from sfdx project

USAGE $ sfdx hardis:project:audit:callincallout [-d] [--websocket ] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs) --json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLE $ sfdx hardis:project:audit:callouts


_See code: [lib/commands/hardis/project/audit/callincallout.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/project/audit/callincallout.js)_

## `sfdx hardis:project:audit:duplicatefiles [-p <string>] [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Find duplicate files in sfdx folder (often from past @salesforce/cli bugs)

USAGE $ sfdx hardis:project:audit:duplicatefiles [-p ] [-d] [--websocket ] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs)

-p, --path=path [default: /home/runner/work/sfdx-hardis/sfdx-h ardis] Root path to check

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLE $ sfdx hardis:project:audit:duplicatefiles


_See code: [lib/commands/hardis/project/audit/duplicatefiles.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/project/audit/duplicatefiles.js)_

## `sfdx hardis:project:audit:remotesites [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Generate list of remote sites

USAGE $ sfdx hardis:project:audit:remotesites [-d] [--websocket ] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs) --json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLE $ sfdx hardis:project:audit:remotesites


_See code: [lib/commands/hardis/project/audit/remotesites.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/project/audit/remotesites.js)_

## `sfdx hardis:project:clean:emptyitems [-f <string>] [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Remove unwanted empty items within sfdx project sources

USAGE $ sfdx hardis:project:clean:emptyitems [-f ] [-d] [--websocket ] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs) -f, --folder=folder [default: force-app] Root folder --json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLE $ sfdx hardis:project:clean:emptyitems


_See code: [lib/commands/hardis/project/clean/emptyitems.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/project/clean/emptyitems.js)_

## `sfdx hardis:project:clean:hiddenitems [-f <string>] [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Remove unwanted hidden items within sfdx project sources

USAGE $ sfdx hardis:project:clean:hiddenitems [-f ] [-d] [--websocket ] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs) -f, --folder=folder [default: force-app] Root folder --json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLE $ sfdx hardis:project:clean:hiddenitems


_See code: [lib/commands/hardis/project/clean/hiddenitems.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/project/clean/hiddenitems.js)_

## `sfdx hardis:project:clean:listviews [-f <string>] [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Replace Mine by Everything in ListView, and log the replacements in sfdx-hardis.yml

USAGE $ sfdx hardis:project:clean:listviews [-f ] [-d] [--websocket ] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs) -f, --folder=folder [default: force-app] Root folder --json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLE $ sfdx hardis:project:clean:listviews


_See code: [lib/commands/hardis/project/clean/listviews.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/project/clean/listviews.js)_

## `sfdx hardis:project:clean:manageditems [-n <string>] [-f <string>] [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Remove unwanted managed items within sfdx project sources

USAGE $ sfdx hardis:project:clean:manageditems [-n ] [-f ] [-d] [--websocket ] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs) -f, --folder=folder [default: force-app] Root folder -n, --namespace=namespace Namespace to remove --json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLE $ sfdx hardis:project:clean:manageditems --namespace crta


_See code: [lib/commands/hardis/project/clean/manageditems.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/project/clean/manageditems.js)_

## `sfdx hardis:project:clean:minimizeprofiles [-f <string>] [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Remove all profile attributes that exist on Permission Sets

USAGE $ sfdx hardis:project:clean:minimizeprofiles [-f ] [-d] [--websocket ] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs) -f, --folder=folder [default: force-app] Root folder --json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

DESCRIPTION It is a bad practice to define on Profiles elements that can be defined on Permission Sets.

Salesforce will deprecate such capability in Spring 26.

Don't wait for that, and use minimizeProfiles cleaning to automatically remove from Profiles any permission that exists on a Permission Set !

The following XML tags are removed automatically:

  • classAccesses
  • customMetadataTypeAccesses
  • externalDataSourceAccesses
  • fieldPermissions
  • objectPermissions
  • pageAccesses
  • userPermissions (except on Admin Profile)

You can override this list by defining a property minimizeProfilesNodesToRemove in your .sfdx-hardis.yml config file.

EXAMPLE $ sfdx hardis:project:clean:minimizeprofiles


_See code: [lib/commands/hardis/project/clean/minimizeprofiles.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/project/clean/minimizeprofiles.js)_

## `sfdx hardis:project:clean:orgmissingitems [-f <string>] [-p <string>] [-t <string>] [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Clean SFDX sources from items present neither in target org nor local package.xml

USAGE $ sfdx hardis:project:clean:orgmissingitems [-f ] [-p ] [-t ] [-d] [--websocket ] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs)

-f, --folder=folder [default: force-app] Root folder

-p, --packagexmlfull=packagexmlfull Path to packagexml used for cleaning. Must contain also standard CustomObject and CustomField elements. If not provided, it will be generated from a remote org

-t, --packagexmltargetorg=packagexmltargetorg Target org username or alias to build package.xml (sfdx must be authenticated). If not provided, will be prompted to the user.

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLE $ sfdx hardis:project:clean:orgmissingitems


_See code: [lib/commands/hardis/project/clean/orgmissingitems.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/project/clean/orgmissingitems.js)_

## `sfdx hardis:project:clean:references [-t <string>] [-c <string>] [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Remove unwanted references within sfdx project sources

USAGE $ sfdx hardis:project:clean:references [-t ] [-c ] [-d] [--websocket ] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -c, --config=config Path to a JSON config file or a destructiveChanges.xml file

-d, --debug Activate debug mode (more logs)

-t, --type=all|caseentitlement|dashboards|datadotcom|destructivechanges|localfields|productrequest|entitlement Cleaning type

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLES $ sfdx hardis:project:clean:references $ sfdx hardis:project:clean:references --type all $ sfdx hardis:project:clean:references --config ./cleaning/myconfig.json $ sfdx hardis:project:clean:references --config ./somefolder/myDestructivePackage.xml


_See code: [lib/commands/hardis/project/clean/references.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/project/clean/references.js)_

## `sfdx hardis:project:clean:retrievefolders [-d] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Retrieve dashboards, documents and report folders in DX sources. Use -u ORGALIAS

USAGE $ sfdx hardis:project:clean:retrievefolders [-d] [--websocket ] [--skipauth] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs)

-u, --targetusername=targetusername username or alias for the target org; overrides default target org

--apiversion=apiversion override the api version used for api requests made by this command

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLE $ sfdx hardis:project:clean:retrievefolders


_See code: [lib/commands/hardis/project/clean/retrievefolders.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/project/clean/retrievefolders.js)_

## `sfdx hardis:project:clean:standarditems [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Remove unwanted standard items within sfdx project sources

USAGE $ sfdx hardis:project:clean:standarditems [-d] [--websocket ] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs) --json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLE $ sfdx hardis:project:clean:standarditems


_See code: [lib/commands/hardis/project/clean/standarditems.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/project/clean/standarditems.js)_

## `sfdx hardis:project:clean:systemdebug [-f <string>] [--websocket <string>] [--skipauth] [-d] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Clean System.debug() lines in APEX Code (classes and triggers)

USAGE $ sfdx hardis:project:clean:systemdebug [-f ] [--websocket ] [--skipauth] [-d] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --delete Delete lines with System.debug -f, --folder=folder [default: force-app] Root folder --json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLE $ sfdx hardis:project:clean:systemdebug


_See code: [lib/commands/hardis/project/clean/systemdebug.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/project/clean/systemdebug.js)_

## `sfdx hardis:project:clean:xml [-f <string>] [-p <string> -x <string>] [-n <string>] [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Remove XML elements using Glob patterns and XPath expressions

USAGE $ sfdx hardis:project:clean:xml [-f ] [-p -x ] [-n ] [-d] [--websocket ] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs) -f, --folder=folder [default: force-app] Root folder

-n, --namespace=namespace [default: http://soap.sforce.com/2006/04/metad ata] XML Namespace to use

-p, --globpattern=globpattern Glob pattern to find files to clean. Ex: /**/*.flexipage-meta.xml

-x, --xpath=xpath XPath to use to detect the elements to remove. Ex: //ns:flexiPageRegions//ns:name[conta ins(text(),'dashboardName')]

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

DESCRIPTION This can be very useful to avoid to always remove manually the same elements in the same XML file.

  • globpattern can be any glob pattern allowing to identify the XML files to update, for example /**/*.flexipage-meta.xml

  • xpath can be any xpath following the format //ns:PARENT-TAG-NAME//ns:TAG-NAME[contains(text(),'TAG-VALUE')]. If an element is found, the whole PARENT-TAG-NAME (with its subtree) will be removed.

How to build cleaning XPath

Note: If globpattern and xpath are not sent, elements defined in property cleanXmlPatterns in .sfdx-hardis.yml config file will be used

EXAMPLES $ sfdx hardis:project:clean:xml $ sfdx hardis:project:clean:xml --globpattern "/**/*.flexipage-meta.xml" --xpath "//ns:flexiPageRegions//ns:name[contains(text(),'dashboardName')]"


_See code: [lib/commands/hardis/project/clean/xml.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/project/clean/xml.js)_

## `sfdx hardis:project:configure:auth [-b] [-d] [--websocket <string>] [--skipauth] [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Configure authentication from git branch to target org

USAGE $ sfdx hardis:project:configure:auth [-b] [-d] [--websocket ] [--skipauth] [-v ] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -b, --devhub Configure project DevHub -d, --debug Activate debug mode (more logs)

-u, --targetusername=targetusername username or alias for the target org; overrides default target org

-v, --targetdevhubusername=targetdevhubusername username or alias for the dev hub org; overrides default dev hub org

--apiversion=apiversion override the api version used for api requests made by this command

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLE $ sfdx hardis:project:configure:auth


_See code: [lib/commands/hardis/project/configure/auth.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/project/configure/auth.js)_

## `sfdx hardis:project:convert:profilestopermsets [-e <array>] [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Creates permission sets from existing profiles, with id PS_PROFILENAME

USAGE $ sfdx hardis:project:convert:profilestopermsets [-e ] [-d] [--websocket ] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs) -e, --except=except [default: ] List of filters --json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLE $ sfdx hardis:project:convert:profilestopermsets


_See code: [lib/commands/hardis/project/convert/profilestopermsets.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/project/convert/profilestopermsets.js)_

## `sfdx hardis:project:create [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Create a new SFDX Project

USAGE $ sfdx hardis:project:create [-d] [--websocket ] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs) --json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLE $ sfdx hardis:project:create


_See code: [lib/commands/hardis/project/create.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/project/create.js)_

## `sfdx hardis:project:deploy:sources:dx [-c] [-l NoTestRun|RunSpecifiedTests|RunRepositoryTests|RunLocalTests|RunAllTestsInOrg] [-r <string>] [-p <string>] [--delta] [-d] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Deploy SFDX source to org, following deploymentPlan in .sfdx-hardis.yml

USAGE $ sfdx hardis:project:deploy:sources:dx [-c] [-l NoTestRun|RunSpecifiedTests|RunRepositoryTests|RunLocalTests|RunAllTestsInOrg] [-r ] [-p ] [--delta] [-d] [--websocket ] [--skipauth] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -c, --check Only checks the deployment, there is no impact on target org

-d, --debug Activate debug mode (more logs)

-l, --testlevel=(NoTestRun|RunSpecifiedTests|RunRepositoryTests|RunLocalTests|RunAllTestsInOrg) [default: RunLocalTests] Level of tests to validate deployment. RunRepositoryTests auto-detect and run all repository test classes

-p, --packagexml=packagexml Path to package.xml containing what you want to deploy in target org

-r, --runtests=runtests Apex test classes to run if --testlevel is RunSpecifiedTests

-u, --targetusername=targetusername username or alias for the target org; overrides default target org

--apiversion=apiversion override the api version used for api requests made by this command

--delta Applies sfdx-git-delta to package.xml before other deployment processes

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

DESCRIPTION In case of errors, tips to fix them will be included within the error messages.

Quick Deploy

In case Pull Request comments are configured on the project, Quick Deploy will try to be used (equivalent to button Quick Deploy)

If you do not want to use QuickDeploy, define variable SFDX_HARDIS_QUICK_DEPLOY=false

Delta deployments

To activate delta deployments, define property useDeltaDeployment: true in config/.sfdx-hardis.yml.

This will activate delta deployments only between minor and major branches (major to major remains full deployment mode)

If you want to force the delta deployment into major orgs (ex: preprod to prod), this is not recommended but you can use env variable ALWAYS_ENABLE_DELTA_DEPLOYMENT=true

Dynamic deployment items / Overwrite management

If necessary,you can define the following files (that supports wildcards *):

  • manifest/package-no-overwrite.xml: Every element defined in this file will be deployed only if it is not existing yet in the target org (can be useful with ListView for example, if the client wants to update them directly in production org)
  • manifest/packageXmlOnChange.xml: Every element defined in this file will not be deployed if it already has a similar definition in target org (can be useful for SharingRules for example)

See Overwrite management documentation

Deployment plan

If you need to deploy in multiple steps, you can define a property deploymentPlan in .sfdx-hardis.yml.

  • If a file manifest/package.xml is found, it will be placed with order 0 in the deployment plan

  • If a file manifest/destructiveChanges.xml is found, it will be executed as --postdestructivechanges

  • If env var SFDX_HARDIS_DEPLOY_IGNORE_SPLIT_PACKAGES is defined as false , split of package.xml will be applied

Example:

deploymentPlan:
   packages:
     - label: Deploy Flow-Workflow
       packageXmlFile: manifest/splits/packageXmlFlowWorkflow.xml
       order: 6
     - label: Deploy SharingRules - Case
       packageXmlFile: manifest/splits/packageXmlSharingRulesCase.xml
       order: 30
       waitAfter: 30

Packages installation

You can define a list of package to install during deployments using property installedPackages

  • If INSTALL_PACKAGES_DURING_CHECK_DEPLOY is defined as true (or installPackagesDuringCheckDeploy: true in .sfdx-hardis.yml), packages will be installed even if the command is called with --check mode
  • You can automatically update this property by listing all packages installed on an org using command sfdx hardis:org:retrieve:packageconfig

Example:

installedPackages:
   - Id: 0A35r0000009EtECAU
     SubscriberPackageId: 033i0000000LVMYAA4
     SubscriberPackageName: Marketing Cloud
     SubscriberPackageNamespace: et4ae5
     SubscriberPackageVersionId: 04t6S000000l11iQAA
     SubscriberPackageVersionName: Marketing Cloud
     SubscriberPackageVersionNumber: 236.0.0.2
     installOnScratchOrgs: true                  // true or false depending you want to install this package when 
creating a new scratch org
     installDuringDeployments: true              // set as true to install package during a deployment using sfdx 
hardis:project:deploy:sources:dx
     installationkey: xxxxxxxxxxxxxxxxxxxx       // if the package has a password, write it in this property
     - Id: 0A35r0000009F9CCAU
     SubscriberPackageId: 033b0000000Pf2AAAS
     SubscriberPackageName: Declarative Lookup Rollup Summaries Tool
     SubscriberPackageNamespace: dlrs
     SubscriberPackageVersionId: 04t5p000001BmLvAAK
     SubscriberPackageVersionName: Release
     SubscriberPackageVersionNumber: 2.15.0.9
     installOnScratchOrgs: true
     installDuringDeployments: true

Automated fixes post deployments

List view with scope Mine

If you defined a property listViewsToSetToMine in your .sfdx-hardis.yml, related ListViews will be set to Mine ( see command https://sfdx-hardis.cloudity.com/hardis/org/fix/listviewmine/ )

Example:

listViewsToSetToMine:
   - "Operation__c:MyCurrentOperations"
   - "Operation__c:MyFinalizedOperations"
   - "Opportunity:Default_Opportunity_Pipeline"
   - "Opportunity:MyCurrentSubscriptions"
   - "Opportunity:MySubscriptions"
   - "Account:MyActivePartners"

Troubleshooting: if you need to fix ListViews with mine from an alpine-linux based docker image, use this workaround in your dockerfile:

# Do not use puppeteer embedded chromium
RUN apk add --update --no-cache chromium
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"
ENV CHROMIUM_PATH="/usr/bin/chromium-browser"
ENV PUPPETEER_EXECUTABLE_PATH="$\{CHROMIUM_PATH}" // remove \ before {

If you need to increase the deployment waiting time (force:source:deploy --wait arg), you can define env var SFDX_DEPLOY_WAIT_MINUTES

EXAMPLES $ sfdx hardis:project:deploy:sources:dx $ sfdx hardis:project:deploy:sources:dx --check


_See code: [lib/commands/hardis/project/deploy/sources/dx.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/project/deploy/sources/dx.js)_

## `sfdx hardis:project:deploy:sources:metadata [-c] [-x <string>] [-p <string>] [-f] [-k <string>] [-l NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg] [-d] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Deploy metadatas to source org

USAGE $ sfdx hardis:project:deploy:sources:metadata [-c] [-x ] [-p ] [-f] [-k ] [-l NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg] [-d] [--websocket ] [--skipauth] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -c, --check Only checks the deployment, there is no impact on target org

-d, --debug Activate debug mode (more logs)

-f, --filter Filter metadatas before deploying

-k, --destructivepackagexml=destructivepackagexml Path to destructiveChanges.xml file to deploy

-l, --testlevel=(NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg) [default: RunLocalTests] Level of tests to apply to validate deployment

-p, --packagexml=packagexml Path to package.xml file to deploy

-u, --targetusername=targetusername username or alias for the target org; overrides default target org

-x, --deploydir=deploydir [default: .] Deploy directory

--apiversion=apiversion override the api version used for api requests made by this command

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLE $ sfdx hardis:project:deploy:sources:metadata


_See code: [lib/commands/hardis/project/deploy/sources/metadata.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/project/deploy/sources/metadata.js)_

## `sfdx hardis:project:fix:v53flexipages [-p <string>] [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Fix flexipages for apiVersion v53 (Winter22).

USAGE $ sfdx hardis:project:fix:v53flexipages [-p ] [-d] [--websocket ] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs)

-p, --path=path [default: /home/runner/work/sfdx-hardis/sfdx-h ardis] Root folder

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

DESCRIPTION Note: Update api version to 53.0 in package.xml and sfdx-project.json

EXAMPLE $ sfdx hardis:project:fix:v53flexipages


_See code: [lib/commands/hardis/project/fix/v53flexipages.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/project/fix/v53flexipages.js)_

## `sfdx hardis:project:generate:gitdelta [--branch <string>] [--fromcommit <string>] [--tocommit <string>] [-d] [--websocket <string>] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Generate package.xml git delta between 2 commits

USAGE $ sfdx hardis:project:generate:gitdelta [--branch ] [--fromcommit ] [--tocommit ] [-d] [--websocket ] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs) --branch=branch Git branch to use to generate delta --fromcommit=fromcommit Hash of commit to start from --json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--tocommit=tocommit Hash of commit to stop at

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLE $ sfdx hardis:project:generate:gitdelta


_See code: [lib/commands/hardis/project/generate/gitdelta.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/project/generate/gitdelta.js)_

## `sfdx hardis:project:lint [-f] [-d] [--websocket <string>] [--skipauth] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Apply syntactic analysis (linters) on the repository sources, using Mega-Linter

USAGE $ sfdx hardis:project:lint [-f] [-d] [--websocket ] [--skipauth] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs) -f, --fix Apply linters fixes

-u, --targetusername=targetusername username or alias for the target org; overrides default target org

--apiversion=apiversion override the api version used for api requests made by this command

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLES $ sfdx hardis:project:lint $ sfdx hardis:project:lint --fix


_See code: [lib/commands/hardis/project/lint.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/project/lint.js)_

## `sfdx hardis:project:metadata:findduplicates [-f <array>] [--websocket <string>] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

find duplicate values in XML file(s).

USAGE $ sfdx hardis:project:metadata:findduplicates [-f ] [--websocket ] [--skipauth] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -f, --files=files XML metadata files path --json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

DESCRIPTION Find duplicate values in XML file(s). Keys to be checked can be configured in config/sfdx-hardis.yml using property metadataDuplicateFindKeys.

Default config : metadataDuplicateFindKeys : [object Object]

EXAMPLES

... Required Name Required Name

$ sfdx hardis:project:metadata:findduplicates --file layout.layout-meta.xml [sfdx-hardis] Duplicate values in layout.layout-meta.xml - Key : Layout.layoutSections.layoutColumns.layoutItems.field - Values : Name

$ sfdx hardis:project.metadata:findduplicates -f "force-app/main/default/**/*.xml" [sfdx-hardis] hardis:project:metadata:findduplicates execution time 0:00:00.397 [sfdx-hardis] Duplicate values in layout1.layout-meta.xml - Key : Layout.layoutSections.layoutColumns.layoutItems.field - Values : CreatedById

[sfdx-hardis] Duplicate values in layout2.layout-meta.xml - Key : Layout.layoutSections.layoutColumns.layoutItems.field - Values : LastModifiedById, Name


_See code: [lib/commands/hardis/project/metadata/findduplicates.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/project/metadata/findduplicates.js)_

## `sfdx hardis:scratch:create [-n] [-d] [-d] [--websocket <string>] [--skipauth] [-v <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Create and initialize a scratch org or a source-tracked sandbox (config can be defined using `config/.sfdx-hardis.yml`):

USAGE $ sfdx hardis:scratch:create [-n] [-d] [-d] [--websocket ] [--skipauth] [-v ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs)

-d, --pool Creates the scratch org for a scratch org pool

-n, --forcenew If an existing scratch org exists, do not reuse it but create a new one

-v, --targetdevhubusername=targetdevhubusername username or alias for the dev hub org; overrides default dev hub org

--apiversion=apiversion override the api version used for api requests made by this command

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

DESCRIPTION

  • Install packages
    • Use property installedPackages
  • Push sources
  • Assign permission sets
    • Use property initPermissionSets
  • Run apex initialization scripts
    • Use property scratchOrgInitApexScripts
  • Load data
    • Use property dataPackages

EXAMPLE $ sfdx hardis:scratch:create


_See code: [lib/commands/hardis/scratch/create.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/scratch/create.js)_

## `sfdx hardis:scratch:delete [-d] [--websocket <string>] [--skipauth] [-v <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Assisted menu to delete scratch orgs associated to a DevHub

USAGE $ sfdx hardis:scratch:delete [-d] [--websocket ] [--skipauth] [-v ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs)

-v, --targetdevhubusername=targetdevhubusername username or alias for the dev hub org; overrides default dev hub org

--apiversion=apiversion override the api version used for api requests made by this command

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth Skip authentication check when a default username is required

--websocket=websocket Websocket host:port for VsCode SFDX Hardis UI integration

EXAMPLE $ sfdx hardis:scratch:delete


_See code: [lib/commands/hardis/scratch/delete.js](https://github.com/hardisgroupcom/sfdx-hardis/blob/v4.28.4/lib/commands/hardis/scratch/delete.js)_

## `sfdx hardis:scratch:pool:create [-d] [--websocket <string>] [--skipauth] [-v <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Select a data storage service and configure information to build a scratch org pool

USAGE $ sfdx hardis:scratch:pool:create [-d] [--websocket ] [--skipauth] [-v ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS -d, --debug Activate debug mode (more logs)

-v, --targetdevhubusername=targetdevhubusername username or alias for the dev hub org; overrides default dev hub org

--apiversion=apiversion override the api version used for api requests made by this command

--json format output as json

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation

--skipauth

/sfdx-hardis/

    Package Sidebar

    Install

    npm i sfdx-hardis

    Weekly Downloads

    893

    Version

    4.28.4

    License

    AGPL-3.0

    Unpacked Size

    2.72 MB

    Total Files

    569

    Last publish

    Collaborators

    • nvuillam