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
Command | Description |
---|
about | Provides general information about the Shopware installation |
help | Shows 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. |
list | Lists all available commands |
Cache
Command | Description |
---|
cache:clear | Clears the cache |
cache:warmup | Warms up the cache |
Dal
Command | Description |
---|
dal:refresh:index | Updates the shop indices |
Database
Command | Description |
---|
database:clean-personal-data "guests/carts" | Removes old guest accounts (guests) or old, cancelled shopping baskets (carts). |
Debug
Command | Description |
---|
debug:business-events | Lists all business events with the information in how many mails or logs this is used. |
ES (Elastic Search)
Command | Description |
---|
es:index | (Re-)Indexes the Elasticsearch entities |
es:index:cleanup | Removes old, unused Elasticsearch indexes |
HTTP
Command | Description |
---|
http:cache:warm:up | Warms up the HTTP cache |
Import-Export
Command | Description |
---|
import-export:delete-expired | Removes all expired import/export files |
import:entity | Imports the entities |
Command | Description |
---|
media:delete-unused | Removes unused media files |
media:generate-thumbnails | Generates thumbnails for the files for which the thumbnails are active in the album settings. |
Messenger
Command | Description |
---|
messenger:consume | Processes the entries of the messenger queue |
messenger:stop-workers | Stops the processing of the messenger queue after the currently executed message. |
Plugin
Command | Description |
---|
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:list | Lists all plugins available in the system with some additional information |
plugin:refresh | Updates the plugin list |
Product export / Product-comparison
Command | Description |
---|
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
Command | Description |
---|
sales-channel:list | Lists 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
Command | Description |
---|
scheduled-task:run | Executes the scheduled tasks (planned tasks) |
Sitemap
Command | Description |
---|
sitemap:generate | Generates the sitemaps |
Theme
Command | Description |
---|
theme:compile | Compiles the current theme |
theme:create | Creates a new, stand-alone theme that can be used as the basis for your own template customisations. |
User
Command | Description |
---|
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?