Skip to main content

✨ Robo Plugins

Robo Plugins are special. They let you add features to your Robo with one command and integrate seamlessly thanks to the Robo File Structure. What's more, anyone can create a plugin.

You can install and manage plugins in Robo.js either using the Robo CLI or manually.

Using Robo CLI

The Robo CLI has its own commands install the plugin's NPM package and register it in your Robo's configuration.

When dealing with NPM packages, Robo CLI will use the executor command's package manager.

CommandPackage Manager
npx robo addnpm install
pnpm robo addpnpm add
yarn robo addyarn add
bun robo addbun add

Install

Run in your terminal, replacing <package> with the name of the plugin you want to install (e.g. @robojs/ai):

Terminal
npx robo add package

This will install the package and register it in your Robo's configuration. To install many at once:

Terminal
npx robo add @robojs/ai @robojs/moderation @robojs/server

You can also create a new Robo project with plugins pre-installed:

Terminal
npx create-robo projectName --plugins @robojs/ai @robojs/server

Uninstall

To remove a plugin:

Terminal
npx robo remove package

This will uninstall the package and remove it from your Robo's configuration.

Updates

You can use robo upgrade to not only update Robo.js itself, but also all installed plugins.

Terminal
npx robo upgrade

This will show you a list of updates and changelogs for you to select.

Manually

Don't want to use the Robo CLI? You can still install plugins manually. It's not as convenient as using the Robo CLI, but it's still a straightforward process.

Here's how you can do it:

Package Manager

Use the package manager of your choice to install the plugin:

Terminal
npm install package

The same goes for bun, pnpm, and yarn.

Register Plugin

Robo.js knows which plugins to use by looking the /config/plugins directory.

For each plugin you want, create an .mjs file in /config/plugins with the same name as the plugin's package. The file should export the plugin's configuration.

config/plugins/<package>.mjs
export default {
// ... plugin configuration
}

Remember to delete the file if you uninstall the plugin.

Learn More

Robo.js Logo

MIT © 2024 Robo.js By WavePlay