Magento 2 SSH/CLI Commands List

If you regularly run and set up the Magento 2 website, you will need to use the SSH and CLI commands. The commands in Magento are quite a few, and you’ll probably miss out on some useful ones. I have compiled all the commands in Magento 2 SSH/CLI Commands List. You can bookmark this post, so you can refer to it every time you need it.

You can get more information about the commands by adding -h or –help suffix to the command.

For example:

php bin/magento setup:upgrade -h
php bin/magento setup:upgrade --help

It can also be used with shortcuts commands

php bin/magento s:u -h
php bin/magento s:u --help

All Magento 2 CLI Commands

CommandsShortcutsDescription
Options
php bin/magento --helpphp bin/magento -hDisplay this help message
php bin/magento --quietphp bin/magento -qDo not output any message
php bin/magento --versionphp bin/magento -VDisplay this application version
php bin/magento --ansiForce ANSI output
php bin/magento --no-ansiDisable ANSI output
php bin/magento --no-interactionphp bin/magento -nDo not ask any interactive question
php bin/magento --verbosephp bin/magento -v|vv|vvvIncrease the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
Available commands
php bin/magento helpphp bin/magento hDisplays help for a command
php bin/magento listphp bin/magento lLists commands
admin
php bin/magento admin:user:createphp bin/magento a:u:cCreates an administrator
php bin/magento admin:user:unlockphp bin/magento a:u:uUnlock Admin Account
app
php bin/magento app:config:dumpphp bin/magento a:c:dCreate dump of application
php bin/magento app:config:importphp bin/magento a:c:iImport data from shared configuration files to appropriate data storage
php bin/magento app:config:statusphp bin/magento a:c:sChecks if config propagation requires update
braintree
php bin/magento braintree:migratephp bin/magento b:mMigrate stored cards from a Magento 1 database
cache
php bin/magento cache:cleanphp bin/magento c:cCleans cache type(s)
php bin/magento cache:disablephp bin/magento c:dDisables cache type(s)
php bin/magento cache:enablephp bin/magento c:eEnables cache type(s)
php bin/magento cache:flushphp bin/magento c:fFlushes cache storage used by cache type(s)
php bin/magento cache:statusphp bin/magento c:sChecks cache status
catalog
php bin/magento catalog:images:resizephp bin/magento c:i:rCreates resized product images
php bin/magento catalog:product:attributes:cleanupphp bin/magento c:p:a:cRemoves unused product attributes
config
php bin/magento config:sensitive:setphp bin/magento c:s:sSet sensitive configuration values
php bin/magento config:setphp bin/magento c:setChange system configuration
php bin/magento config:showphp bin/magento c:shoShows configuration value for given path. If path is not specified, all saved values will be shown
cron
php bin/magento cron:installphp bin/magento c:inGenerates and installs crontab for current user
php bin/magento cron:removephp bin/magento c:reRemoves tasks from crontab
php bin/magento cron:runphp bin/magento c:rRuns jobs by schedule
customer
php bin/magento customer:hash:upgradephp bin/magento c:h:uUpgrade customer’s hash according to the latest algorithm
deploy
php bin/magento deploy:mode:setphp bin/magento d:m:setSet application mode
php bin/magento deploy:mode:showphp bin/magento d:m:shoDisplays current application mode
dev
php bin/magento dev:di:infophp bin/magento d:d:iProvides information on Dependency Injection configuration for the Command
php bin/magento dev:profiler:disablephp bin/magento d:p:dDisable the profiler
php bin/magento dev:profiler:enablephp bin/magento d:p:eEnable the profiler
php bin/magento dev:query-log:disablephp bin/magento d:q:dDisable DB query logging
php bin/magento dev:query-log:enablephp bin/magento d:q:eEnable DB query logging
php bin/magento dev:source-theme:deployphp bin/magento d:s:dCollects and publishes source files for theme
php bin/magento dev:template-hints:disablephp bin/magento d:t:dDisable frontend template hints. A cache flush might be required
php bin/magento dev:template-hints:enablephp bin/magento d:t:eEnable frontend template hints. A cache flush might be required
php bin/magento dev:template-hints:statusphp bin/magento d:t:sShow frontend template hints status
php bin/magento dev:tests:runphp bin/magento d:t:rRuns tests
php bin/magento dev:urn-catalog:generatephp bin/magento d:u:gGenerates the catalog of URNs to *.xsd mappings for the IDE to highlight xml
php bin/magento dev:xml:convertphp bin/magento d:x:cConverts XML file using XSL style sheets
dotdigital
php bin/magento dotdigital:connector:automapphp bin/magento d:c:aAuto-map data fields
php bin/magento dotdigital:connector:enablephp bin/magento d:c:eAdd Dotdigital API credentials and enable the connector
php bin/magento dotdigital:migratephp bin/magento do:mMigrate data into email_ tables to sync with Engagement Cloud
php bin/magento dotdigital:syncphp bin/magento do:sRun syncs to populate email_ tables before importing to Engagement Cloud
downloadable
php bin/magento downloadable:domains:addphp bin/magento d:d:aAdd domains to the downloadable domains whitelist
php bin/magento downloadable:domains:removephp bin/magento d:d:rRemove domains from the downloadable domains whitelist
php bin/magento downloadable:domains:showphp bin/magento d:d:sDisplay downloadable domains whitelist
encryption
php bin/magento encryption:payment-data:updatephp bin/magento e:p:uRe-encrypts encrypted credit card data with latest encryption cipher
i18n
php bin/magento i18n:collect-phrasesphp bin/magento i1:cDiscovers phrases in the codebase
php bin/magento i18n:packphp bin/magento i:pSaves language package
php bin/magento i18n:uninstallphp bin/magento i:uUninstalls language packages
indexer
php bin/magento indexer:infophp bin/magento i:iShows allowed Indexers
php bin/magento indexer:reindexphp bin/magento i:reiReindexes Data
php bin/magento indexer:resetphp bin/magento i:resResets indexer status to invalid
php bin/magento indexer:set-dimensions-modeSet Indexer Dimensions Mode
php bin/magento indexer:set-modephp bin/magento i:setSets index mode type
php bin/magento indexer:show-dimensions-modeShows Indexer Dimension Mode
php bin/magento indexer:show-modephp bin/magento i:showShows Index Mode
php bin/magento indexer:statusphp bin/magento i:staShows status of Indexer
info
php bin/magento info:adminuriphp bin/magento i:aDisplays the Magento Admin URI
php bin/magento info:backups:listphp bin/magento i:b:lPrints list of available backup files
php bin/magento info:currency:listphp bin/magento i:c:lDisplays the list of available currencies
php bin/magento info:dependencies:show-frameworkphp bin/magento i:d:show-fShows number of dependencies on Magento framework
php bin/magento info:dependencies:show-modulesShows number of dependencies between modules
php bin/magento info:dependencies:show-modules-circularShows number of circular dependencies between modules
php bin/magento info:language:listphp bin/magento i:l:lDisplays the list of available language locales
php bin/magento info:timezone:listphp bin/magento i:t:lDisplays the list of available timezones
inventory
php bin/magento inventory:reservation:create-compensationsphp bin/magento i:r:cCreate reservations by provided compensation arguments
php bin/magento inventory:reservation:list-inconsistenciesphp bin/magento i:r:lShow all orders and products with salable quantity inconsistencies
inventory-geonames
php bin/magento inventory-geonames:importphp bin/magento inv:iDownload and import geo names for source selection algorithm
maintenance
php bin/magento maintenance:allow-ipsphp bin/magento ma:aSets maintenance mode exempt IPs
php bin/magento maintenance:disablephp bin/magento ma:dDisables maintenance mode
php bin/magento maintenance:enablephp bin/magento ma:eEnables maintenance mode
php bin/magento maintenance:statusphp bin/magento ma:sDisplays maintenance mode status
media-content
php bin/magento media-content:syncphp bin/magento media-c:sSynchronize content with assets
media-gallery
php bin/magento media-gallery:syncphp bin/magento media-g:sSynchronize media storage and media assets in the database
module
php bin/magento module:config:statusphp bin/magento mo:c:sChecks the modules configuration in the 'app/etc/config.php' file and reports if they are up to date or not
php bin/magento module:disablephp bin/magento mo:dDisables specified modules
php bin/magento module:enablephp bin/magento mo:eEnables specified modules
php bin/magento module:statusphp bin/magento mo:sDisplays status of modules
php bin/magento module:uninstallphp bin/magento mo:uUninstalls modules installed by composer
newrelic
php bin/magento module newrelic:create:deploy-markerphp bin/magento n:c:dCheck the deploy queue for entries and create an appropriate deploy marker
queue
php bin/magento queue:consumers:listphp bin/magento q:c:lList of MessageQueue consumers
php bin/magento queue:consumers:startphp bin/magento q:c:sStart MessageQueue consumer
sampledata
php bin/magento sampledata:deployphp bin/magento sa:dDeploy sample data modules for composer-based Magento installations
php bin/magento sampledata:removephp bin/magento sa:remRemove all sample data packages from composer.json
php bin/magento sampledata:resetphp bin/magento sa:resReset all sample data modules for re-installation
security
php bin/magento security:recaptcha:disable-for-user-forgot-passwordDisable reCAPTCHA for admin user forgot password form
php bin/magento security:recaptcha:disable-for-user-loginDisable reCAPTCHA for admin user login form
setup
php bin/magento setup:backupphp bin/magento s:bTakes backup of Magento Application code base, media and database
php bin/magento setup:config:setphp bin/magento s:c:sCreates or modifies the deployment configuration
php bin/magento setup:db-data:upgradephp bin/magento s:db-d:uInstalls and upgrades data in the DB
php bin/magento setup:db-declaration:generate-patchGenerate patch and put it in specific folder
php bin/magento setup:db-declaration:generate-whitelistGenerate whitelist of tables and columns that are allowed to be edited by declaration installer
php bin/magento setup:db-schema:upgradephp bin/magento s:db-s:uInstalls and upgrades the DB schema
php bin/magento setup:db:statusphp bin/magento s:d:sChecks if DB schema or data requires upgrade
php bin/magento setup:di:compilephp bin/magento s:d:cGenerates DI configuration and all missing classes that can be auto-generated
php bin/magento setup:installphp bin/magento s:iInstalls the Magento application
php bin/magento setup:performance:generate-fixturesphp bin/magento s:p:gGenerates fixtures
php bin/magento setup:rollbackphp bin/magento se:roRolls back Magento Application codebase, media and database
php bin/magento setup:static-content:deployphp bin/magento s:s:dDeploys static view files
php bin/magento setup:store-config:setphp bin/magento s:s:sInstalls the store configuration. Deprecated since 2.2.0. Use config:set instead
php bin/magento setup:uninstallphp bin/magento s:unUninstalls the Magento application
php bin/magento setup:upgradephp bin/magento s:upUpgrades the Magento application, DB data, and schema
store
php bin/magento store:listphp bin/magento s:lDisplays the list of stores
php bin/magento store:website:listphp bin/magento s:w:lDisplays the list of websites
theme
php bin/magento theme:uninstallphp bin/magento t:uUninstalls theme
varnish
php bin/magento varnish:vcl:generatephp bin/magento v:v:gGenerates Varnish VCL and echos it to the command line
yotpo
php bin/magento yotpo:resetphp bin/magento y:rReset Yotpo sync flags &/or configurations
php bin/magento yotpo:syncphp bin/magento y:sSync Yotpo manually (reviews module)
php bin/magento yotpo:update-metadataphp bin/magento y:uManually send platform metadata to Yotpo

This is the end of the Magento 2 SSH/CLI Commands List.

You can read more useful articles like How To Allow Guests To Write Reviews In Magento 2.

Follow us for the more helpful posts!

We hope this is a useful post for you.

Thank you for reading!

4.7 3 votes
Article Rating

Aaron LX

Aaron is a passionate writer, crazy about shopping, eCommerce and trends. Besides his outstanding research skills and a positive mind, Aaron eagerly shares his experience with the readers.

Leave a Reply or put your Question here

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x