LinuxCommandLibrary

magento

command-line interface for Magento/Adobe Commerce e-commerce platform

TLDR

List available commands

$ magento list
copy
Enable maintenance mode
$ magento maintenance:enable
copy
Disable maintenance mode
$ magento maintenance:disable
copy
Clear cache
$ magento cache:clean
copy
Flush cache
$ magento cache:flush
copy
Reindex all
$ magento indexer:reindex
copy
Compile dependency injection
$ magento setup:di:compile
copy
Deploy static content
$ magento setup:static-content:deploy
copy

SYNOPSIS

magento [command] [--help] [options] [arguments]

DESCRIPTION

magento is the command-line interface for Magento/Adobe Commerce e-commerce platform. It manages store operations, deployments, and maintenance tasks.
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 shows a service unavailable page to customers while allowing administrators to work. IP exceptions can be configured.

PARAMETERS

cache:clean

Clean cache types.
cache:flush
Flush cache storage.
cache:status
Show cache status.
cache:enable TYPE
Enable cache types.
cache:disable TYPE
Disable cache types.
indexer:reindex
Reindex all indexers.
indexer:status
Show indexer status.
maintenance:enable
Enable maintenance mode.
maintenance:disable
Disable maintenance mode.
setup:upgrade
Upgrade database schema.
setup:di:compile
Compile dependency injection.
setup:static-content:deploy
Deploy static view files.
module:enable MODULE
Enable module.
module:disable MODULE
Disable module.
deploy:mode:set MODE
Set application mode (developer, production).

CAVEATS

Commands must run from Magento root directory. File permissions critical - run as web server user. Static content deployment takes time on large catalogs. Memory limits may need increasing for large stores.

HISTORY

Magento was founded in 2008 by Varien and later acquired by eBay in 2011, then spun off as an independent company. Adobe acquired Magento in 2018. The CLI was introduced with Magento 2 in 2015, replacing the earlier admin-based configuration approach.

SEE ALSO

composer(1), php(1), mysql(1), nginx(8)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community