Commands
Setup commands
Reference: Magento Dev Docs — Clear directories during development
php bin/magento setup:upgrade
Mode commands
Reference: Magento Dev Docs — Set the Magento mode
php bin/magento deploy:mode:show
php bin/magento deploy:mode:set production
php bin/magento deploy:mode:set developer
Module commands
php bin/magento module:disable {Namespace_ModuleName}
php bin/magento module:enable {Namespace_ModuleName}
Cache commands
Reference: Magento Dev Docs — Manage the cache
bin/magento cache:status
php bin/magento cache:clean
php bin/magento cache:clean [type]
php bin/magento cache:flush
php bin/magento cache:flush [type]
List of cache types (for frontend dev):
- config
- layout
- block_html
- full_page
Index commands
Reference: Magento Dev Docs — Manage the indexer
# Refresh all indexes
php bin/magento indexer:reindex
# Refresh a specific index
php bin/magento indexer:reindex {indexName}