Magento 2 provide CLI (command line interface) that helps Magento Developers perform a lot of actions such as clean cache, install sample data, reindex, generate code, create database backups or add new admin user. This blog is used to note all the available commands to save magento developer from looking up.
Usage:
- command [options] [arguments]
Options:
--help (-h)Display this help message--quiet (-q)Do not output any message--verbose (-v|vv|vvv)Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug--version (-V)Display this application version--ansiForce ANSI output--no-ansiDisable ANSI output--no-interaction (-n)Do not ask any interactive question
Available commands:
helpDisplays help for a commandlistLists commands
admin
admin:user:createCreates an administratoradmin:user:unlockUnlock Admin Account
cache
cache:cleanCleans cache type(s)cache:disableDisables cache type(s)cache:enableEnables cache type(s)cache:flushFlushes cache storage used by cache type(s)cache:statusChecks cache status
catalog
catalog:images:resizeCreates resized product imagescatalog:product:attributes:cleanupRemoves unused product attributes.
cron
cron:runRuns jobs by schedule
customer
customer:hash:upgrade Upgrade customer's hash according to the latest algorithm
deploy
deploy:mode:setSet application mode.deploy:mode:showDisplays current application mode.
dev
dev:source-theme:deployCollects and publishes source files for theme.dev:tests:runRuns testsdev:urn-catalog:generateGenerates the catalog of URNs to *.xsd mappings for the IDE to highlight xml.dev:xml:convertConverts XML file using XSL style sheets
i18n
i18n:collect-phrasesDiscovers phrases in the codebasei18n:packSaves language packagei18n:uninstallUninstalls language packages
indexer
indexer:infoShows allowed Indexersindexer:reindexReindexes Dataindexer:resetResets indexer status to invalidindexer:set-modeSets index mode typeindexer:show-modeShows Index Modeindexer:statusShows status of Indexer
info
info:adminuriDisplays the Magento Admin URIinfo:backups:listPrints list of available backup filesinfo:currency:listDisplays the list of available currenciesinfo:dependencies:show-frameworkShows number of dependencies on Magento frameworkinfo:dependencies:show-modulesShows number of dependencies between modulesinfo:dependencies:show-modules-circularShows number of circular dependencies between modulesinfo:language:listDisplays the list of available language localesinfo:timezone:listDisplays the list of available timezones
maintenance
maintenance:allow-ipsSets maintenance mode exempt IPsmaintenance:disableDisables maintenance modemaintenance:enableEnables maintenance modemaintenance:statusDisplays maintenance mode status
module
module:disableDisables specified modulesmodule:enableEnables specified modulesmodule:statusDisplays status of modulesmodule:uninstall Uninstalls modules installed by composer
sampledata
sampledata:deployDeploy sample data modulessampledata:removeRemove all sample data packages from composer.jsonsampledata:resetReset all sample data modules for re-installation
setup
setup:backupTakes backup of Magento Application code base, media and databasesetup:config:setCreates or modifies the deployment configurationsetup:cron:runRuns cron job scheduled for setup applicationsetup:db-data:upgradeInstalls and upgrades data in the DBsetup:db-schema:upgradeInstalls and upgrades the DB schemasetup:db:statusChecks if DB schema or data requires upgradesetup:di:compileGenerates DI configuration and all missing classes that can be auto-generatedsetup:installInstalls the Magento applicationsetup:performance:generate-fixturesGenerates fixturessetup:rollbackRolls back Magento Application codebase, media and databasesetup:static-content:deployDeploys static view filessetup:store-config:setInstalls the store configurationsetup:uninstallUninstalls the Magento applicationsetup:upgradeUpgrades the Magento application, DB data, and schema
theme
theme:uninstallUninstalls theme