Is there a way to interactively install suggested composer packages?

Try

composer suggests

Add the flag -v to make it verbose.

This won't install anything, it will just list out all the suggestions. However, you can pipe it to composer require and get the desired output.


composer suggests | xargs -i composer require {}

composer suggests | xargs -L 1 composer require

Should work from windows git bash.


As far as I know, there is no way to achieve this with common composer functionality.

You can write your own scripts to be executed at post-package-install. But Scripts are only executed if defined in the root package's composer.json (more information on how to use scripts see here). Scripts defined in dependencies are not executed for security concerns (there was a discussion on the github some time ago about this).

But maybe a composer-plugin fits your needs. Plugins are used to expand composer's functionality (more information about plugins see here).

As a simple alternative way, I suggest to define a suggested package message like, if you need XY functionality run: php composer.phar require vendor/package:2.* and the user then can use this command to install it. Not as comfortable as you requested but still easy enough for most users I think.