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 CLI commands explained and divided into groups. Other Shopware 6 tutorials and guides are available in our cookbook.
Table of contents
- 1 General Recommendations
- 2 Important Shopware CLI Commands
- 3 Shopware 6 Essentials FAQ
- 3.1 How to create a Shopware account?
- 3.2 What about a Shopware ID?
- 3.3 What is Shopware master data?
- 3.4 How to add a new Shopware shop?
- 3.5 How to add a payment method to your Shopware account?
- 3.6 How to create a deposit in Shopware?
- 3.7 How to purchase Shopware extensions?
- 3.8 How to get support in Shopware?
- 3.9 How to automate import and export processes in Shopware 6?
- 3.10 How to migrate to Shopware 6?
- 3.11 How to integrate Shopware 6 with external systems?
You can dramatically simplify your interaction with Shopware via console. Shopware provides the ability to execute some functions with the help of “CLI” commands that can be executed outside of script limitations. Furthermore, there are situations when you should use them, such as the necessity to process large amounts of data.
You execute Shopware CLI commands directly in the server’s console. Since you need an SSH connection for that, it is necessary to take care of additional prerequisites. For instance, Windows requires apps like “PuTTY” to establish an SSH connection while macOS and Linux provide the same opportunity directly in the terminal.
Now, 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:
php bin/console <command>
To obtain the list of all Shopware CLI commands, enter the following one:
php bin/console list
Also, it is possible to access the help page for Shopware CLI commands. Use this command:
php bin/console --help
In addition, you will find a separate help page for most Shopware CLI commands. Use this command to call it up:
php bin/console <command> --help
Don’t forget to replace <command> with a particular Shopware CLI command for which you need additional information.
Important Shopware CLI Commands
Below, you will find Shopware CLI commands divided into the following groups:
- Product Comparison;
- Sales Channel;
- about – general information on the Shopware installation;
- help – general CLI help;
- list – all available Shopware CLI commands;
- cache:clear – you can clear cache with this Shopware CLI command;
- cache:warmup – use this one to warm up the cache;
- dal:refresh:index – this Shopware CLI command updates shop indexes;
- database:clean-personal-data “guests/carts” – use this command to remove either old guest accounts (guests) or canceled shopping carts (carts);
- debug:business-events – this Shopware CLI command displays all business events with the information on the number of mails or logs they are used in;
- 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:cache:warm:up – warm up the HTTP cache with this command;
- 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: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: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;
- plugin:refresh – this Shopware CLI command updates the plugin list;
- product-export:generate “sales channel ID” – with this command, you can generate a product comparison for the corresponding 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-task:run – you can execute the scheduled tasks with the help of this Shopware CLI command;
- sitemap:generate – use this command to generate a sitemap;
- 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: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>.
Shopware 6 Essentials FAQ
How to create a Shopware account?
Without a Shopware account, you won’t get access to a Shopware installation, and, consequently, won’t be able to apply CLI commands to it. You can create a Shopware account as follows: visit the registration page, hit the Register Now link, and fill in the form to create a new account. After receiving a confirmation email, follow the instructions provided in it.
What about a Shopware ID?
You will get your Shopware ID upon registration. There is no need to take additional actions.
What is Shopware master data?
Shopware requires a bunch of data to be provided upon registration. All the information related to your company and business, including physical addresses, phone numbers, and emails, is called master data.
How to add a new Shopware shop?
You need to create a Shopware shop to apply CLI commands to it. It is possible to connect a website to your account in your merchant area. Click the corresponding link, choose the type of your new shop (a cloud storefront or an on-premise installation), and provide all the information the system requires.
How to add a payment method to your Shopware account?
As you’ve probably noticed, some of the commands mentioned above are related to extensions and themes. However, you need to purchase them to be able to apply these commands. And an internal payment method is required. You can add it under Basic Information -> Accounting. Select PayPal, credit card, or direct debit as a way to transfer funds to your account.
How to create a deposit in Shopware?
With a working payment method, you can p[roceed to purchasing extensions and themes. Your first step is to create a deposit that covers the amount of your purchase. Go to your Merchant Area -> Shops, choose a shop to provide funds to, click Open Account Details, and initiate the money transfer.
How to purchase Shopware extensions?
With the necessary amount of money on your account, you can open the Plugin Manager or visit the Shopware Marketplace to purchase extensions and themes. Select a tool you want to buy and complete the checkout.
How to get support in Shopware?
Shopware accepts license inquiries here: firstname.lastname@example.org or call +49 2555 9288 50. If you deal with issues associated with accounting or have financial inquiries, use these support channels: email@example.com and +49 2555 9288 510.
How to automate import and export processes in Shopware 6?
If you deal with recurring data transfers, pay heed to the Improved Import, Export & Mass Actions extension. It will help you automate them. The module provides the ability to create schedules so that the corresponding import and export processes are launched automatically. If the transferred data is provided by external systems, you can use mapping to edit files automatically according to the Shopware standards.
How to migrate to Shopware 6?
Also, you can use the Improved Import, Export & Mass Actions extension to migrate to Shopware 6. The tool can help you migrate from other e-commerce systems or Shopware’s previous versions. Note that we also offer export solutions for systems like Magento, so you can simplify your data transfers between them and Shopware.
How to integrate Shopware 6 with external systems?
You can also use the Improved Import, Export & Mass Actions plugin to connect Shopware 6 to ERPs, CRMs, accounting tools, and other similar platforms. Our module can help you automate repetitive import and export processes. Besides, the Improved Import, Export & Mass Actions plugin introduces mapping presets to help you modify data according to the Shopware requirements during import and follow the rules of the connected platform during export.