We have our PHP compiled, Composer installed, Magento 2 installed. But how access them? Everything is scattered across the file system.
That is where CLI comes in handy. It provides aliases for PHP, Composer and Magento in your project. We can open it by running a command:
npm run cli # for NPMyarn cli # for Yarn
Now we have access to PHP, Composer and Magento, we can install PHP dependencies, upgrade Magento and so on.
php -v> PHP 7.4.13 (cli) ...composer --version> Composer version 1.10.19# Can be used with aliasc --version> Composer version 1.10.19magento setup:upgrade> Magento upgrade output ...# Can be used with aliasm se:up> Magento upgrade output ...
Flushing Magento cache
magento cache:flush# or with aliases and shortcutsm c:f
magento setup:upgrade# or with aliases and shortcutsm se:up
Upgrading Composer dependencies
composer upgrade# or with aliasc upgrade