<blockquote>
  <p>Will these two commands also install the plugin migrations</p>
</blockquote>

<p>There will be no migrations to run since it is a brand new installation.</p>

<blockquote>
  <p>enable the plugin, and update the project.yaml file, just as if I had installed the plugin through the control panel?</p>
</blockquote>

<p>Yes to both.</p>

<blockquote>
  <p>Is it also necessary to run ./craft migrate/all? Or ./craft clear-caches/all?</p>
</blockquote>

<p>Nope.</p>

<blockquote>
  <p>Also, is it possible to install a specific plugin edition (e.g. Lite or Pro) through the command line?</p>
</blockquote>

<p>Not natively. If a plugin has multiple editions, it will default to whatever is listed in their <code>getEditions()</code> method, which is typically going to be "Lite" first.</p>

CC BY-SA 4.0
2021-02-03T21:40:55.277Z
You can potentially use `Craft:$app->plugins->setEdition('plugin-handle', 'edition');` in a content migration or modify the edition key in projectConfig to "force" the edition of a plugin, but I don't think it's an official way. Going through the Craft ID/store would be.
James White
CC BY-SA 4.0
2020-02-18T21:48:15.943Z
2020-02-18T21:48:15.943Z
Brad Bell
<p>I would like to install and enable plugins through the command line in a way that can be scripted, and which replicates the same steps as are taken when you install a plugin through the Craft control panel.</p>

<p>What commands are necessary to accomplish this?</p>

<p>Would this be enough?</p>

<pre><code>composer require repo/plugin-name
./craft install/plugin plugin-slug
</code></pre>

<p>Will these two commands also install the plugin migrations, enable the plugin, and update the <code>project.yaml</code> file, just as if I had installed the plugin through the control panel?</p>

<p>Is it also necessary to run <code>./craft migrate/all</code>? Or <code>./craft clear-caches/all</code>?</p>

<p>Also, is it possible to install a specific plugin edition (e.g. Lite or Pro) through the command line?</p>

<p>Thanks!</p>

CC BY-SA 4.0
2023-05-11T16:25:44.337Z
It seems to now be reversed: `plugin/install`
kr37
<plugins><install><cli>
How do you install a plugin through the command line?
# How do you install a plugin through the command line?

(Asked by: username_0 on 2020-02-18)

I would like to install and enable plugins through the command line in a way that can be scripted, and which replicates the same steps as are taken when you install a plugin through the Craft control panel.
What commands are necessary to accomplish this?
Would this be enough?
composer require repo/plugin-name
./craft install/plugin plugin-slug

Will these two commands also install the plugin migrations, enable the plugin, and update the project.yaml file, just as if I had installed the plugin through the control panel?
Is it also necessary to run ./craft migrate/all? Or ./craft clear-caches/all?
Also, is it possible to install a specific plugin edition (e.g. Lite or Pro) through the command line?
Thanks!

**Tags:** plugins, install, cli

> **Comments:**
> **username_1**: It seems to now be reversed: `plugin/install`  

---

## 1 answers

### Answer by username_2 on 2020-02-18. Score: 1 | Accepted answer

> Will these two commands also install the plugin migrations

There will be no migrations to run since it is a brand new installation.

> enable the plugin, and update the project.yaml file, just as if I had installed the plugin through the control panel?

Yes to both.

> Is it also necessary to run ./craft migrate/all? Or ./craft clear-caches/all?

Nope.

> Also, is it possible to install a specific plugin edition (e.g. Lite or Pro) through the command line?

Not natively. If a plugin has multiple editions, it will default to whatever is listed in their `getEditions()` method, which is typically going to be "Lite" first.

> **Comments:**
> **username_3**: You can potentially use `Craft:$app->plugins->setEdition('plugin-handle', 'edition');` in a content migration or modify the edition key in projectConfig to "force" the edition of a plugin, but I don't think it's an official way. Going through the Craft ID/store would be.  

---

