heat-sfdx-cli

heat-sfdx-cli

This is a Salesforce CLI plug-In, which uses features of the heat-sfdx series.

Version Appveyor CI Codecov Greenkeeper Known Vulnerabilities Downloads/week License

category package
Metadata API heat-sfdx-metadata
SOAP API heat-sfdx-soap
Tooling API heat-sfdx-tooling
Common heat-sfdx-common
sfdx plugins:install heat-sfdx-cli
# git clone https://github.com/takahitomiyamoto/heat-sfdx-cli.git
# cd heat-sfdx-cli/heat
# sfdx plugins:link
$ npm install -g heat-sfdx-cli
$ sfdx COMMAND
running command...
$ sfdx (-v|--version|version)
heat-sfdx-cli/0.5.0 darwin-x64 node-v20.10.0
$ sfdx --help [COMMAND]
USAGE
  $ sfdx COMMAND
...

convert a file

USAGE
$ sfdx heat:convert:json2csv [-e <string>] [-i <string>] [-o <string>] [--header] [--columns <string>] [-c <string>]
[-k <string>] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS
-c, --charcode=charcode [default: utf8] character code

-e, --environment=environment [default: config/environment.json]
environment file

-i, --inputfile=inputfile input file

-k, --keys=keys [default:
Profile.applicationVisibilities]
JSON keys

-o, --outputfile=outputfile output file

--columns=columns comma separated header columns (ex.
apexClass,enabled)

--header set this flag if the csv has a
header

--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

--verbose emit additional command output to
stdout

EXAMPLE

$ sfdx heat:convert:json2csv --header --columns apexClass,enabled -k Profile.classAccesses -i .heat-logs/input.json -o
.heat-logs/output.csv

See code: src/commands/heat/convert/json2csv.ts

convert a file

USAGE
$ sfdx heat:convert:xml2json [-e <string>] [-i <string>] [-o <string>] [--verbose] [--json] [--loglevel
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS
-e, --environment=environment [default: config/environment.json]
environment file

-i, --inputfile=inputfile input file

-o, --outputfile=outputfile output file

--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

--verbose emit additional command output to
stdout

EXAMPLE

$ sfdx heat:convert:xml2json -i .heat-logs/input.xml -o .heat-logs/output.json

See code: src/commands/heat/convert/xml2json.ts

build manifest file with all metadata types in your org

USAGE
$ sfdx heat:manifest:build [-e <string>] [-x <string>] [-w <string>] [--beta] [--deleted] [--deprecated]
[--deprecatededitable] [--installed] [--installededitable] [--released] [--unmanaged] [--standard] [--recommended]
[--all] [--child] [-u <string>] [--apiversion <string>] [--verbose] [--json] [--loglevel
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS
-e, --environment=environment [default: config/environment.json]
environment file

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

-w, --wsdl=wsdl [default: config/metadata.wsdl]
Metadata API WSDL file

-x, --manifest=manifest [default: manifest/package.xml]
manifest file

--all set this flag if you would like to
contain any all components

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

--beta set this flag if you would like to
contain any beta components

--child set this flag if you would like to
contain any child sub-components

--deleted set this flag if you would like to
contain any deleted components

--deprecated set this flag if you would like to
contain any deprecated components

--deprecatededitable set this flag if you would like to
contain any deprecatedEditable
components

--installed set this flag if you would like to
contain any installed components

--installededitable set this flag if you would like to
contain any installedEditable
components

--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

--recommended set this flag if you would like to
contain any standard, unmanaged, and
child sub-components

--released set this flag if you would like to
contain any released components

--standard set this flag if you would like to
contain any standard components

--unmanaged set this flag if you would like to
contain any unmanaged components

--verbose emit additional command output to
stdout

EXAMPLES

[standard and unmanaged components]
$ sfdx heat:manifest:build --apiversion 52.0 -u myOrg@example.com --standard --unmanaged

[standard, unmanaged and unlocked components]
$ sfdx heat:manifest:build --apiversion 52.0 -u myOrg@example.com --standard --unmanaged --installededitable

[standard, unmanaged and child sub-components]
$ sfdx heat:manifest:build --apiversion 52.0 -u myOrg@example.com --recommended

[standard, unmanaged, unlocked, managed and child sub-components]
$ sfdx heat:manifest:build --apiversion 52.0 -u myOrg@example.com --all

See code: src/commands/heat/manifest/build.ts

print a greeting and your org IDs

USAGE
$ sfdx heat:org [-n <string>] [-f] [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS
-f, --force example boolean flag
-n, --name=name name to print

-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

EXAMPLES
$ sfdx hello:org --targetusername myOrg@example.com --targetdevhubusername devhub@org.com
Hello world! This is org: MyOrg and I will be around until Tue Mar 20 2018!
My hub org id is: 00Dxx000000001234

$ sfdx hello:org --name myname --targetusername myOrg@example.com
Hello myname! This is org: MyOrg and I will be around until Tue Mar 20 2018!

See code: src/commands/heat/org.ts

REST API - execute GET

USAGE
$ sfdx heat:rest:get:execute [-e <string>] [-d <string>] [-f <string>] [-r <string>] [-u <string>] [--apiversion
<string>] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS
-d, --outputdir=outputdir [default: .logs] output directory

-e, --environment=environment [default: config/environment.json]
environment file

-f, --outputfile=outputfile [default: result.json] output file

-r, --url=url [default: /tooling/sobjects] target
URL

-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

--verbose emit additional command output to
stdout

EXAMPLE

$ sfdx heat:rest:get:execute --apiversion 54.0 -u myOrg@example.com -d .logs -f result.json -r
/tooling/sobjects/Profile/describe

See code: src/commands/heat/rest/get/execute.ts

build any specification documents of Apex classes or triggers in markdown format

USAGE
$ sfdx heat:spec:apex:build [-e <string>] [-o <string>] [-u <string>] [--apiversion <string>] [--verbose] [--json]
[--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS
-e, --environment=environment [default: config/environment.json]
environment file

-o, --output=output [default: docs] output directory

-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

--verbose emit additional command output to
stdout

EXAMPLE

$ sfdx heat:spec:apex:build --apiversion 57.0 -u myOrg@example.com -o docs

See code: src/commands/heat/spec/apex/build.ts

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 hello:org command:

  1. Start the inspector

If you linked your plugin to the sfdx cli, call your command with the dev-suspend switch:

$ sfdx hello:org -u myOrg@example.com --dev-suspend

Alternatively, to call your command using the bin/run script, set the NODE_OPTIONS environment variable to --inspect-brk when starting the debugger:

$ NODE_OPTIONS=--inspect-brk bin/run hello:org -u myOrg@example.com
  1. Set some breakpoints in your command code
  2. Click on the Debug icon in the Activity Bar on the side of VS Code to open up the Debug view.
  3. In the upper left hand corner of VS Code, verify that the "Attach to Remote" launch configuration has been chosen.
  4. Hit the green play button to the left of the "Attach to Remote" launch configuration window. The debugger should now be suspended on the first line of the program.
  5. Hit the green 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!