Command Glossary
Commands in sfpowerscripts

Commands

sfdx sfpowerscripts:orchestrator:prepare

Prepare a pool of scratchorgs with all the packages upfront, so that any incoming change can be validated in an optimized manner, Please note for this feature to work the devhub should be enabled and scratchorgpool (additional fields to ScratchOrgInfo object) should be deployed to devhub. Please see the instructions here. This command also install an unlocked package to the scratch org 'sfpowerscripts-artifact' (04t1P000000ka9mQAA) for skipping unchanged packages during a validation phase. This particular package can be prebuilt against your org and the ID could be overriden by setting up the environment variable SFPOWERSCRIPTS_ARTIFACT_UNLOCKED_PACKAGE
1
Prepare a pool of scratchorgs with all the packages upfront, so that any incoming change can be validated in an optimized manner
2
3
USAGE
4
$ sfdx sfpowerscripts:orchestrator:prepare [-f <filepath>] [--npmrcpath <filepath>] [--keys <string>] [-v <string>] [--apiversion <string>] [--json] [--loglevel
5
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
6
7
OPTIONS
8
-f, --poolconfig=poolconfig [default: config/poolconfig.json]
9
The path to the configuration file
10
for creating a pool of scratch
11
orgs
12
13
-v, --targetdevhubusername=targetdevhubusername username or alias for the dev hub org;
14
overrides default dev hub org
15
16
--apiversion=apiversion override the api version used for api
17
requests made by this command
18
19
--json format output as json
20
21
--keys=keys Keys to be used while installing
22
any managed package dependencies.
23
Required format is a string of
24
key-value pairs separated by spaces
25
e.g. packageA:pw123 packageB:pw123 packageC:pw123
26
27
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: info] logging level for this command
28
invocation
29
30
--npmrcpath=npmrcpath Path to .npmrc file used for authentication
31
to a npm registry when using npm based artifacts.
32
If left blank, defaults to home directory
33
34
EXAMPLE
35
$ sfdx sfpowerscripts:orchestrator:prepare -f config/mypoolconfig.json -v <devhub>
Copied!

sfdx sfpowerscripts:orchestrator:validate

Validate the incoming change against a prepared scratch org fetched from the provided pools (created using the prepare command). If the Sfpowerscripts Artifact package is installed in the scratch orgs, only the changed packages in the repo will be deployed by comparing against the package version installed in the fetched scratchorg.
1
Validate the incoming change against a prepared scratch org fetched from the provided pools.
2
3
USAGE
4
$ sfdx sfpowerscripts:orchestrator:validate -u <string> -p <array> -f <filepath> -i <string> [--shapefile <string>]
5
[--coveragepercent <integer>] [-g <array>] [-x]
6
7
OPTIONS
8
-f, --jwtkeyfile=jwtkeyfile (required) Path to a file containing
9
the private key
10
11
-g, --logsgroupsymbol=logsgroupsymbol Symbol used by CICD platform to
12
group/collapse logs in the console.
13
Provide an opening group, and an
14
optional closing group symbol.
15
16
-i, --clientid=clientid (required) OAuth client ID, also
17
known as the consumer key
18
19
-p, --pools=pools (required) Fetch scratch-org
20
validation environment from one of
21
listed pools, sequentially
22
23
-u, --devhubusername=devhubusername (required) Authentication username
24
for Dev Hub
25
26
-x, --deletescratchorg Delete scratch-org validation
27
environment, after the command has
28
finished running
29
30
--coveragepercent=coveragepercent [default: 75] Minimum required
31
percentage coverage for validating
32
code coverage of packages with Apex
33
classes
34
35
36
--shapefile=shapefile Path to .zip file of scratch org
37
shape / metadata to deploy
38
39
EXAMPLE
40
$ sfdx sfpowerscripts:orchestrator:validate -p "POOL_TAG_1,POOL_TAG_2" -u <devHubUsername> -i <clientId> -f <jwt_file>
Copied!

sfdx sfpowerscripts:orchestrator:validateAgainstOrg

Validate the incoming change against a target org. If the Sfpowerscripts Artifact package is installed in the target org, only changed packages in the repo will be deployed by comparing against the package version installed in the target org.
1
Validate the incoming change against target org
2
3
USAGE
4
$ sfdx sfpowerscripts:orchestrator:validateAgainstOrg -u <string> [--coveragepercent <integer>] [-g <array>] [--json] [--loglevel
5
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
6
7
OPTIONS
8
-g, --logsgroupsymbol=logsgroupsymbol Symbol used by CICD platform to group/collapse logs in the console. Provide
9
an opening group, and an optional closing group symbol.
10
11
-u, --targetorg=targetorg (required) Alias/User Name of the target environment
12
13
--coveragepercent=coveragepercent [default: 75] Minimum required percentage coverage for validating code
14
coverage of packages with Apex classes
15
16
--json format output as json
17
18
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation
19
20
EXAMPLE
21
$ sfdx sfpowerscripts:orchestrator:validateAgainstOrg -u <targetorg>
Copied!

sfdx sfpowerscripts:orchestrator:quickbuild

Build packages (unlocked/source/data) in a repo in parallel, without validating depenencies or coverage in the case of unlocked packages. For diffcheck to work(build packages that are changed), it compares against the last know git tags, so make sure that you strategically place the tags push at the required state in your pipeline.
1
Build packages (unlocked/source/data) in a repo in parallel, without validating depenencies or coverage in the case of unlocked packages
2
3
USAGE
4
$ sfdx sfpowerscripts:orchestrator:quickbuild [--diffcheck] [--gittag] [-r <string>] [-f <filepath>] [--artifactdir
5
<directory>] [--waittime <number>] [--buildnumber <number>] [--executorcount <number>] [--branch <string>] [--tag
6
<string>] [-v <string>] [--apiversion <string>]
7
8
OPTIONS
9
-f, --configfilepath=configfilepath [default:
10
config/project-scratch-def.json]
11
Path in the current project
12
directory containing config file
13
for the packaging org
14
15
-r, --repourl=repourl Custom source repository URL to use
16
in artifact metadata, overrides
17
origin URL defined in git config
18
19
-v, --targetdevhubusername=targetdevhubusername username or alias for the dev hub
20
org; overrides default dev hub org
21
22
--apiversion=apiversion override the api version used for
23
api requests made by this command
24
25
--artifactdir=artifactdir [default: artifacts] The directory
26
where the generated artifact is to
27
be written
28
29
--branch=branch The git branch that this build is
30
triggered on, Useful for metrics and
31
general identification purposes
32
33
--buildnumber=buildnumber [default: 1] The build number to be
34
used for source packages, Unlocked
35
Packages will be assigned the
36
buildnumber from Saleforce directly
37
if using .NEXT
38
39
--diffcheck Only build the packages which have
40
changed by analyzing previous tags
41
42
--executorcount=executorcount [default: 5] Number of parallel
43
package task schedulors
44
45
--gittag Tag the current commit ID with an
46
annotated tag containing the package
47
name and version - does not push tag
48
49
--tag=tag Tag the build with a label, useful
50
to identify in metrics
51
52
--waittime=waittime [default: 120] Wait time for command
53
to finish in minutes
Copied!

sfdx sfpowerscripts:orchestrator:build

Build all packages (unlocked/source/data) in a repo in parallel, respecting the dependency of each packages and generate artifacts to a provided directory.For diffcheck to work(build packages that are changed), it compares against the last know git tags, so make sure that you strategically place the tags push at the required state in your pipeline.
1
Build all packages (unlocked/source/data) in a repo in parallel, respecting the dependency of each packages and generate artifacts to a provided directory
2
3
USAGE
4
$ sfdx sfpowerscripts:orchestrator:build [--diffcheck] [--gittag] [-r <string>] [-f <filepath>] [--artifactdir
5
<directory>] [--waittime <number>] [--buildnumber <number>] [--executorcount <number>] [--branch <string>] [--tag
6
<string>] [-v <string>] [--apiversion <string>]
7
8
OPTIONS
9
-f, --configfilepath=configfilepath [default:
10
config/project-scratch-def.json]
11
Path in the current project
12
directory containing config file
13
for the packaging org
14
15
-r, --repourl=repourl Custom source repository URL to use
16
in artifact metadata, overrides
17
origin URL defined in git config
18
19
-v, --targetdevhubusername=targetdevhubusername username or alias for the dev hub
20
org; overrides default dev hub org
21
22
--apiversion=apiversion override the api version used for
23
api requests made by this command
24
25
--artifactdir=artifactdir [default: artifacts] The directory
26
where the generated artifact is to
27
be written
28
29
--branch=branch The git branch that this build is
30
triggered on, Useful for metrics and
31
general identification purposes
32
33
--buildnumber=buildnumber [default: 1] The build number to be
34
used for source packages, Unlocked
35
Packages will be assigned the
36
buildnumber from Saleforce directly
37
if using .NEXT
38
39
--diffcheck Only build the packages which have
40
changed by analyzing previous tags
41
42
--executorcount=executorcount [default: 5] Number of parallel
43
package task schedulors
44
45
--gittag Tag the current commit ID with an
46
annotated tag containing the package
47
name and version - does not push tag
48
49
--tag=tag Tag the build with a label, useful
50
to identify in metrics
51
52
--waittime=waittime [default: 120] Wait time for command
53
to finish in minutes
Copied!

sfdx sfpowerscripts:orchestrator:deploy

Deploy packages from the provided aritfact directory, to a given org, using the order and configurable flags provided in sfdx-project.json skipifalreadyinstalled only works provide the target org has sfpowerscripts-artifact' (04t1P000000ka9mQAA) installed. Please note you can deploy your own instance of 'sfpowerscripts-artifact' by building it from the repo and overriding using the environment variable SFPOWERSCRIPTS_ARTIFACT_UNLOCKED_PACKAGE
1
Deploy packages from the provided aritfact directory, to a given org, using the order and configurable flags provided in sfdx-project.json
2
3
USAGE
4
$ sfdx sfpowerscripts:orchestrator:deploy -u <string> [--artifactdir <directory>] [--waittime <number>] [-g <array>]
5
[-t <string>] [--skipifalreadyinstalled]
6
7
OPTIONS
8
-g, --logsgroupsymbol=logsgroupsymbol Symbol used by CICD platform to
9
group/collapse logs in the console.
10
Provide an opening group, and an
11
optional closing group symbol.
12
13
-t, --tag=tag Tag the deploy with a label, useful
14
for identification in metrics
15
16
-u, --targetorg=targetorg (required) [default: scratchorg]
17
Alias/User Name of the target
18
environment
19
20
--artifactdir=artifactdir [default: artifacts] The directory
21
containing artifacts to be deployed
22
23
24
--skipifalreadyinstalled Skip the package installation if the
25
package is already installed in the
26
org
27
28
--waittime=waittime [default: 120] Wait time for command
29
to finish in minutes
30
31
EXAMPLE
32
$ sfdx sfpowerscripts:orchestrator:deploy -u <username>
Copied!

sfdx sfpowerscripts:orchestrator:promote

Promotes validated unlocked packages with code coverage greater than 75%
1
Promotes validated unlocked packages with code coverage greater than 75%
2
3
USAGE
4
$ sfdx sfpowerscripts:orchestrator:promote -d <directory> [-v <string>]
5
OPTIONS
6
-d, --artifactdir=artifactdir (required) [default: artifacts] The
7
directory where artifacts are
8
located
9
10
-v, --devhubalias=devhubalias [default: HubOrg] Provide the alias
11
of the devhub previously
12
authenticated, default value is
13
HubOrg if using the Authenticate
14
Devhub task
15
16
17
EXAMPLE
18
$ sfdx sfpowerscripts:orchestrator:promote -d path/to/artifacts -v <org>
Copied!

sfdx sfpowerscripts:orchestrator:publish

Publish packages to an artifact registry, using a user-provided script that is responsible for authenticating & uploading to the registry.
1
Publish packages to an artifact registry, using a user-provided script that is responsible for authenticating & uploading to the registry.
2
3
USAGE
4
$ sfdx sfpowerscripts:orchestrator:publish -d <directory> -f <filepath> [-p -v <string>] [-t <string>]
5
OPTIONS
6
-d, --artifactdir=artifactdir (required) [default: artifacts] The
7
directory containing artifacts to be
8
published
9
10
-f, --scriptpath=scriptpath (required) Path to script that
11
authenticates and uploaded artifacts
12
to the registry
13
14
-p, --publishpromotedonly Only publish unlocked packages that
15
have been promoted
16
17
-t, --tag=tag Tag the publish with a label, useful
18
for identification in metrics
19
20
-v, --devhubalias=devhubalias Provide the alias of the devhub
21
previously authenticated
22
23
24
EXAMPLES
25
$ sfdx sfpowerscripts:orchestrator:publish -f path/to/script
26
$ sfdx sfpowerscripts:orchestrator:publish -p -v HubOrg
Copied!

sfdx sfpowerscripts:orchestrator:release

Initiate a release to an org, according to the release configuration defined in a release-definition YAML file
1
Initiate a release to an org, according to the configuration defined in a release-definition YAML file
2
3
USAGE
4
$ sfdx sfpowerscripts:orchestrator:release -u <string> [-p <filepath>] [--scope <string> [--npm | -f <filepath>]] [--npmrcpath <filepath>
5
undefined] [-g <array>] [-t <string>] [--waittime <number>] [--keys <string>] [-b <string> --generatechangelog] [-v <string>] [--json]
6
[--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
7
8
OPTIONS
9
-b, --branchname=branchname Repository branch in which the changelog files are
10
located
11
12
-f, --scriptpath=scriptpath (Optional: no-NPM) Path to script that authenticates and
13
downloads artifacts from the registry
14
15
-g, --logsgroupsymbol=logsgroupsymbol Symbol used by CICD platform to group/collapse logs in
16
the console. Provide an opening group, and an optional
17
closing group symbol.
18
19
-p, --releasedefinition=releasedefinition Path to YAML file containing map of packages and package
20
versions to download
21
22
-t, --tag=tag Tag the release with a label, useful for identification
23
in metrics
24
25
-u, --targetorg=targetorg (required) [default: scratchorg] Alias/User Name of the
26
target environment
27
28
-v, --devhubalias=devhubalias [default: HubOrg] Provide the alias of the devhub
29
previously authenticated, default value is HubOrg
30
31
--generatechangelog Create a release changelog
32
33
--json format output as json
34
35
--keys=keys Keys to be used while installing any managed package
36
dependencies. Required format is a string of key-value
37
pairs separated by spaces e.g. packageA:pw123
38
packageB:pw123 packageC:pw123
39
40
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command
41
invocation
42
43
--npm Download artifacts from a pre-authenticated private npm
44
registry
45
46
--npmrcpath=npmrcpath Path to .npmrc file used for authentication to registry.
47
If left blank, defaults to home directory
48
49
--scope=scope (required for NPM) User or Organisation scope of the NPM
50
package
51
52
--waittime=waittime [default: 120] Wait time for package installation
53
54
EXAMPLE
55
sfdx sfpowerscripts:orchestrator:release -p path/to/releasedefinition.yml -u myorg --npm --scope myscope --generatechangelog
Copied!

sfdx sfpowerscripts:changelog:generate

Generates release changelog, providing a summary of artifact versions, work items and commits introduced in a release. Creates a release definition based on artifacts contained in the artifact directory, and compares it to previous release definition in changelog stored on a source repository
1
Generates release changelog, providing a summary of artifact versions, work items and commits introduced in a release. Creates a release definition based on artifacts contained in the artifact directory, and compares it to previous release definition in changelog stored on a source repository
2
3
USAGE
4
$ sfdx sfpowerscripts:changelog:generate -d <directory> -n <string> -w <string> -r <string> -b <string> [--limit
5
<integer>] [--workitemurl <string>] [--showallartifacts]
6
OPTIONS
7
8
-d, --artifactdir=artifactdir (required) [default: artifacts]
9
Directory containing sfpowerscripts
10
artifacts
11
12
-n, --releasename=releasename (required) Name of the release for
13
which to generate changelog
14
15
-r, --repourl=repourl (required) Repository in which the
16
changelog files are located. Assumes
17
user is already authenticated.
18
19
-w, --workitemfilter=workitemfilter (required) Regular expression used
20
to search for work items (user
21
stories) introduced in release
22
23
--json format output as json
24
25
--limit=limit limit the number of releases to
26
display in changelog markdown
27
28
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
29
this command invocation
30
31
--showallartifacts Show all artifacts in changelog
32
markdown, including those that have
33
not changed in the release
34
35
--workitemurl=workitemurl Generic URL for work items. Each
36
work item ID will be appended to the
37
URL, providing quick access to work
38
items
39
40
EXAMPLE
41
$ sfdx sfpowerscripts:changelog:generate -n <releaseName> -d path/to/artifact/directory -w <regexp> -r <repoURL> -b
42
<branchName>
Copied!

sfdx sfpowerscripts:analyze:pmd

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
1
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
2
3
USAGE
4
$ sfdx sfpowerscripts:analyze:pmd [--sourcedir <string>] [--ruleset <string>] [--rulesetpath <string>] [--format
5
<string>] [-o <string>] [--version <string>] [-b] [--refname <string>] [--json] [--loglevel
6
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
7
8
OPTIONS
9
-b, --istobreakbuild Enable this option if the build
10
should be reported as failure if 1
11
or more critical defects are
12
reported during the analysis
13
14
-o, --outputpath=outputpath The file to which the output for
15
static analysis will be written
16
17
--format=text|textcolor|csv|emacs|summaryhtml|html|xml|xslt|yahtml|vbhtml|textpad [default: text]
18
https://pmd.github.io/latest/pmd_us
19
erdocs_cli_reference.html#available
20
-report-formats
21
22
--json format output as json
23
24
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
25
this command invocation
26
27
--refname=refname Reference name to be prefixed to
28
output variables
29
30
--ruleset=sfpowerkit|Custom [default: sfpowerkit] Inbuilt is
31
the default ruleset that comes with
32
the task, If you choose custom,
33
please provide the path to the
34
ruleset
35
36
--rulesetpath=rulesetpath The path to the ruleset if you are
37
utilizing your own ruleset
38
39
--sourcedir=sourcedir The directory that is to be analzed
40
using PMD, If omitted default
41
project diretory as mentioned in
42
sfdx-project.json will be used
43
44
--version=version [default: 6.26.0] The version of
45
PMD to be used for static analysis
46
47
EXAMPLES
48
$ sfdx sfpowerscripts:analyze:pmd -b
49
50
Output variable:
51
sfpowerscripts_pmd_output_path
52
<refname>_sfpowerscripts_pmd_output_path
Copied!

sfdx sfpowerscripts:apextests:trigger

Triggers Apex unit test in an org. Supports test level RunAllTestsInPackage, which optionally allows validation of individual class code coverage
1
Triggers Apex unit test in an org. Supports test level RunAllTestsInPackage, which optionally allows validation of individual class code coverage
2
3
USAGE
4
$ sfdx sfpowerscripts:apextests:trigger [-u <string>] [-l <string>] [-n <string>] [-c] [--validatepackagecoverage]
5
[-s] [--specifiedtests <string>] [--apextestsuite <string>] [-p <integer>] [--waittime <string>] [--json] [--loglevel
6
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
7
8
OPTIONS
9
-c, --validateindividualclasscoverage
10
Validate that individual classes have a coverage greater than the minimum required percentage coverage, only
11
available when test level is RunAllTestsInPackage
12
13
-l, --testlevel=RunSpecifiedTests|RunApexTestSuite|RunLocalTests|RunAllTestsInOrg|RunAllTestsInPackage
14
[default: RunLocalTests] The test level of the test that need to be executed when the code is to be deployed
15
16
-n, --package=package
17
Name of the package to run tests. Required when test level is RunAllTestsInPackage
18
19
-p, --coveragepercent=coveragepercent
20
[default: 75] Minimum required percentage coverage, when validating code coverage
21
22
-s, --synchronous
23
Select an option if the tests are to be run synchronously
24
25
-u, --targetorg=targetorg
26
[default: scratchorg] username or alias for the target org; overrides default target org
27
28
--apextestsuite=apextestsuite
29
comma-separated list of Apex test suite names to run
30
31
--json
32
format output as json
33
34
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)
35
[default: warn] logging level for this command invocation
36
37
--specifiedtests=specifiedtests
38
comma-separated list of Apex test class names or IDs and, if applicable, test methods to run
39
40
--validatepackagecoverage
41
Validate that the package coverage is greater than the minimum required percentage coverage, only available when
42
test level is RunAllTestsInPackage
43
44
--waittime=waittime
45
[default: 60] wait time for command to finish in minutes
46
47
EXAMPLES
48
$ sfdx sfpowerscripts:apextests:trigger -u scratchorg -l RunLocalTests -s
49
$ sfdx sfpowerscripts:apextests:trigger -u scratchorg -l RunAllTestsInPackage -n <mypackage> -c
Copied!

sfdx sfpowerscripts:apextests:validate

Validates apex test coverage in the org, Please ensure that the SFDX CLI and sfpowerkit plugin are installed before using this task.
1
Validates apex test coverage in the org, Please ensure that the SFDX CLI and sfpowerkit plugin are installed before using this task.
2
3
USAGE
4
$ sfdx sfpowerscripts:apextests:validate -t <string> [-u <string>] [--json] [--loglevel
5
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
6
7
OPTIONS
8
-t, --testcoverage=testcoverage (required) The percentage of test
9
coverage for apex clasess, that
10
should be as per the last test run
11
status
12
13
-u, --targetorg=targetorg [default: scratchorg] Alias or
14
username of the target org
15
16
--json format output as json
17
18
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
19
this command invocation
20
21
EXAMPLE
22
$ sfdx sfpowerscripts:apextests:validate -u scratchorg -t 80
Copied!

sfdx sfpowerscripts:package:data:create

Creates a versioned artifact from a source directory containing SFDMU-based data (in csv format and export json). The artifact can be consumed by release pipelines, to deploy the data to orgs
1
Creates a versioned artifact from a source directory containing SFDMU-based data (in csv format and export json). The artifact can be consumed by release pipelines, to deploy the data to orgs
2
3
USAGE
4
$ sfdx sfpowerscripts:package:data:create -n <string> -v <string> [--artifactdir <directory>] [--diffcheck] [--branch
5
<string>] [--gittag] [-r <string>] [--refname <string>]
6
7
OPTIONS
8
-n, --package=package
9
(required) The name of the package
10
11
-r, --repourl=repourl
12
Custom source repository URL to use in artifact metadata, overrides origin URL defined in git config
13
14
-v, --versionnumber=versionnumber
15
(required) The format is major.minor.patch.buildnumber . This will override the build number mentioned in the
16
sfdx-project.json, Try considering the use of Increment Version Number task before this task
17
18
--artifactdir=artifactdir
19
[default: artifacts] The directory where the artifact is to be written
20
21
--branch=branch
22
The git branch that this build is triggered on, Useful for metrics and general identification purposes
23
24
--diffcheck
25
Only build when the package has changed
26
27
--gittag
28
Tag the current commit ID with an annotated tag containing the package name and version - does not push tag
29
30
--refname=refname
31
Reference name to be prefixed to output variables
32
33
EXAMPLES
34
$ sfdx sfpowerscripts:package:data:create -n mypackage -v <version>
35
$ sfdx sfpowerscripts:package:data:create -n <mypackage> -v <version> --diffcheck --gittag
36
Output variable:
37
sfpowerscripts_artifact_directory
38
<refname>_sfpowerscripts_artifact_directory
39
sfpowerscripts_package_version_number
40
<refname>_sfpowerscripts_package_version_number
Copied!

sfdx sfpowerscripts:package:data:install

Installs a SFDMU-based data package consisting of csvfiles and export.json to a target org
1
Installs a SFDMU-based data package consisting of csvfiles and export.json to a target org
2
3
USAGE
4
$ sfdx sfpowerscripts:package:data:install -n <string> -u <string> [--artifactdir <directory>] [-s]
5
[--skipifalreadyinstalled] [--subdirectory <directory>]
6
7
OPTIONS
8
-n, --package=package (required) Name of the package to be
9
installed
10
11
-s, --skiponmissingartifact Skip package installation if the
12
build artifact is missing. Enable
13
this if artifacts are only being
14
created for modified packages
15
16
-u, --targetorg=targetorg (required) Alias/User Name of the
17
target environment
18
19
--artifactdir=artifactdir [default: artifacts] The directory
20
where the artifact is located
21
22
--skipifalreadyinstalled Skip the package installation if the
23
package is already installed in the
24
org
25
26
--subdirectory=subdirectory Install specific subdirectory in the
27
package. Useful when package
28
consists of multiple discrete
29
sub-packages
30
31
EXAMPLE
32
$ sfdx sfpowerscripts:package:data:install -n mypackage -u <org>
Copied!

sfdx sfpowerscripts:package:source:create

This task simulates a packaging experience similar to unlocked packaging - creating an artifact that consists of the metadata wrapped into an artifact. The artifact can then be consumed by release tasks, to deploy the package
1
This task simulates a packaging experience similar to unlocked packaging - creating an artifact that consists of the metadata (e.g. commit Id), source code & an optional destructive manifest. The artifact can then be consumed by release pipelines, to deploy the package
2
3
USAGE
4
$ sfdx sfpowerscripts:package:source:create -n <string> -v <string> [--artifactdir <directory>] [--diffcheck]
5
[--branch <string>] [--gittag] [-r <string>] [--refname <string>]
6
7
OPTIONS
8
-n, --package=package
9
(required) The name of the package
10
11
-r, --repourl=repourl
12
Custom source repository URL to use in artifact metadata, overrides origin URL defined in git config
13
14
-v, --versionnumber=versionnumber
15
(required) The format is major.minor.patch.buildnumber . This will override the build number mentioned in the
16
sfdx-project.json, Try considering the use of Increment Version Number task before this task
17
18
--artifactdir=artifactdir
19
[default: artifacts] The directory where the artifact is to be written
20
21
--branch=branch
22
The git branch that this build is triggered on, Useful for metrics and general identification purposes
23
24
--diffcheck
25
Only build when the package has changed
26
27
--gittag
28
Tag the current commit ID with an annotated tag containing the package name and version - does not push tag
29
30
--refname=refname
31
Reference name to be prefixed to output variables
32
33
EXAMPLES
34
$ sfdx sfpowerscripts:package:source:create -n mypackage -v <version>
35
$ sfdx sfpowerscripts:package:source:create -n <mypackage> -v <version> --diffcheck --gittag
36
Output variable:
37
sfpowerscripts_artifact_metadata_directory
38
<refname>_sfpowerscripts_artifact_metadata_directory
39
sfpowerscripts_artifact_directory
40
<refname>_sfpowerscripts_artifact_directory
41
sfpowerscripts_package_version_number
42
<refname>_sfpowerscripts_package_version_number
Copied!

sfdx sfpowerscripts:package:source:install

Installs a sfpowerscripts source package to the target org. skipifalreadyinstalled` only works provide the target org has sfpowerscripts-artifact' (04t1P000000ka9mQAA) installed. Please note you can deploy your own instance of 'sfpowerscripts-artifact' by building it from the repo and overriding using the environment variable SFPOWERSCRIPTS_ARTIFACT_UNLOCKED_PACKAGE
1
Installs a sfpowerscripts source package to the target org
2
3
USAGE
4
$ sfdx sfpowerscripts:package:source:install -n <string> -u <string> [--artifactdir <directory>]
5
[--skipifalreadyinstalled] [-s] [--subdirectory <directory>] [-o] [-t] [--waittime <string>] [--refname <string>]
6
7
OPTIONS
8
-n, --package=package (required) Name of the package to be
9
installed
10
11
-o, --optimizedeployment Optimize deployment by triggering
12
test classes that are in the
13
package, rather than using the whole
14
tests in the org
15
16
-s, --skiponmissingartifact Skip package installation if the
17
build artifact is missing. Enable
18
this if artifacts are only being
19
created for modified packages
20
21
-t, --skiptesting Skips running test when deploying to
22
a sandbox
23
24
-u, --targetorg=targetorg (required) Alias/User Name of the
25
target environment
26
27
--artifactdir=artifactdir [default: artifacts] The directory
28
where the artifact is located
29
30
31
--refname=refname Reference name to be prefixed to
32
output variables
33
34
--skipifalreadyinstalled Skip the package installation if the
35
package is already installed in the
36
org
37
38
--subdirectory=subdirectory Install specific subdirectory in the
39
package. Useful when package
40
consists of multiple discrete
41
sub-packages
42
43
--waittime=waittime [default: 120] wait time for command
44
to finish in minutes
45
46
EXAMPLE
47
$ sfdx sfpowerscripts:package:source:install -n mypackage -u <org>
Copied!

sfdx sfpowerscripts:package:unlocked:create

Creates a new package version, and generates an artifact that consists of the metadata (e.g. version Id). The artifact can then be consumed by release pipelines, to install the unlocked package. Utilize this task in a package build for DX Unlocked Package
1
Creates a new package version, and generates an artifact that consists of the metadata (e.g. version Id). The artifact can then be consumed by release pipelines, to install the unlocked package. Utilize this task in a package build for DX Unlocked Package
2
3
USAGE
4
$ sfdx sfpowerscripts:package:unlocked:create -n <string> [-b] [-k <string> | -x] [--diffcheck] [--gittag] [-r
5
<string>] [--versionnumber <string>] [-f <filepath>] [--artifactdir <directory>] [--enablecoverage] [-s] [--branch
6
<string>] [--tag <string>] [--waittime <string>] [--refname <string>] [-v <string>] [--apiversion <string>]
7
8
OPTIONS
9
-b, --buildartifactenabled
10
[DEPRECATED - always generate artifact] Create a build artifact, so that this pipeline can be consumed by a release
11
pipeline
12
13
-f, --configfilepath=configfilepath
14
[default: config/project-scratch-def.json] Path in the current project directory containing config file for the
15
packaging org
16
17
-k, --installationkey=installationkey
18
Installation key for this package
19
20
-n, --package=package
21
(required) ID (starts with 0Ho) or alias of the package to create a version of
22
23
-r, --repourl=repourl
24
Custom source repository URL to use in artifact metadata, overrides origin URL defined in git config
25
26
-s, --isvalidationtobeskipped
27
Skips validation of dependencies, package ancestors, and metadata during package version creation. Skipping
28
validation reduces the time it takes to create a new package version, but package versions created without
29
validation can’t be promoted.
30
31
-v, --targetdevhubusername=targetdevhubusername
32
username or alias for the dev hub org; overrides default dev hub org
33
34
-x, --installationkeybypass
35
Bypass the requirement for having an installation key for this version of the package
36
37
--apiversion=apiversion
38
override the api version used for api requests made by this command
39
40
--artifactdir=artifactdir
41
[default: artifacts] The directory where the artifact is to be written
42
43
--branch=branch
44
The git branch that this build is triggered on, Useful for metrics and general identification purposes
45
46
--diffcheck
47
Only build when the package has changed
48
49
--enablecoverage
50
Please note this command takes a longer time to compute, activating this on every packaging build might not
51
necessary
52
53
--gittag
54
Tag the current commit ID with an annotated tag containing the package name and version - does not push tag
55
56
57
--refname=refname
58
Reference name to be prefixed to output variables
59
60
--tag=tag
61
the package version's tag
62
63
--versionnumber=versionnumber
64
The format is major.minor.patch.buildnumber . This will override the build number mentioned in the
65
sfdx-project.json, Try considering the use of Increment Version Number task before this task
66
67
--waittime=waittime
68
[default: 120] wait time for command to finish in minutes
69
70
EXAMPLES
71
$ sfdx sfpowerscripts:package:unlocked:create -n <packagealias> -b -x -v <devhubalias> --refname <name>
72
$ sfdx sfpowerscripts:package:unlocked:create -n <packagealias> -b -x -v <devhubalias> --diffcheck --gittag
73
74
Output variable:
75
sfpowerscripts_package_version_id
76
<refname>_sfpowerscripts_package_version_id
77
sfpowerscripts_artifact_metadata_directory
78
<refname>_sfpowerscripts_artifact_metadata_directory
79
sfpowerscripts_artifact_directory
80
<refname>_sfpowerscripts_artifact_directory
81
sfpowerscripts_package_version_number
82
<refname>_sfpowerscripts_package_version_number
Copied!

sfdx sfpowerscripts:package:unlocked:install

Installs an unlocked package using sfpowerscripts metadata
1
Installs an unlocked package using sfpowerscripts metadata
2
3
USAGE
4
$ sfdx sfpowerscripts:package:unlocked:install [-n <string>] [-u <string>] [-v <string> | -i] [-k <string>] [-a]
5
[--artifactdir <directory>] [--securitytype <string>] [-f] [-s undefined] [--upgradetype <string>] [--waittime
6
<string>] [--publishwaittime <string>] [--json] [--loglevel
7
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
8
9
OPTIONS
10
-a, --apexcompileonlypackage Each package installation triggers a
11
compilation of apex, flag to trigger
12
compilation of package only
13
14
-f, --skipifalreadyinstalled Skip the package installation if the
15
package is already installed in the
16
org
17
18
-i, --packageinstalledfrom automatically retrieve the version
19
ID of the package to be installed,
20
from the build artifact
21
22
-k, --installationkey=installationkey installation key for key-protected
23
package
24
25
-n, --package=package Name of the package to be installed
26
27
-s, --skiponmissingartifact Skip package installation if the
28
build artifact is missing. Enable
29
this if artifacts are only being
30
created for modified packages
31
32
-u, --targetorg=targetorg Alias/User Name of the target
33
environment
34
35
-v, --packageversionid=packageversionid manually input package version Id of
36
the package to be installed
37
38
--artifactdir=artifactdir [default: artifacts] The directory
39
where the artifact is located
40
41
--publishwaittime=publishwaittime [default: 10] number of minutes to
42
wait for subscriber package version
43
ID to become available in the target
44
org
45
46
--securitytype=AllUsers|AdminsOnly [default: AllUsers] Select the
47
security access for the package
48
installation
49
50
--upgradetype=DeprecateOnly|Mixed|Delete [default: Mixed] the upgrade type
51
for the package installation
52
53
--waittime=waittime [default: 120] wait time for command
54
to finish in minutes
55
56
EXAMPLE
57
$ sfdx sfpowerscripts:package:unlocked:install -n packagename -u sandboxalias -i
Copied!

sfdx sfpowerscripts:package:version:increment

Increment the selected version counter by one and optionally commit changes to sfdx-project.json. This command does not push changes to the source repository
1
Increment the selected version counter by one and optionally commit changes to sfdx-project.json. This command does not push changes to the source repository
2
3
USAGE
4
$ sfdx sfpowerscripts:package:version:increment [--segment <string>] [-a -r <string>] [-n <string>] [-d <string>]
5
[-c] [--refname <string>]
6
7
OPTIONS
8
-a, --appendbuildnumber
9
Set the build segment of the version number to the build number rather than incremenenting
10
11
-c, --commitchanges
12
Mark this if you want to commit the modified sfdx-project json, Please note this will not push to the repo only
13
commits in the local checked out repo, You would need to have a push to the repo at the end of the packaging task if
14
everything is successfull
15
16
-d, --projectdir=projectdir
17
The directory should contain a sfdx-project.json for this command to succeed
18
19
-n, --package=package
20
The name of the package of which the version need to be incremented,If not specified the default package is utilized
21
22
-r, --runnumber=runnumber
23
The build number of the CI pipeline, usually available through an environment variable
24
25
--refname=refname
26
Reference name to be prefixed to output variables
27
28
--segment=Major|Minor|Patch|BuildNumber
29
[default: BuildNumber] Select the segment of the version
30
31
EXAMPLES
32
$ sfdx sfpowerscripts:package:version:increment --segment BuildNumber -n packagename -c
33
34
Output variable:
35
sfpowerscripts_incremented_project_version
36
<refname>_sfpowerscripts_incremented_project_version
Copied!

sfdx sfpowerscripts:pool:delete

Deletes the pooled scratch orgs from the Scratch Org Pool
1
Deletes the pooled scratch orgs from the Scratch Org Pool
2
3
USAGE
4
$ sfdx sfpowerscripts:pool:delete -t <string> [-m] [-i | -a] [-v <string>] [--apiversion <string>] [--json]
5
[--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
6
7
OPTIONS
8
-a, --allscratchorgs Deletes all used and unused Scratch
9
orgs from pool by the tag
10
11
-i, --inprogressonly Deletes all In Progress Scratch orgs
12
from pool by the tag
13
14
-m, --mypool Filter only Scratch orgs created by
15
current user in the pool
16
17
-t, --tag=tag (required) tag used to identify the
18
scratch org pool
19
20
-v, --targetdevhubusername=targetdevhubusername username or alias for the dev hub
21
org; overrides default dev hub org
22
23
--apiversion=apiversion override the api version used for
24
api requests made by this command
25
26
EXAMPLES
27
$ sfdx sfpowerscripts:pool:delete -t core
28
$ sfdx sfpowerscripts:pool:delete -t core -v devhub
Copied!

sfdx sfpowerscripts:pool:fetch

Gets an active/unused scratch org from the scratch org pool
1
Gets an active/unused scratch org from the scratch org pool
2
3
USAGE
4
$ sfdx sfpowerscripts:pool:fetch -t <string> [-v <string>] [--apiversion <string>]
5
OPTIONS
6
-t, --tag=tag (required) (required) tag used to
7
identify the scratch org pool
8
9
-v, --targetdevhubusername=targetdevhubusername username or alias for the dev hub
10
org; overrides default dev hub org
11
12
--apiversion=apiversion override the api version used for
13
api requests made by this command
14
15
16
17
EXAMPLES
18
$ sfdx sfpowerkit:pool:fetch -t core
19
$ sfdx sfpowerkit:pool:fetch -t core -v devhub
20
$ sfdx sfpowerkit:pool:fetch -t core -v devhub -m
21
$ sfdx sfpowerkit:pool:fetch -t core -v devhub -s [email protected]
Copied!

sfdx sfpowerscripts:pool:list

Retrieves a list of active scratch org and details from any pool. If this command is run with -m|--mypool, the command will retrieve the passwords for the pool created by the user who is executing the command.
1
Retrieves a list of active scratch org and details from any pool. If this command is run with -m|--mypool, the command will retrieve the passwords for the pool created by the user who is executing the command.
2
3
USAGE
4
$ sfdx sfpowerscripts:pool:list [-t <string>] [-m] [-a] [-v <string>] [--apiversion <string>]
5
OPTIONS
6
-a, --allscratchorgs Gets all used and unused Scratch
7
orgs from pool
8
9
-m, --mypool Filter the tag for any additions
10
created by the executor of the
11
command
12
13
-t, --tag=tag tag used to identify the scratch org
14
pool
15
16
-v, --targetdevhubusername=targetdevhubusername username or alias for the dev hub
17
org; overrides default dev hub org
18
19
--apiversion=apiversion override the api version used for
20
api requests made by this command
21
22
EXAMPLES
23
$ sfdx sfpowerscripts:pool:list -t core
24
$ sfdx sfpowerscripts:pool:list -t core -v devhub
25
$ sfdx sfpowerscripts:pool:list -t core -v devhub -m
26
$ sfdx sfpowerscripts:pool:list -t core -v devhub -m -a
Copied!

sfdx sfpowerscripts:artifacts:fetch

1
Fetch artifacts from an artifact registry that is either NPM compatible or supports universal artifacts
2
3
USAGE
4
$ sfdx sfpowerscripts:artifacts:fetch -d <directory> [-p <filepath>] [--scope <string> [--npm | -f <filepath>]] [--npmrcpath <filepath> undefined] [--json]
5
[--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
6
7
OPTIONS
8
-d, --artifactdir=artifactdir (required) [default: artifacts] Directory
9
to save downloaded artifacts
10
11
-f, --scriptpath=scriptpath (Optional: no-NPM)Path to script that
12
authenticates and downloads artifacts
13
from the registry
14
15
-p, --releasedefinition=releasedefinition Path to YAML file containing map of
16
packages and package versions to
17
download
18
19
--json format output as json
20
21
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this
22
command invocation
23
24
--npm Download artifacts from a pre-authenticated
25
private npm registry
26
27
--npmrcpath=npmrcpath Path to .npmrc file used for authentication
28
to registry. If left blank, defaults to
29
home directory
30
31
--scope=scope (required for NPM) User or Organisation
32
scope of the NPM package
33
34
EXAMPLES
35
$ sfdx sfpowerscripts:artifacts:fetch -p myreleasedefinition.yaml -f myscript.sh
36
$ sfdx sfpowerscripts:artifacts:fetch -p myreleasedefinition.yaml --npm --scope myscope --npmrcpath path/to/.npmrc
Copied!
Last modified 1mo ago