JSPM

@oclif/plugin-plugins

1.1.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 676766
  • Score
    100M100P100Q194014F
  • License MIT

plugins plugin for oclif

Package Exports

  • @oclif/plugin-plugins
  • @oclif/plugin-plugins/lib/plugins

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@oclif/plugin-plugins) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@oclif/plugin-plugins

plugins plugin for oclif

Version CircleCI Appveyor CI Codecov Greenkeeper Known Vulnerabilities Downloads/week License

What is this?

This plugin is used to allow users to install plugins into your oclif CLI at runtime. For example, in the Heroku CLI this is used to allow people to install plugins such as the Heroku Kafka plugin:

$ heroku plugins:install heroku-kafka
$ heroku kafka

This is useful to allow users to create their own plugins to work in your CLI or to allow you to build functionality that users can optionally install.

One particular way this is useful is for building functionality you aren't ready to include in a public repository. Build your plugin separately as a plugin, then include it as a core plugin later into your CLI.

Usage

First add the plugin to your project with yarn add @oclif/plugin-plugins, then add it to the package.json of the oclif CLI:

{
  "name": "mycli",
  "version": "0.0.0",
  // ...
  "oclif": {
    "plugins": ["@oclif/plugin-help", "@oclif/plugin-plugins"]
  }
}

Now the user can run any of the commands below to manage plugins at runtime.

Friendly names

To make it simpler for users to install plugins, we have "friendly name" functionality. With this, you can run mycli plugins:install myplugin and it will first check if @mynpmorg/plugin-myplugin exists on npm before trying to install myplugin. This is useful if you want to use a generic name that's already taken in npm.

To set this up, simply set the oclif.scope to the name of your npm org. In the example above, this would be mynpmorg.

Commands

mycli plugins

list installed plugins

USAGE
  $ mycli plugins

OPTIONS
  --core  show core plugins

EXAMPLE
  $ mycli plugins

See code: src/commands/plugins.ts

mycli plugins:install PLUGIN...

installs a plugin into the CLI

USAGE
  $ mycli plugins:install PLUGIN...

ARGUMENTS
  PLUGIN  plugin to install

EXAMPLE
  $ mycli plugins:install heroku-production-status

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

mycli plugins:install PLUGIN...

links a plugin into the CLI for development

USAGE
  $ mycli plugins:install PLUGIN...

ARGUMENTS
  PATH  [default: .] path to plugin

EXAMPLE
  $ mycli plugins:install heroku-production-status

See code: src/commands/plugins/link.ts

mycli plugins:uninstall PLUGIN...

removes a plugin from the CLI

USAGE
  $ mycli plugins:uninstall PLUGIN...

ARGUMENTS
  PLUGIN  plugin to uninstall

ALIASES
  $ mycli plugins:unlink

See code: src/commands/plugins/uninstall.ts

mycli plugins:update

update installed plugins

USAGE
  $ mycli plugins:update

See code: src/commands/plugins/update.ts