plugin Commands - Medusa CLI Reference

Commands in the Medusa CLI starting with plugin: perform actions related to plugin development.

Note: These commands are available starting from Medusa v2.3.0.

plugin:publish#

Publish a plugin into the local packages registry. The command uses Yalc under the hood to publish the plugin to a local package registry. You can then install the plugin in a local Medusa project using the plugin:add command.

Terminal
npx medusa plugin:publish

plugin:add#

Install the specified plugins from the local package registry into a local Medusa application. Plugins can be added to the local package registry using the plugin:publish command.

Terminal
npx medusa plugin:add [names...]

Arguments#

ArgumentDescriptionRequired

names

The names of one or more plugins to install from the local package registry. A plugin's name is as specified in its package.json file.

Yes


plugin:develop#

Start a development server for a plugin. The command will watch for changes in the plugin's source code and automatically re-publish the changes into the local package registry.

Terminal
npx medusa plugin:develop

plugin:db:generate#

Generate migrations for all modules in a plugin.

Terminal
npx medusa plugin:db:generate

plugin:build#

Build a plugin before publishing it to NPM. The command will compile the output in the .medusa/server directory.

Terminal
npx medusa plugin:build
Was this page helpful?
Ask Anything
Ask any questions about Medusa. Get help with your development.
You can also use the Medusa MCP server in Cursor, VSCode, etc...
FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break