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

First install the plugin.
$ sfdx plugins:install @salesforce/plugin-command-reference
Ensure any plugins are installed that you with to generate documentation for.
$ sfdx plugins:install salesforcedx@latest-rc
Now we can generate the documentation for the latest-rc
tag.
$ sfdx commandreference --plugins salesforcedx
Note: Warnings will occur for missing properties in plugins. Those have to be fixed in the plugin itself.
Add to your Salesforce CLI Plugin
To add this to your plugin to catch warning at development time, add it as a dev plugin in the project.json.
"oclif": {
"devPlugins": [
"@salesforce/plugin-command-reference"
]
}
Then you can run this in your plugin's CI.
./bin/run commandreference --plugins <name-of-your-plugin> --error-on-warnings
Local Development
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:
sfdx plugins:link .
Now, you can install any plugins you want and run the command reference generation on them.
sfdx plugins:install salesforcedx
sfdx plugins:install config
sfdx plugins:install alias
sfdx plugins:install auth
sfdx commandreference --plugins salesforcedx,alias,config,auth
Commands
sf commandreference:generate
generate the command reference guide located
generate the command reference guide located
USAGE
$ sf commandreference:generate
OPTIONS
-d, --outputdir=outputdir [default: ./tmp/root] output directory to put generated files
-p, --plugins=plugins comma separated list of plugin names to be part of the generation. Defaults to
the oclif plugin in the current working directory
-s, --ditamap-suffix=ditamap-suffix [default: unified] unique suffix to append to generated ditamap
--erroronwarnings fail the command if there are any warnings
--hidden show hidden commands
--json Format output as json.
See code: src/commands/commandreference/generate.ts