How do you install a plugin through the command line? 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!
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.