Magento 2 CLI Guide 2026: Everything You Need to Know About CLI Commands for Magento Open Source & Adobe Commerce, Including Import & Export

- Fire development, Magento 2

Magento 2 Development; Magento 2 tutorial

Managing an ecommerce store from the Admin Panel is convenient, but many Magento 2 and Adobe Commerce tasks are faster and more flexible from the command line. The Magento 2 CLI (Command-Line Interface) provides developers and system administrators with direct access to essential store management, configuration, maintenance, deployment, and data operations.

With the bin/magento CLI, you can perform tasks such as clearing cache, reindexing catalog data, running cron jobs, managing modules, deploying static content, changing configuration, enabling maintenance mode, and upgrading the Magento database. CLI commands are also important for automating recurring operations and managing large-scale ecommerce environments.

Although Magento Open Source and Adobe Commerce share the same core CLI framework, Adobe Commerce can provide additional commands through its Commerce-specific modules and services. The available command set also depends on the Magento version and enabled extensions.

In this guide, we explain how to use Magento 2 CLI commands, show the most useful commands for Magento Open Source, highlight additional Adobe Commerce commands, and explain how to execute CLI operations safely. You will also learn how the command line can support Magento 2 product import, export, data synchronization, migration, and other automated workflows.

How to Run CLI Commands in Magento 2

Magento 2 CLI commands are executed from the Magento root directory, where the bin/magento executable is located. Connect to your server through SSH, navigate to the Magento installation, and run the required command using the following syntax:

cd /path/to/magento

php bin/magento <command>

For example, to check the status of Magento indexers, run php bin/magento indexer:status

To see all commands available in your particular Magento 2 installation, use php bin/magento list

How to Run Magento CLI Commands Safely

Magento CLI commands should generally be executed by the file system owner rather than an arbitrary server user. Before running a command in a production environment, check its help output and understand whether it changes configuration, database data, indexes, cache, or application files.

Using bin/magento list and bin/magento help is also the safest way to account for differences between Magento Open Source versions and installed extensions.

Are Magento 2 CLI Commands Different in Adobe Commerce and Magento Open Source?

In most cases, Magento Open Source and Adobe Commerce use the same CLI commands. Both editions rely on the bin/magento command-line interface, so the standard commands for cache management, indexing, cron, configuration, compilation, static content deployment, and other core operations generally work the same way. Adobe’s documentation also notes that the CLI is extensible and that commands are provided by the modules enabled in the installation.

Although the core CLI is shared, Adobe Commerce can expose additional commands because it includes functionality that is not available in Magento Open Source. For example, Adobe Commerce includes additional functionality related to B2B and other Commerce features. These modules can introduce their own CLI commands and background processes that are not present in a standard Magento Open Source installation.

Magento 2 CLI Commands: Complete Reference for Magento Open Source

Magento Open Source provides a comprehensive command-line interface through bin/magento. It allows developers and system administrators to manage installation, configuration, caching, indexing, cron jobs, modules, maintenance mode, static content, and other store operations directly from the server.

The exact list of available commands depends on the Magento 2 version and enabled modules. To see all commands available in your installation, run:

bin/magento list

You can also display detailed help for any command:

bin/magento help <command>

The following table covers the most useful Magento 2 CLI commands for Open Source, particularly those relevant to store maintenance, development, deployment, and data management.

Magento 2 CLI command Description
bin/magento list Displays all CLI commands available in the current Magento 2 installation.
bin/magento help <command> Displays detailed information and available options for a specific CLI command.
bin/magento –version Displays the installed Magento 2 version.
bin/magento setup:install Installs Magento Open Source from the command line.
bin/magento setup:upgrade Updates the database schema and data after installing or changing modules.
bin/magento setup:uninstall Uninstalls the Magento application.
bin/magento setup:config:set Creates or updates the Magento deployment configuration.
bin/magento setup:store-config:set Configures store-level settings such as the base URL, locale, currency, and timezone.
bin/magento setup:db-schema:upgrade Updates the database schema according to the current codebase.
bin/magento setup:db-data:upgrade Updates database data according to module changes.
bin/magento setup:db:status Checks whether the database schema is up to date.
bin/magento cache:status Displays the current status of Magento cache types.
bin/magento cache:enable Enables one or more Magento cache types.
bin/magento cache:disable Disables one or more Magento cache types.
bin/magento cache:clean Cleans Magento cache entries without removing all cached data.
bin/magento cache:flush Flushes Magento cache storage, removing cached data from the configured cache backend.
bin/magento indexer:status Displays the current status of Magento indexers.
bin/magento indexer:show-mode Shows whether an indexer operates in Update on Save or Update by Schedule mode.
bin/magento indexer:set-mode <mode> Changes an indexer’s update mode.
bin/magento indexer:reindex Rebuilds Magento indexes. You can reindex all indexes or specify particular indexers.
bin/magento indexer:info Displays information about available indexers.
bin/magento cron:run Runs Magento cron jobs.
bin/magento maintenance:enable Enables Magento maintenance mode.
bin/magento maintenance:disable Disables Magento maintenance mode.
bin/magento maintenance:status Displays the current maintenance mode status.
bin/magento maintenance:allow-ips Manages IP addresses that can access the storefront while maintenance mode is enabled.
bin/magento module:status Displays the status of installed Magento modules.
bin/magento module:enable <module> Enables one or more Magento modules.
bin/magento module:disable <module> Disables one or more Magento modules.
bin/magento setup:di:compile Compiles dependency injection configuration and generates required classes such as factories, proxies, and interceptors.
bin/magento setup:static-content:deploy Deploys static view files, including CSS, JavaScript, and other frontend assets.
bin/magento config:show Displays saved configuration values.
bin/magento config:set <path> <value> Sets a non-sensitive Magento configuration value from the command line.
bin/magento admin:user:create Creates an administrator account from the command line.
bin/magento admin:user:unlock <username> Unlocks a Magento administrator account.
bin/magento sampledata:deploy Deploys Magento sample data packages when they are available.
bin/magento sampledata:install Installs Magento sample data.
bin/magento sampledata:remove Removes installed sample data.

These are the core commands most Magento Open Source administrators and developers are likely to use. Adobe’s CLI documentation groups common operations around cache management, indexers, cron, dependency injection compilation, static content deployment, configuration, and administrator management.

Adobe Commerce CLI Commands: Commands Not Available in Magento Open Source

As we’ve already mentioned, Adobe Commerce extends the standard Magento 2 command-line interface with additional commands related to Commerce-specific functionality, Adobe services, security, application diagnostics, and enterprise deployment features. The exact list can change between Adobe Commerce versions and according to installed modules.

The following table focuses on Adobe Commerce-specific CLI commands that are not part of the core Magento Open Source command set covered above. For example, Adobe IMS management and several Commerce-specific support and deployment utilities are available in Adobe Commerce. Adobe’s official CLI reference for Adobe Commerce 2.4.9 currently documents 147 commands.

Adobe Commerce CLI command Description
bin/magento admin:adobe-ims:enable Enables Adobe Identity Management System (IMS) integration for Commerce Admin and configures the Organization ID, client ID, client secret, and 2FA settings.
bin/magento admin:adobe-ims:disable Disables the Adobe IMS module.
bin/magento admin:adobe-ims:info Displays the current Adobe IMS configuration information.
bin/magento admin:adobe-ims:status Displays the current status of the Adobe IMS module.
bin/magento braintree:migrate Migrates stored card information from a Magento 1 database for supported Braintree payment configurations.
bin/magento cache:clean:payment_services_merchant_scopes Clears the Payment Services merchant scopes cache.
bin/magento catalog:product:attributes:cleanup Removes unused product attributes from the catalog.
bin/magento customer:hash:upgrade Upgrades customer password hashes to the latest supported hashing algorithm.
bin/magento dev:email:newsletter-compatibility-check Scans newsletter templates for potentially incompatible variable usage.
bin/magento dev:email:override-compatibility-check Checks email template overrides for potentially incompatible variable usage.
bin/magento info:dependencies:show-framework Generates a report showing dependencies on the Magento framework.
bin/magento info:dependencies:show-modules Generates a report showing dependencies between Magento modules.
bin/magento info:dependencies:show-modules-circular Identifies circular dependencies between modules.
bin/magento inventory:reservation:create-compensations Creates inventory reservation compensations from supplied reservation arguments.
bin/magento inventory:reservation:list-inconsistencies Identifies inconsistencies between inventory reservations, orders, and salable product quantities.
bin/magento inventory-geonames:import <countries> Downloads and imports geographical data used by the inventory source selection algorithm.
bin/magento newrelic:create:deploy-marker Creates a deployment marker in New Relic and associates the deployment with a message, change log, user, or revision.
bin/magento security:recaptcha:disable-for-user-login Disables reCAPTCHA protection for the Admin user login form.
bin/magento security:tfa:google:set-secret Sets the secret used to generate Google OTP codes for a specified Admin user.
bin/magento security:tfa:providers Lists the available two-factor authentication providers.
bin/magento security:tfa:reset Resets two-factor authentication configuration for a specified Admin user and provider.
bin/magento support:backup:code Creates a backup of Commerce code and can optionally include logs.
bin/magento support:backup:db Creates a database backup and can optionally include logs.
bin/magento support:utility:check Checks whether the system has the utilities required for Commerce support backups.
bin/magento support:utility:paths Creates a list of paths used by the required support utilities.
bin/magento theme:uninstall <theme> Uninstalls a specified theme and can create a code backup and clear generated static content.
bin/magento varnish:vcl:generate Generates Varnish VCL configuration based on the specified backend, access list, Varnish version, and other parameters.
bin/magento webhooks:dev:run <name> <payload> Executes a registered webhook with a supplied JSON payload for development and testing purposes.

Adobe Commerce B2B CLI Operations

Adobe Commerce also includes the B2B extension, which adds functionality such as company accounts, shared catalogs, negotiable quotes, purchase orders, quick orders, and requisition lists. However, these capabilities should not automatically be presented as separate bin/magento commands.

Instead, many B2B operations are handled through Admin, REST/GraphQL APIs, database configuration, and asynchronous message queue consumers. For example, Adobe documents consumers such as sharedCatalogUpdatePrice, sharedCatalogUpdateCategoryPermissions, negotiableQuotePriceUpdate, and purchaseorder.toorder. These consumers can be started with the standard:

bin/magento queue:consumers:start <consumer_name>

Adobe specifically recommends starting the required consumers after installing the B2B extension to process asynchronous B2B operations.

How to Find Adobe Commerce-Specific Commands

Because the available CLI commands depend on the installed and enabled modules, the most reliable method is to inspect the actual Adobe Commerce installation:

bin/magento list

You can also filter the list by namespace. For example:

bin/magento list admin

or:

bin/magento list security

To get detailed information about a particular Adobe Commerce CLI command, use:

bin/magento help <command>

Adobe notes that commands belonging to disabled modules are not displayed. Therefore, two Adobe Commerce installations can have different CLI command lists even when they run the same Commerce version.

For Adobe Commerce on Cloud Infrastructure, there is also a separate magento-cloud CLI with its own command set. Those commands should not be confused with bin/magento commands and are therefore outside the scope of this table.

How to Run Product Import & Export in Magento 2 Open Source & Adobe Commerce from CLI

The default import tools of Magento 2 don’t let you use the CLI. The Improved Import & Export Extension, however, supports this functionality. The module allows you to enable, disable, and start import and export processes from the Magento 2 CLI interface.

Magento 2 Import from CLI

Run the following Magento CLI commands in the Magento 2 root folder to manage import operations:

Magento 2 Export from CLI

Also, check the Magento 2 CLI commands list for export:

Note that you have to create corresponding jobs for both import and export processes before using these CLI commands.

Final Words: Simplify Magento 2 and Adobe Commerce Data Exchange with CLI Commands

The Magento 2 CLI is an essential tool for developers and administrators who need efficient control over store configuration, maintenance, deployment, and data operations. Whether you use Magento Open Source or Adobe Commerce, CLI commands can help automate routine tasks, manage large ecommerce environments, and support more efficient development and maintenance workflows.

For data-intensive operations, however, command-line tools are only one part of the integration process. Magento 2 import and export, data synchronization, migration, and exchange with external systems often require flexible mapping, automation, scheduling, filtering, and support for different data formats and integration methods.

FireBear Studio can help you build and maintain reliable Magento 2 and Adobe Commerce data exchange workflows. Whether you need to import products and customers, export orders, synchronize catalog and inventory data, migrate information between platforms, or connect Magento with an ERP, CRM, PIM, marketplace, or other external system, our team can help you choose and implement the right approach.

Need help with Magento 2 or Adobe Commerce import and export? Contact FireBear Studio to discuss your data exchange requirements and find a solution tailored to your integration, migration, or synchronization project.

Frequently Asked Questions About Magento 2 CLI

What is the Magento 2 CLI?

The Magento 2 CLI (Command-Line Interface) is a command-line tool that allows developers and administrators to manage a Magento 2 or Adobe Commerce store from the server. Using bin/magento, you can perform tasks such as cache management, indexing, configuration, module management, database upgrades, cron execution, static content deployment, and other maintenance operations.

How do I run a CLI command in Magento 2?

To run a Magento 2 CLI command, connect to your server through SSH, navigate to the Magento root directory, and execute the command with php bin/magento. For example, you can check indexer status with php bin/magento indexer:status. You can use php bin/magento list to see the commands available in your installation.

Are Magento Open Source and Adobe Commerce CLI commands the same?

Magento Open Source and Adobe Commerce share the same core bin/magento CLI framework, so many commands are identical. Adobe Commerce can provide additional commands through Commerce-specific modules and services. The exact command list depends on the Magento version, installed modules, and enabled extensions.

How can I see all available Magento 2 CLI commands?

Run the following command from the Magento root directory: php bin/magento list. It displays the commands available in your particular Magento 2 installation. To get detailed information about a specific command, use php bin/magento help <command>.

Can I use Magento 2 CLI for product import and export?

Yes, CLI can be used as part of Magento 2 product import and export workflows. However, Magento Open Source does not provide one universal CLI command that covers every product import or export scenario. Third-party extensions can add their own CLI commands for automated imports, exports, scheduled jobs, and data processing.

Which Magento 2 CLI command should I use to reindex products?

The indexer:reindex command rebuilds Magento indexes. To reindex all available indexers, run php bin/magento indexer:reindex. You can also specify individual indexers when you only need to update particular types of indexed data. Use php bin/magento indexer:status to check their current status.

How do I clear the Magento 2 cache from the command line?

You can check cache status with php bin/magento cache:status. To clean Magento cache entries, use php bin/magento cache:clean. To flush the configured cache storage, use php bin/magento cache:flush. The two operations have different effects, so cache:flush should not be used automatically when cache:clean is sufficient.

Can Magento 2 CLI commands be automated?

Yes. Magento 2 CLI commands can be incorporated into server-side automation, cron jobs, deployment scripts, and integration workflows. This makes the CLI particularly useful for recurring operations such as imports, exports, indexing, cache management, and data synchronization. A third-party import extension can also provide a CLI command that can be executed automatically according to a defined schedule.

What Magento 2 CLI commands are useful for data synchronization?

The most useful commands depend on how the synchronization is implemented. Magento CLI can support the surrounding workflow by running cron jobs, processing queues, reindexing data, and executing commands provided by import/export extensions. For complex Magento 2 data synchronization, you may also need API integrations, scheduled imports and exports, data mapping, filtering, and format conversion.

Can FireBear help with Magento 2 import, export, and data exchange?

Yes. FireBear Studio provides solutions and technical assistance for Magento 2 and Adobe Commerce data exchange, including product import and export, customer and order data transfers, catalog synchronization, migration, and integrations with external systems. If your project involves complex mapping, recurring synchronization, API connections, or large-scale data migration, you can contact FireBear to discuss the required workflow and implementation approach.