magento
command-line interface for Magento/Adobe Commerce e-commerce platform
TLDR
SYNOPSIS
bin/magento command [options] [arguments]
DESCRIPTION
bin/magento is the command-line interface for the Magento Open Source and Adobe Commerce e-commerce platform. It is a Symfony Console application shipped in the bin/ directory of every Magento 2 installation and manages store operations, deployments, and maintenance tasks. Extensions can register additional commands.Cache management is critical for performance. Clean removes specific cached data while flush clears all storage. Different cache types (config, layout, block_html, collections, etc.) can be targeted individually.The deployment process involves dependency injection compilation, static content deployment, and database upgrades. These steps are required after code changes or module installations.Indexers keep derived data synchronized with source data. Reindexing is needed after catalog changes, price updates, or inventory modifications.Maintenance mode is toggled by the var/.maintenance.flag file and shows a service unavailable page to customers. IP addresses listed with --ip (stored in var/.maintenance.ip) can still reach the store.
PARAMETERS
cache:clean [TYPE...]
Clean enabled cache types (all if none given).cache:flush [TYPE...]
Flush the cache storage, including entries not created by Magento.cache:status
Show cache status.cache:enable TYPE
Enable cache types.cache:disable TYPE
Disable cache types.indexer:reindex [INDEXER...]
Reindex all or the given indexers.indexer:status
Show indexer status.indexer:set-mode MODE [INDEXER...]
Set indexer mode (realtime or schedule).maintenance:enable [--ip=IP]
Enable maintenance mode, optionally exempting IP addresses.maintenance:disable
Disable maintenance mode.setup:upgrade [--keep-generated]
Upgrade database schema and data after module changes.setup:di:compile
Compile dependency injection.setup:static-content:deploy [LOCALES] [-f] [--jobs=N]
Deploy static view files. -f forces deployment outside production mode.module:status
List enabled and disabled modules.module:enable MODULE
Enable module.module:disable MODULE
Disable module.deploy:mode:set MODE
Set application mode (default, developer, production).deploy:mode:show
Show the current application mode.cron:run
Run scheduled cron jobs.config:set PATH VALUE
Set a configuration value.admin:user:create
Create an administrator account.
CAVEATS
Commands are run as bin/magento from the Magento root directory (or php bin/magento); there is no global magento binary. Run them as the file system owner, not root, to avoid permission problems. Static content deployment takes time on large catalogs. Memory limits may need increasing for large stores.
HISTORY
Magento was released in 2008 by Varien, fully acquired by eBay in 2011, then spun off as an independent company in 2015. Adobe acquired Magento in 2018 and sells the commercial edition as Adobe Commerce. The bin/magento CLI was introduced with Magento 2 in 2015; Magento 1 reached end of life in June 2020.
