prodlysfcli
v1.2.3
Published
A plugin which provides Prodly application commands on top of the Salesforce CLI.
Downloads
95
Readme
prodlysfcli
Install
sf plugins install [email protected]
Issues
Please report any issues at https://github.com/prodly/prodly-sf-cli/issues
Build
To build the plugin locally, make sure to have yarn installed and run the following commands:
# Clone the repository
git clone https://github.com/prodly/prodly-sf-cli.git
# Install the dependencies and compile
yarn && yarn build
# Run using local run file.
./bin/run.js prodly:manage -l -p
There should be no differences when running via the Salesforce CLI or using the local run file. However, it can be useful to link the plugin to do some additional testing or run your commands from anywhere on your machine.
# Link your plugin to the sf cli
sf plugins link .
# To verify
sf plugins
Commands
sf prodly:checkin
USAGE
$ sf prodly:checkin -v <value> -o <value> [--json] [-b <value>] [-c <value>] [-t <value>] [-i <value>] [-z
<value>] [-p <value>]
FLAGS
-b, --branch=<value> branch name for deployment
-c, --comment=<value> (required) comment for the command versioning commit
-i, --instance=<value> managed instance ID on which to perform the action
-o, --target-org=<value> (required) Username or alias of the target org. Not
required if the `target-org` configuration variable is already set.
-p, --plan=<value> name or record ID of the deployment plan to deploy
-q, --filter=<value> query filter override for a data set deployment
-t, --dataset=<value> name or record ID of the data set to deploy
-v, --target-dev-hub=<value> (required) Username or alias of the Dev Hub org. Not
required if the `target-dev-hub` configuration variable is already set.
-z, --notes=<value> notes for the deployment
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
prodly:checkin command
Save data from a Salesforce environment to a VCS repository branch.
EXAMPLES
$ sf prodly:checkin --target-org [email protected] --target-dev-hub [email protected]
Save managed data to the branch associated with the managed instance identified by the target username.
The instance should be managed by the Prodly account associated with the provided DevHub control org.
$ sf prodly:checkin --target-org [email protected]
Save managed data to the branch associated with the managed instance identified by the target username.
The instance should be managed by the Prodly account associated with the default DevHub control org.
$ sf prodly:checkin -i f50616b6-57b1-4941-802f-ee0e2506f217
Save managed data to the branch associated with the managed instance identified by the provided ID.
The instance should be managed by the Prodly account associated with the default DevHub control org.
sf prodly:checkout
USAGE
$ sf prodly:checkout -v <value> -o <value> [--json] [-b <value>] [-t <value>] [-e] [-i <value>] [-n <value>] [-z
<value>] [-p <value>]
FLAGS
-b, --branch=<value> branch name for deployment
-e, --deactivate deactivate all events for the deployment
-i, --instance=<value> managed instance ID on which to perform the action
-n, --name=<value> name for the deployment
-o, --target-org=<value> (required) Username or alias of the target org. Not
required if the `target-org` configuration variable is already set.
-p, --plan=<value> name or record ID of the deployment plan to deploy
-q, --filter=<value> query filter override for a data set deployment
-t, --dataset=<value> name or record ID of the data set to deploy
-v, --target-dev-hub=<value> (required) Username or alias of the Dev Hub org. Not
required if the `target-dev-hub` configuration variable is already set.
-z, --notes=<value> notes for the deployment
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
prodly:checkout command
Deploy data from a VCS repository branch to a Salesforce environment.
EXAMPLES
$ sf prodly:checkout --target-org [email protected] --target-dev-hub [email protected]
Deploy managed data to the managed instance identified by the target org from the associated branch.
The instance should be managed by the Prodly account associated with the provided DevHub control org.
$ sf prodly:checkout --target-org [email protected]
Deploy managed data to the managed instance org identified by the target username from the associated branch.
The instance should be managed by the Prodly account associated with the default DevHub control org.
$ sf prodly:checkout -i f50616b6-57b1-4941-802f-ee0e2506f217
Deploy managed data to the managed instance org from the associated branch.
The instance should be managed by the Prodly account associated with the default DevHub control org.
sf prodly:deploy
USAGE
$ sf prodly:deploy -v <value> -o <value> [--json] [-t <value>] [-e] [-d <value>] [-q <value>] [-b <value>] [-n
<value>] [-z <value>] [-p <value>] [-l] [-s <value>]
FLAGS
-b, --label=<value> connection and managed instance name
-d, --destination=<value> destination managed instance ID
-e, --deactivate deactivate all events for the deployment
-l, --simulation perform a data simulation
-n, --name=<value> name for the deployment
-o, --target-org=<value> (required) Username or alias of the target org. Not
required if the `target-org` configuration variable is already set.
-p, --plan=<value> name or record ID of the deployment plan to deploy
-q, --filter=<value> query filter override for a data set deployment
-s, --source=<value> source managed instance ID
-t, --dataset=<value> name or record ID of the data set to deploy
-v, --target-dev-hub=<value> (required) Username or alias of the Dev Hub org. Not
required if the `target-dev-hub` configuration variable is already set.
-z, --notes=<value> notes for the deployment
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
prodly:deploy command
Deploy data from one Salesforce environment directly to another Salesforce environment.
EXAMPLES
$ sf prodly:deploy -n scratchorg --target-org FixesScratchOrg -v MainDevHub
Command output... deploying from the dev hub, the control org, to the scratch org, auto managed with provided name.
Command output...
$ sf prodly:deploy --target-org [email protected] --target-dev-hub [email protected]
Command output... deploying from the dev hub, the control org, to the scratch org. Long param names.
$ sf prodly:deploy --target-org [email protected] -v [email protected] -d "UAT Sandbox Connection"
Command output... deploying from the scratch org to the UAT sandbox, using the named connection record in the dev hub, control org.
$ sf prodly:deploy --target-org [email protected] --target-dev-hub [email protected] --source "UAT Sandbox Connection"
Command output... deploying to the scratch org from the UAT sandbox, using the named connection record in the dev hub, control org. Long param names.
sf prodly:manage
USAGE
$ sf prodly:manage -v <value> -o <value> [--json] [-c <value>] [-n <value>] [-i <value>] [-b <value>] [-l] [-m]
[-p] [-x] [-s]
FLAGS
-b, --label=<value> connection and managed instance name
-c, --comment=<value> comment for the command versioning commit
-i, --instance=<value> managed instance ID on which to perform the action
-l, --list list all managed instances
-m, --manage manage a new instance
-n, --connection=<value> connection to use for the managed instance
-o, --target-org=<value> (required) Username or alias of the target org. Not
required if the `target-org` configuration variable is already set.
-p, --print print the managed instances in a standard format in addition to returning structured
data
-s, --version version the new managed instance, branch created and data deployed to the org
-v, --target-dev-hub=<value> (required) Username or alias of the Dev Hub org. Not
required if the `target-dev-hub` configuration variable is already set.
-x, --unmanage unmanage the specified instance
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
prodly:manage command
Authorize (or unauthorize) a Salesforce environment (not already added to the Environments page in Release tab) for use by the plugin.
EXAMPLES
$ sf prodly:manage -l -p
List and print all of the managed instances for the Prodly account associated with the default DevHub control org.
$ sf prodly:manage -m --target-org [email protected] --target-dev-hub [email protected]
Manage the org associated with the target username under the Prodly account associated with the provided DevHub control org.
$ sf prodly:manage -m --target-org [email protected] -n dev7sbx
Manage and version the org associated with the target username under the Prodly account associated with the default DevHub control org.
sf prodly:jobs
USAGE
$ sf prodly:jobs -v <value> -j <value> [--json]
FLAGS
-j, --job=<value> (required) Prodly Job ID
-v, --target-dev-hub=<value> (required) Username or alias of the Dev Hub org.
Not required if the `target-dev-hub` configuration variable is already set.
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
prodly:jobs command
Check the job status.
EXAMPLES
$ sf prodly:jobs -j jobId -v MainDevHub
Print the job status for the provided job Id.
sf prodly:version
USAGE
$ sf prodly:version -v <value> -o <value> [--json] [-b <value>] [-s <value>] [-i <value>]
[-x]
FLAGS
-b, --new-branch=<value> if provided it creates a new branch based on the source branch that will be used for
version control
-i, --instance=<value> managed instance ID on which to perform the action
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
configuration variable is already set.
-s, --source-branch=<value> the version control branch or the base for the new branch (if provided)
-v, --target-dev-hub=<value> (required) Username or alias of the Dev Hub org. Not required if the `target-dev-hub`
configuration variable is already set.
-x, --unlink unlink the branch from the managed instance
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
prodly:version command
Adds version control to a managed environment.
EXAMPLES
$ sf prodly:version -s main
Add version control to the managed instance identified by the target org. Use the "main" branch.
The instance should be managed by the Prodly account associated with the default DevHub control org.
$ sf prodly:version -s main -b cli-branch -i f50616b6-57b1-4941-802f-ee0e2506f217
Add version control to the managed instance identified by the provided ID. Use the "main" branch as a base for a new branch called "cli-branch"
The instance should be managed by the Prodly account associated with the default DevHub control org.
Debugging your plugin
We recommend using the Visual Studio Code (VS Code) IDE for your plugin development. Included in the .vscode
directory of this plugin is a launch.json
config file, which allows you to attach a debugger to the node process when running your commands.
To debug the prodly:manage -l -p
command:
- Start the inspector
Call your command using the bin/run.js
script, set the NODE_OPTIONS
environment variable to --inspect-brk
when starting the debugger:
$ NODE_OPTIONS=--inspect-brk bin/run.js prodly:manage -l -p
- Set some breakpoints in your command code
- Click on the Run and Debug icon in the Activity Bar on the side of VS Code to open up the Debug view.
- In the upper left hand corner of VS Code, verify that the "Attach" launch configuration has been chosen.
- Hit the green play button to the left of the "Attach" launch configuration window. The debugger should now be suspended on the first line of the program.
- Hit the blue play button at the top middle of VS Code (this play button will be to the right of the play button that you clicked in step #5). Congrats, you are debugging!