Generate the Salesforce CLI command reference guide
npm install @salesforce/plugin-command-referenceGenerate the Salesforce CLI command reference guide.




First install the plugin.
``bash`
$ sf plugins install @salesforce/plugin-command-reference
Ensure any plugins are installed that you with to generate documentation for.
`bash`
$ sf plugins:install salesforce@plugin-auth
Now we can generate the documentation for all core plug-ins.
`bash`notice we can use the oclif shorthand for the plugin name. @salesforce/plugin-foo => foo
$ sf commandreference --plugins auth
Note: Warnings will occur for missing properties in plugins. Those have to be fixed in the plugin itself.
To add this to your plugin to catch warning at development time, add it as a dev plugin in the project.json.
`json`
"oclif": {
"devPlugins": [
"@salesforce/plugin-command-reference"
]
}
Then you can run this in your plugin's CI.
`sh-session`
./bin/dev commandreference --plugins
If you need to make changes to this repository, the easiest thing to do is to link it to your Salesforce CLI. After you cloned this plugin, run the following from this plugin directory:
`sh-session`
sf plugins link .
How do you know if the output is correct, given your change?
`bash@sfInstall the current version of the plugin (use
until the plugin is publishing the sf version as main)`
sf plugins install @salesforce/plugin-command-reference@sfinstalls all JIT plugins (if you intend to produce ditamaps for them)
sf jit installrun using a relatively current version of plugins, saving the output as a "gold file"
sf commandreference generate --plugins login env deploy-retrieve settings functions info sobject limits schema custom-metadata data community signups user org packaging templates apex auth dev @salesforce/sfdx-plugin-lwc-test -d outputGold
While working on your branch
`bash`
sf plugins link .run the same command from above, but with your new version of the plugin, writing to a new output file
sf commandreference generate --plugins login env deploy-retrieve settings functions info sobject limits schema custom-metadata data community signups user org packaging templates apex auth dev @salesforce/sfdx-plugin-lwc-test -d outputNew
Now diff the output. Changes should be intentional!
- sf commandreference generate
- sf jit install
generate the command reference guide located
`
USAGE
$ sf commandreference generate [--json] [--flags-dir
[--error-on-warnings] [-c
FLAGS
-a, --all include all relevant plugins in the generation
-c, --config-path=
-d, --output-dir=
-p, --plugins=
plugin in the current working directory
-s, --ditamap-suffix=
--error-on-warnings fail the command if there are any warnings
--hidden show hidden commands
GLOBAL FLAGS
--flags-dir=
--json Format output as json.
DESCRIPTION
generate the command reference guide located
generate the command reference guide located
EXAMPLES
Generate the command reference guide
$ sf commandreference generate
Generate the command reference for a set of plugins
$ sf commandreference generate --plugins pluginA,pluginB
Generate the command reference for all plugins
$ sf commandreference generate --all --output-dir ./docs
Generate the command reference for all plugins in a directory
$ sf commandreference generate --all --config-path /path/to/plugin --output-dir ./docs
`
_See code: src/commands/commandreference/generate.ts_
Install all JIT plugins.
`
USAGE
$ sf jit install [--json] [--flags-dir
FLAGS
-d, --dry-run List the plugins that would be installed.
GLOBAL FLAGS
--flags-dir=
--json Format output as json.
EXAMPLES
$ sf jit install
``
_See code: src/commands/jit/install.ts_