npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@salesforce/plugin-command-reference

v3.1.26

Published

Generate the Salesforce CLI command reference guide

Downloads

106,619

Readme

@salesforce/plugin-command-reference

Generate the Salesforce CLI command reference guide.

Version Codecov Downloads/week License

First install the plugin.

$ sf plugins install @salesforce/plugin-command-reference

Ensure any plugins are installed that you with to generate documentation for.

$ sf plugins:install salesforce@plugin-auth

Now we can generate the documentation for all core plug-ins.

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

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/dev 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:

sf plugins link .

Testing

How do you know if the output is correct, given your change?

# Install the current version of the plugin (use `@sf` until the plugin is publishing the sf version as main)
sf plugins install @salesforce/plugin-command-reference@sf
# installs all JIT plugins (if you intend to produce ditamaps for them)
sf jit install
# run 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

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!

Commands

sf commandreference generate

generate the command reference guide located

USAGE
  $ sf commandreference generate [--json] [--flags-dir <value>] [-d <value>] [-p <value>... | -a] [-s <value>] [--hidden]
    [--error-on-warnings] [-c <value>]

FLAGS
  -a, --all                     include all relevant plugins in the generation
  -c, --config-path=<value>     A path to the directory containing a plugin or cli
  -d, --output-dir=<value>      [default: ./tmp/root] output directory to put generated files
  -p, --plugins=<value>...      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=<value>  [default: unified] unique suffix to append to generated ditamap
      --error-on-warnings       fail the command if there are any warnings
      --hidden                  show hidden commands

GLOBAL FLAGS
  --flags-dir=<value>  Import flag values from a directory.
  --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

sf jit install

Install all JIT plugins.

USAGE
  $ sf jit install [--json] [--flags-dir <value>] [-d]

FLAGS
  -d, --dry-run  List the plugins that would be installed.

GLOBAL FLAGS
  --flags-dir=<value>  Import flag values from a directory.
  --json               Format output as json.

EXAMPLES
  $ sf jit install

See code: src/commands/jit/install.ts