Magento Tips & Tricks

Magento 2: Console Commands Shortcuts

You often need to use CLI commands while working with Magento 2. But you might miss the fact that all magento 2 console commands has short form. The nature of these shortcuts comes from Symphony framework used by magento team. Each magento console class that implement command line functionality use Symfony\Component\Console\Command component to implement command line features. According to Symphony documentation – “You do not have to type out the full command names. You can just type the shortest unambiguous name to run a command”.

Frequently Used Magento 2 Console Commands Shortcuts

1. Setup Upgrade Command Line

php bin/magento setup:upgrade ==> php bin/magento s:up

2. Cache Command Line

php bin/magento cache:clean ==> php bin/magento c:c

php bin/magento cache:disable ==> php bin/magento c:d

php bin/magento cache:enable [cache_type] ==> php bin/magento c:e [cache_type]

php bin/magento cache:flush [cache_type] ==> php bin/magento c:f [cache_type]

php bin/magento cache:status ==> php bin/magento c:s

3. Static Content Deploy Using Command Line

php bin/magento setup:static-content:deploy ==> php bin/magento s:s:d

4. Reindexing Using Command Line

php bin/magento indexer:reindex ==> php bin/magento i:rei

php bin/magento indexer:info ==> php bin/magento i:i

php bin/magento indexer:status ==> php bin/magento i:sta

php bin/magento indexer:show-mode ==> php bin/magento i:sho

php bin/magento indexer:reset ==> php bin/magento i:res

5. Modules Command Line

php bin/magento module:status ==> php bin/magento mo:s

php bin/magento module:disable Namespace_Module ==> php bin/magento mo:d

php bin/magento module:enable Namespace_Module ==> php bin/magento mo:e

php bin/magento module:uninstall Namespace_Module ==> php bin/magento m:u

Full shortcuts list – https://github.com/brentwpeterson/magento-patches/wiki/Magento-CLI-shortcuts
Complete CLI commands list – Magento 2 Command-Line Interface (CLI) Commands List

Leave a Reply

Your email address will not be published. Required fields are marked *