Skip to content

Plugins

auto uses the package tapable to expose a plugin system. Go here to learn how to write one!

Using Plugins

To use a plugin you can either supply the plugin via a CLI arg or in your .autorc.

⚠️ Specifying a plugin overrides the defaults.

Defaults

If you don't configure plugins in your .autorc configuration file auto will use a default package manager plugin.

  • Installed through npm => uses npm
  • Installed through executable => uses git-tag

For the majority of "package manager" plugins you should only use one at a time. Using multiple will lead to undesired results.

No Plugins

If you don't want to include the default plugins, you can supply an empty array in the .autorc configuration file like the following:

{
  "plugins": []
}
{
  "plugins": []
}

Plugin Declaration

There are three ways to name and use a plugin.

Official Plugins

To use an official plugin all you have to do is supply the name.

{
  "plugins": [
    "npm",
    // or the full name
    "@auto-it/npm"
  ]
}
{
  "plugins": [
    "npm",
    // or the full name
    "@auto-it/npm"
  ]
}

npm package

Unofficial plugins pulled from NPM should be named in one of the following formats:

  • auto-plugin-PLUGIN_NAME
  • @my-scope/auto-plugin-PLUGIN_NAME

You use them in your .autorc by:

  • provide the full package name
  • when named like auto-plugin-PLUGIN_NAME just the PLUGIN_NAME.
{
  "plugins": [
    "my-cool-plugin",
    // or
    "auto-plugin-my-cool-plugin",
    // on a scope
    "@my-scope/auto-plugin-my-cool-plugin"
  ]
}
{
  "plugins": [
    "my-cool-plugin",
    // or
    "auto-plugin-my-cool-plugin",
    // on a scope
    "@my-scope/auto-plugin-my-cool-plugin"
  ]
}

Local Plugin

Or if you have a plugin locally supply the path.

{
  "plugins": ["../path/to/plugin.js"]
}
{
  "plugins": ["../path/to/plugin.js"]
}

Plugin Configuration

To provide plugin specific config change the following:

{
  "plugins": ["chrome"]
}
{
  "plugins": ["chrome"]
}

To this:

{
  "plugins": [
    ["chrome", { "extensionId": "1234", "build": "my-compiled-extension.zip" }]
  ]
}
{
  "plugins": [
    ["chrome", { "extensionId": "1234", "build": "my-compiled-extension.zip" }]
  ]
}