1

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!

0

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.