Shopware CLI

General

Shopware offers the possibility to execute some functions via the console. The so-called "CLI" commands can be executed outside of script limitations (example: script runtime of the server) and are therefore recommended when processing large amounts of data. These commands are executed directly in the server's console, e.g. an SSH connection can be used for this purpose. Under Windows, for example, the programme "PuTTY", which is available free of charge, can be used for this; MacOS and Linux users can establish an SSH connection directly in the terminal.

After you have established the SSH connection, change to the Shopware installation directory.
There you can execute the commands as follows

php bin/console <command>

In this article we will explain the most important commands in more detail.
You can obtain a list of all commands by entering


php bin/console list

You can access the general help page for the CLI commands via


php bin/console --help

to call up the command. There is also a separate help page for most commands. You can call this up via


php bin/console <command> --help

Overview of the most important commands

General

CommandDescription
aboutProvides general information about the Shopware installation
helpShows help information, can also be used in connection with another command. To do this, add a "--" before the help. See also in the first section General.
listLists all available commands

Cache

CommandDescription
cache:clearClears the cache
cache:warmupWarms up the cache

Dal

CommandDescription
dal:refresh:indexUpdates the shop indices

Database

CommandDescription
database:clean-personal-data "guests/carts"Removes old guest accounts (guests) or old, cancelled shopping baskets (carts).

Debug

CommandDescription
debug:business-eventsLists all business events with the information in how many mails or logs this is used.
CommandDescription
es:index(Re-)Indexes the Elasticsearch entities
es:index:cleanupRemoves old, unused Elasticsearch indexes

HTTP

CommandDescription
http:cache:warm:upWarms up the HTTP cache

Import-Export

CommandDescription
import-export:delete-expiredRemoves all expired import/export files
import:entityImports the entities

Media

CommandDescription
media:delete-unusedRemoves unused media files
media:generate-thumbnailsGenerates thumbnails for the files for which the thumbnails are active in the album settings.

Messenger

CommandDescription
messenger:consumeProcesses the entries of the messenger queue
messenger:stop-workersStops the processing of the messenger queue after the currently executed message.

Plugin

CommandDescription
plugin:activate "pluginname"Activates an installed plugin - the plugin name can be seen via the command plugin:list
plugin:deactivate "pluginname"Deactivates a plugin - the plugin name can be seen via the command plugin:list
plugin:listLists all plugins available in the system with some additional information
plugin:refreshUpdates the plugin list

Product export / Product-comparison

CommandDescription
product-export:generate "ID of the corresponding sales channel"Generates the product comparison - For this, the ID of the corresponding sales channel is required.

Sales channels

CommandDescription
sales-channel:listLists the existing sales channels with further information (e.g. ID)
sales-channel:maintenance:disable "ID of the corresponding sales channel"Deactivates the maintenance mode of the sales channel
sales-channel:maintenance:enable "ID of the corresponding sales channel"Activates the maintenance mode of the sales channel

Scheduled Tasks

CommandDescription
scheduled-task:runExecutes the scheduled tasks (planned tasks)

Sitemap

CommandDescription
sitemap:generateGenerates the sitemaps

Theme

CommandDescription
theme:compileCompiles the current theme
theme:createCreates a new, stand-alone theme that can be used as the basis for your own template customisations.

User

CommandDescription
user:change-password "username"Allows you to change the password of the admin user <username>.
user:create "username"Creates a new admin user with the name <username>.

Was this article helpful?