sfdx-cli-plugin
Overview
As Salesforce engineers developing applications with DX, we created the SFDX CLI Plugin to make our day-to-day tasks a little easier. Some of the functionality we've built includes:
- Executing multiple apex files
- Running Talend jobs to load data into an org or sandbox
- Installing multiple unlocked packages
- Deploying with predestruct and postdestruct operations
- Executing queries via the tooling API
Our plugin was initially created using the plugin-generator, itself a plugin that comes bundled with the CLI installation. The plugin generator is based on Heroku's open-source CLI framework, OCLIF.
If you want to create your own plugin from scratch, you can get started here. However, we'd be delighted if you decided to collaborate with us to make this plugin even better!
Intalling Dependencies
Use the following command to install all dependencies upon initial checkout.
yarn install
Running Tests
In this project pure unit tests are separated from integration tests. Tests can be run using one of the commands below:
yarn test - unit tests only
yarn integ - integration tests only
yarn alltests - unit and integration tests
Please see our other documentation:
Command Summary
$ npm install -g sfdx-cli-plugin
$ sfdx COMMAND
running command...
$ sfdx (-v|--version|version)
sfdx-cli-plugin/0.0.6 darwin-x64 node-v11.13.0
$ sfdx --help [COMMAND]
USAGE
$ sfdx COMMAND
...
sfdx adp:apex:execute -d [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
Iterates through and executes apex files in the specified directory
USAGE
$ sfdx adp:apex:execute -d [-u <string>] [--apiversion <string>] [--json] [--loglevel
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
OPTIONS
-d, --directory (required) path to directory
containing Apex code files
-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
EXAMPLE
sfdx adp:apex:execute -d deploy/scripts -u myorg
// Executes the files in the scripts directory for the target alias, myorg
See code: lib/commands/adp/apex/execute.js
sfdx adp:auth:soap:login [-u <string>] [-p <string>] [-r <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
Authenticates a user via the SOAP API.
USAGE
$ sfdx adp:auth:soap:login [-u <string>] [-p <string>] [-r <string>] [--json] [--loglevel
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
OPTIONS
-p, --password=password Salesforce login password
-r, --loginurl=loginurl Salesforce login URL
-u, --username=username Salesforce username
--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
EXAMPLE
sfdx adp:auth:soap:login -u myusername -p mypassword
See code: lib/commands/adp/auth/soap/login.js
sfdx adp:config:show [-g] [-l] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
Displays global and local configuration settings
USAGE
$ sfdx adp:config:show [-g] [-l] [--json] [--loglevel
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
OPTIONS
-g, --globalonly show global config only
-l, --localonly show local config only
--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
EXAMPLES
sfdx adp:config:show
sfdx adp:config:show -g
sfdx adp:config:show -l
See code: lib/commands/adp/config/show.js
sfdx adp:data:run [-c <string>] [-p <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
Runs a job to retrieve from or push data to an org.