File | Settings | Command Line Tool Support
PhpStorm | Preferences | Command Line Tool Support
The dialog box opens when you click the Add button and choose Composer in the Choose Tool to Add dialog box.
Use the dialog box to enable the use of Composer Dependency Manager in the command line mode.
Integration with Composer is provided at the PhpStorm level, so once configured, the tool can be used in all your PhpStorm projects.
Just activate or de-activate it when necessary depending on you needs.