TransWikia.com

SFDX: How can I make my plugin available to install via sfdx plugins:install and a git repo reference?

Salesforce Asked on October 4, 2021

We have written a plugin for use by our PS and QA teams for complex and large "data plan" loading and want to make it as easy to install for them as possible. We don’t want to make it generally available at this point so are looking for a simple way to install without having to manually install things like yarn etc.

There is no official documentation, at least on the Salesforce site, for the plugins command. Running sfdx plugins:install --help says:

installs a plugin into the CLI

USAGE
  $ sfdx plugins:install PLUGIN...

...

EXAMPLES
  $ sfdx plugins:install myplugin
  $ sfdx plugins:install https://github.com/someuser/someplugin
  $ sfdx plugins:install someuser/someplugin

The second example option looks promising, but when we try this (actually using a Bitbucket repo URL), the installation doesn’t work. There are no errors and the install successfully finishes, but the commands are simply not available.

Any ideas as to why?

One Answer

We found that this could be resolved by building the plugin and committing the generated lib folder structure and the oclif.manifest.json file to git (which is somewhat ugly, IMHO). Having done this we were able to use (with Bitbucket):

sfdx plugins:install https://bitbucket.org/organization/repo.git

This installed the plugin, though warned about no digital signing and a small issue in the salesforce core code:

This plugin is not digitally signed and its authenticity cannot be verified. Continue installation y/n?: y
warning https://bitbucket.org/organization/repo.git > @salesforce/core > jsforce > [email protected]: request has been deprecated
, see https://github.com/request/request/issues/3142
Installing plugin https://bitbucket.org/organization/repo.git... installed v1.0.0

The commands are then available and work as intended.

Correct answer by Phil W on October 4, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP