Shopware 6 CLI: General Recommendations & Important Commands

- E-Commerce, Shopware

You can dramatically simplify your interaction with Shopware via the console by applying Shopware 6 CLI commands. The platform provides the ability to execute numerous functions with the help of commands. In some situations, such as the necessity to process large amounts of data, their use is the only suitable option.

In this Shopware CLI guide, we provide general recommendations on how to use the command-line interface with the platform. You will find a list of the most important Shopware 6 CLI commands explained and divided into groups. Other Shopware 6 tutorials and guides are available in our cookbook.

Shopware CLI Essentials

Let’s explore a few essential aspects of Shopware CLI and then proceed to the list of commands.

SSH Connection

 

Execute Shopware CLI commands directly in the server’s console. Since an SSH connection is required, it is necessary to take care of additional conditions. For instance, Windows requires apps like “PuTTY” to establish an SSH connection while macOS and Linux provide the same opportunity directly in the terminal.

Shopware CLI Command’s General Form

When the SSH connection is established, proceed to the Shopware installation directory. The platform lets you execute commands with the help of the following general form:

Shopware 6 CLI Commands & Help

To obtain the list of all Shopware CLI commands, enter the following one:

Also, it is possible to access the help page for Shopware CLI commands. Use this command:

In addition, you will find a separate help page for most Shopware CLI commands. Use this command to call it up:

Don’t forget to replace <command> with a particular Shopware CLI command for which you need additional information.

Shopware 6 CLI Commands

Below, you can find Shopware CLI commands divided into groups:

Group Name Shopware 6 CLI Commands Description
General about General information on the Shopware installation.
help General CLI help.
list All available Shopware CLI commands.
Cache cache:clear You can clear the cache with this Shopware CLI command.
cache:warmup Use this one to warm up the cache.
Dal dal:refresh:index This Shopware CLI command updates shop indexes. 
Database database:clean-personal-data “guests/carts” Use this command to remove either old guest accounts (guests) or canceled shopping carts (carts).
Debug debug:business-events This Shopware CLI command displays all business events with the information on the number of emails or logs they are used in.
Elasticsearch es:index Reindex the Elasticsearch entities with the help of this Shopware CLI command.
es:index:cleanup Use this command to remove old, unused Elasticsearch indexes.
HTTP http:cache:warm:up Warm up the HTTP cache with this command.
Media media:delete-unused With its help, you can remove unused media files.
media:generate-thumbnails Use this command to generate thumbnails if they are enabled in the album settings.
Messenger messenger:consume This command lets you process the entries of the messenger queue.
messenger:stop-workers Use this command to stop the processing after the currently executed message.
Plugin plugin:activate “pluginname”  Use this command to enable an installed plugin.
plugin:deactivate “pluginname”   Use this command to disable an installed plugin.
plugin:list  You can view plugin names and some additional information with it.
plugin:refresh This Shopware CLI command updates the plugin list.
Sales Channel sales-channel:list  With this command, you can get a list of sales channels with IDs.
sales-channel:maintenance:disable “sales channel ID”  Use this command to disable the maintenance mode for the sales channel.
sales-channel:maintenance:enable “sales channel ID”  Use this command to enable the maintenance mode for the sales channel.
Scheduled Tasks scheduled-task:run  You can execute the scheduled tasks with the help of this Shopware CLI command.
Sitemap sitemap:generate Use this command to generate a sitemap.
Theme theme:compile  Use this command to compile the current theme.
theme:create You can create a new, stand-alone theme with this CLI command. Use it for your template customisations.
User user:change-password “username”  Change the password of the admin user <username> with this Shopware CLI command.
user:create “username” Create a new admin user with the name specified as <username>.

Final Words

Using CLI commands in Shopware 6 is simple. Proceed to the Shopware installation directory and use the commands mentioned in the table above with the general command form. Don’t forget that you can also use Shopware 6 CLI commands with our Improved Import, Export & Mass Actions plugin. Follow this link for more information:

Get Improved Import, Export & Mass Actions for Shopware

Explore Shopware