1 ---
2 sidebar_label: "plugin"
3 sidebar_position: 6
4 ---
5
6 import { Table } from "docs-ui"
7
8 export const metadata = {
9 title: `plugin Commands - Medusa CLI Reference`,
10 }
11
12 # {metadata.title}
13
14 Commands in the Medusa CLI starting with `plugin:` perform actions related to [plugin development](!docs!/learn/fundamentals/plugins).
15
16 <Note>
17
18 These commands are available starting from [Medusa v2.3.0](https://github.com/medusajs/medusa/releases/tag/v2.3.0).
19
20 </Note>
21
22 ## plugin\:publish
23
24 Publish a plugin into the local packages registry. The command uses [Yalc](https://github.com/wclr/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](#pluginadd) command.
25
26 ```bash npx2yarn
27 npx medusa plugin:publish
28 ```
29
30 ---
31
32 ## plugin\:add
33
34 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](#pluginpublish) command.
35
36 ```bash npx2yarn
37 npx medusa plugin:add [names...]
38 ```
39
40 ### Arguments
41
42 <Table>
43 <Table.Header>
44 <Table.Row>
45 <Table.HeaderCell>
46 Argument
47 </Table.HeaderCell>
48 <Table.HeaderCell>
49 Description
50 </Table.HeaderCell>
51 <Table.HeaderCell>
52 Required
53 </Table.HeaderCell>
54 </Table.Row>
55 </Table.Header>
56 <Table.Body>
57 <Table.Row>
58 <Table.Cell>
59
60 `names`
61
62 </Table.Cell>
63 <Table.Cell>
64
65 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.
66
67 </Table.Cell>
68 <Table.Cell>
69
70 Yes
71
72 </Table.Cell>
73 </Table.Row>
74 </Table.Body>
75 </Table>
76
77 ---
78
79 ## plugin\:develop
80
81 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.
82
83 ```bash npx2yarn
84 npx medusa plugin:develop
85 ```
86
87 ---
88
89 ## plugin\:db\:generate
90
91 Generate migrations for all modules in a plugin.
92
93 ```bash npx2yarn
94 npx medusa plugin:db:generate
95 ```
96
97 ---
98
99 ## plugin\:build
100
101 Build a plugin before publishing it to NPM. The command will compile the output in the `.medusa/server` directory.
102
103 ```bash npx2yarn
104 npx medusa plugin:build
105 ```
106