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

@vtex/cli-plugin-plugins

v1.13.2

Published

plugins plugin for toolbelt

Downloads

4,646

Readme

@oclif/plugin-plugins

plugins plugin for oclif

Version CircleCI Appveyor CI Codecov 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 VTEX CLI this is used to allow people to install plugins such as the VTEX Autoupdate plugin:

$ vtex plugins install autoupdate
$ vtex autoupdate

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.

Aliases

Over time in the VTEX CLI we've changed plugin names, brought plugins into the core of the CLI, or sunset old plugins that no longer function. There is support in this plugin for dealing with these situations.

For renaming plugins, add an alias section to oclif.aliases in package.json:

"aliases": {
  "old-name-plugin": "new-name-plugin"
}

If a user had old-name-plugin installed, the next time the CLI is updated it will remove old-name-plugin and install new-name-plugin. If a user types mycli plugins:install old-name-plugin it will actually install new-name-plugin instead.

For removing plugins that are no longer needed (either because they're sunset or because they've been moved into core), set the alias to null:

"aliases": {
  "old-name-plugin": null
}

old-name-plugin will be autoremoved on the next update and will not be able to be installed with mycli plugins:install old-name-plugin.

Commands

vtex plugins install PLUGIN

Installs a plugin into the CLI.

USAGE
  $ vtex plugins install PLUGIN

ARGUMENTS
  PLUGIN  plugin to install

OPTIONS
  -f, --force    Refetches all packages, even the ones that were previously installed.
  -h, --help     show CLI help
  -v, --verbose

ALIASES
  $ vtex plugins:add

EXAMPLES
  vtex plugins install lighthouse
  vtex plugins install https://github.com/vtex/cli-plugin-someplugin
  vtex plugins install @vtex/cli-plugin-someplugin

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

vtex plugins link PLUGIN

Links a plugin into the CLI for development.

USAGE
  $ vtex plugins link PLUGIN

ARGUMENTS
  PATH  [default: .] Plugin path.

OPTIONS
  -h, --help     show CLI help
  -v, --verbose

EXAMPLE
  vtex plugins link myplugin

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

vtex plugins:list

Lists all plugins installed on your machine.

USAGE
  $ vtex plugins:list

OPTIONS
  --core  Shows core plugins.

EXAMPLE
  vtex plugins list

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

vtex plugins source PLUGIN

Lists all plugins supported by VTEX.

USAGE
  $ vtex plugins source PLUGIN

ARGUMENTS
  PATH  [default: .] Plugin path.

OPTIONS
  -h, --help     show CLI help
  -v, --verbose

EXAMPLE
  vtex plugins source myplugin

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

vtex plugins uninstall PLUGIN

Removes a plugin from the CLI

USAGE
  $ vtex plugins uninstall PLUGIN

ARGUMENTS
  PLUGIN  Plugin to uninstall.

OPTIONS
  -h, --help     show CLI help
  -v, --verbose

ALIASES
  $ vtex plugins:unlink
  $ vtex plugins:remove

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

vtex plugins:update

Updates all plugins installed on your machine.

USAGE
  $ vtex plugins:update

OPTIONS
  -h, --help     show CLI help
  -v, --verbose

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