Command Glossary
Commands in sfpowercripts
sfdx sfpowerscripts:analyze:pmd
sfdx sfpowerscripts:apextests:trigger
sfdx sfpowerscripts:apextests:validate
sfdx sfpowerscripts:artifacts:fetch
sfdx sfpowerscripts:artifacts:query
sfdx sfpowerscripts:changelog:generate
sfdx sfpowerscripts:orchestrator:build
sfdx sfpowerscripts:orchestrator:deploy
sfdx sfpowerscripts:orchestrator:prepare
sfdx sfpowerscripts:orchestrator:promote
sfdx sfpowerscripts:orchestrator:publish
sfdx sfpowerscripts:orchestrator:quickbuild
sfdx sfpowerscripts:orchestrator:release
sfdx sfpowerscripts:orchestrator:validate
sfdx sfpowerscripts:orchestrator:validateAgainstOrg
sfdx sfpowerscripts:orchestrator:validateAgainstPool
sfdx sfpowerscripts:package:data:create
sfdx sfpowerscripts:package:data:install
sfdx sfpowerscripts:package:source:create
sfdx sfpowerscripts:package:source:install
sfdx sfpowerscripts:package:unlocked:create
sfdx sfpowerscripts:package:unlocked:install
sfdx sfpowerscripts:package:version:increment
sfdx sfpowerscripts:pool:delete
sfdx sfpowerscripts:pool:fetch
sfdx sfpowerscripts:pool:list
sfdx sfpowerscripts:pool:metrics:publish
sfdx sfpowerscripts:pool:org:delete
sfdx sfpowerscripts:releasedefinition:generate
sfdx sfpowerscripts:dependency:expand
sfdx sfpowerscripts:dependency:shrink
This task is used to run a static analysis of the apex classes and triggers using PMD, Please ensure that the SFDX CLI and sfpowerkit plugin are installed before using this task
USAGE
$ sfdx sfpowerscripts:analyze:pmd [--sourcedir <string>] [--ruleset <string>] [--rulesetpath <string>] [--format <string>] [-o
<string>] [--version <string>] [--threshold <integer>] [-b] [--refname <string>] [--json] [--loglevel
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
FLAGS
-b, --istobreakbuild
Enable this option if the build should be reported as failure if 1 or more critical defects are reported during the
analysis
-o, --outputpath=<value>
The file to which the output for static analysis will be written
--format=<option>
[default: text] https://pmd.github.io/latest/pmd_userdocs_cli_reference.html#available-report-formats
<options: text|textcolor|csv|emacs|summaryhtml|html|xml|xslt|yahtml|vbhtml|textpad|sarif>
--json
format output as json
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)
[default: info] logging level for this command invocation
--refname=<value>
Reference name to be prefixed to output variables
--ruleset=<option>
[default: sfpowerkit] Inbuilt is the default ruleset that comes with the task, If you choose custom, please provide
the path to the ruleset
<options: sfpowerkit|Custom>
--rulesetpath=<value>
The path to the ruleset if you are utilizing your own ruleset
--sourcedir=<value>
The directory that is to be analyzed using PMD, If omitted default project directory as mentioned in sfdx-project.json
will be used
--threshold=<value>
[default: 1] Violations with a priority less than or equal to the threshold will cause the command to fail
--version=<value>
[default: 6.39.0] The version of PMD to be used for static analysis
DESCRIPTION
This task is used to run a static analysis of the apex classes and triggers using PMD, Please ensure that the SFDX CLI
and sfpowerkit plugin are installed before using this task
EXAMPLES
$ sfdx sfpowerscripts:analyze:pmd --sourcedir <dir>
Output variable:
sfpowerscripts_pmd_output_path
<refname>_sfpowerscripts_pmd_output_path
sfdx sfpowerscripts:apextests:trigger [-l <string>] [-n <string>] [-c] [--validatepackagecoverage] [-s] [--specifiedtests <string>] [--apextestsuite <string>] [-p <integer>] [-w <number>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
sfdx sfpowerscripts:apextests:trigger [-l <string>] [-n <string>] [-c] [--validatepackagecoverage] [-s] [--specifiedtests <string>] [--apextestsuite <string>] [-p <integer>] [-w <number>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
Triggers Apex unit test in an org. Supports test level RunAllTestsInPackage, which optionally allows validation of individual class code coverage
USAGE
$ sfdx sfpowerscripts:apextests:trigger [-l <string>] [-n <string>] [-c] [--validatepackagecoverage] [-s] [--specifiedtests
<string>] [--apextestsuite <string>] [-p <integer>] [-w <number>] [-u <string>] [--apiversion <string>] [--json]
[--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
FLAGS
-c, --validateindividualclasscoverage
Validate that individual classes have a coverage greater than the minimum required percentage coverage, only
available when test level is RunAllTestsInPackage
-l, --testlevel=<option>
[default: RunLocalTests] The test level of the test that need to be executed when the code is to be deployed
<options: RunSpecifiedTests|RunApexTestSuite|RunLocalTests|RunAllTestsInOrg|RunAllTestsInPackage>
-n, --package=<value>
Name of the package to run tests. Required when test level is RunAllTestsInPackage
-p, --coveragepercent=<value>
[default: 75] Minimum required percentage coverage, when validating code coverage
-s, --synchronous
Select an option if the tests are to be run synchronously
-u, --targetusername=<value>
username or alias for the target org; overrides default target org
-w, --waittime=<value>
[default: 60] wait time for command to finish in minutes
--apextestsuite=<value>
comma-separated list of Apex test suite names to run
--apiversion=<value>
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: info] logging level for this command invocation
--specifiedtests=<value>
comma-separated list of Apex test class names or IDs and, if applicable, test methods to run
--validatepackagecoverage
Validate that the package coverage is greater than the minimum required percentage coverage, only available when
test level is RunAllTestsInPackage
DESCRIPTION
Triggers Apex unit test in an org. Supports test level RunAllTestsInPackage, which optionally allows validation of
individual class code coverage
EXAMPLES
$ sfdx sfpowerscripts:apextests:trigger -u scratchorg -l RunLocalTests -s
$ sfdx sfpowerscripts:apextests:trigger -u scratchorg -l RunAllTestsInPackage -n <mypackage> -c
Validates apex test coverage in the org, Please ensure that the SFDX CLI and sfpowerkit plugin are installed before using this task.
USAGE
$ sfdx sfpowerscripts:apextests:validate -t <string> [-u <string>] [--json] [--loglevel
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
FLAGS
-t, --testcoverage=<value> (required) The percentage of test
coverage for apex classes, that
should be as per the last test run
status
-u, --targetorg=<value> [default: scratchorg] Alias or
username of the target org
--json format output as json
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: info] logging level for
this command invocation
DESCRIPTION
Validates apex test coverage in the org, Please ensure that the SFDX CLI and sfpowerkit plugin are installed before
using this task.
EXAMPLES
$ sfdx sfpowerscripts:apextests:validate -u scratchorg -t 80
Fetch artifacts from an artifact registry that is either NPM compatible or supports universal artifacts
USAGE
$ sfdx sfpowerscripts:artifacts:fetch -d <directory> [-p <filepath>] [--scope <string> [--npm | -f <filepath>]] [--npmrcpath
<filepath> ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
FLAGS
-d, --artifactdir=<value> (required) [default: artifacts]
Directory to save downloaded
artifacts
-f, --scriptpath=<value> (Optional: no-NPM) Path to script
that authenticates and downloads
artifacts from the registry
-p, --releasedefinition=<value> Path to YAML file containing map of
packages and package versions to
download
--json format output as json
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: info] logging level for
this command invocation
--npm Download artifacts from a
pre-authenticated private npm
registry
--npmrcpath=<value> Path to .npmrc file used for
authentication to registry. If left
blank, defaults to home directory
--scope=<value> (required for NPM) User or
Organisation scope of the NPM
package
DESCRIPTION
Fetch artifacts from an artifact registry that is either NPM compatible or supports universal artifacts