Menu

Run Multiple Plugins Locally Using the Flex Plugins CLI

The twilio flex:plugins:start command enables you to load multiple plugins on a local instance of Flex. It can load plugins either from the local source directory of a plugin or those that are currently enabled on your Flex application. This command makes it easier and quicker to test a plugin your developing locally with other plugins.

Pilot Feature

This feature is currently offered as a Pilot and has some important limitations.

With pilot releases, our focus is to verify functionality and gather feedback from a limited set of customers. Pilot Features are not covered by a Twilio SLA or support plan.

To participate in this Pilot, please reach out to flex-product@twilio.com

Compatible CLI versions

You need to install the latest version of the Flex Plugins CLI in order to use these features. If you're migrating a legacy plugin to use the new CLI, refer to our Migration Guide.

Register existing plugins

Plugins on your development machine must be registered with the Plugins CLI if you want to include them in a test environment. To register your plugins:

Option 1: Download your plugin source using the CLI

twilio flex:plugins:create --template <github url of plugin> --install

Option 2: Register a plugin already on your machine

# Executed within the directory of your plugin
twilio flex:plugins:start

Run multiple plugins

The Plugins CLI can access any plugin that you have deployed to your Flex account (remote plugins) and any plugin that you are developing on your own machine (local plugins).

Using local plugins

You can choose the plugins you want to run locally by using the --name argument. The name corresponds to the name field in the package.json of your plugin. When you run the command in your plugin directory, you don't have to pass the name of the plugin.

plugin-agent-response $ twilio flex:plugins:start --name plugin-sample

The command does the following:

  • Starts a local instance of Flex
  • Since the command is being run in a plugin directory, it loads plugin-agent-response
  • Since plugin-sample is being passed using the --name argument, it also loads the plugin plugin-sample

By default, your local Flex instance can be accessed from localhost:3000. If you see a login page, the 'Login with Twilio' option will log you into Flex without configuring SSO.

Refer to your Terminal output for information on the plugin directories being used by the local server:

Multipluginlocal.png

Using remote plugins

Including every remote plugin

Use the --include-remote argument to load every plugin that is already enabled on your live Flex application. This shortcut allows you to test any new changes against your normal Flex environment, without manually downloading & running each plugin individually.

plugin-agent-response $ twilio flex:plugins:start --include-remote

The command does the following:

  • Starts a local instance of Flex
  • Since the command is being run in a plugin directory, it loads plugin-agent-response
  • Since --include-remote is used, it accesses your live Flex application, fetches the list of all currently enabled plugins, and loads each of these alongside plugin-agent-response

If plugin-agent-response is already deployed to your live Flex application, your local version will be used in place of the remote version.

An example output is shown below:

multiplugins-includeremote.png

Including select remote plugins

You can use the @remote tag if you only want to run a subset of your live plugins. Each plugin you want to include must be identified with the --name flag.

plugin-agent-response $ twilio flex:plugins:start --name plugin-agent-notes@remote

An example output is shown below:

multiplugin-remote.png

View all plugins registered by Flex Plugins CLI

This settings file is used to identify which plugins can be accessed by the CLI. If you remove or edit this file, you may need to re-register your plugins using the methods listed above.

The Plugins CLI keeps track of all your registered plugins in a settings file. To view details on your registered plugins:

macOS/Linux

cd & cat ~/.twilio-cli/flex/plugins.json

Windows

Run the following command in your Home Directory ( C:\Users\$USERNAME)

type .twilio-cli\flex\plugins.json

Next Steps

Rate this page:

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.

Thank you for your feedback!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Sending your feedback...
🎉 Thank you for your feedback!
Something went wrong. Please try again.

Thanks for your feedback!

Refer us and get $10 in 3 simple steps!

Step 1

Get link

Get a free personal referral link here

Step 2

Give $10

Your user signs up and upgrade using link

Step 3

Get $10

1,250 free SMSes
OR 1,000 free voice mins
OR 12,000 chats
OR more