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 all CLI commands


General

Command

Description

about

Provides general information about the Shopware installation

completion

Dump the shell completion script

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

Administration

Command

Description

administration:delete-files-after-build

Deletes all uneccessary files of the administration after the build process.

App

Command

Description

app:activate

Activates an app

app:create

Creates an app skeleton

app:deactivate

Deactivates an app

app:install

Installs an app

app:refresh

[app:update] Refreshes an app

app:uninstall

Uninstalls an app

app:url-change:resolve

Resolves app url changes

app:validate

Validates an app

Assets

Command

Description

assets:install

Installs bundles web assets under a public web directory

Bundle

Command

Description

bundle:dump

[administration:dump:plugins|administration:dump:bundles] Dumps the bundle configuration for a plugin

Cache

Command

Description

cache:clear

Clear the cache

cache:pool:clear

Clear cache pools

cache:pool:delete

Delete an item from a cache pool

cache:pool:invalidate-tags

Invalidate cache tags for all or a specific pool

cache:pool:list

List available cache pools

cache:pool:prune

Prune cache pools

cache:warmup

Warm up an empty cache

Cart

Command

Description

cart:migrate

Migrate carts from redis to database

Changelog

Command

Description

changelog:change

Changes the changelog of a release

changelog:check

Checks the changelog for errors

changelog:create

Creates a changelog file

changelog:release

Creates a new changelog release

Commercial

To use the following CLI commands, the Commercial Plugin must be installed and active.

Command

Description

commercial:feature:disable

Disable a feature which is included in your plan

commercial:feature:enable

Enable a feature which is included in your plan

commercial:feature:list

List features included in your plan and their status

commercial:license:set

Set commercial licence host & key

commercial:license:update

Update commercial licence key

commercial:report-turnover

Reports the turnover of the specified timeframe

Config

Command

Description

config:dump-reference

Dump the default configuration for an extension

Customer

Command

Description

customer:delete-unused-guests

Delete unused guest customers

Dal

Command

Description

dal:create:entities

Creates the entity classes

dal:create:hydrators

Creates the hydrator classes

dal:create:schema

Creates the database schema

dal:refresh:index

Refreshes the index for a given entity

dal:validate

Validates the DAL definitions

Database

Command

Description

database:clean-personal-data

Cleans personal data from the database

database:create-migration

Creates a new migration file

database:migrate

Executes all migrations

database:migrate-destructive

Executes all migrations

database:refresh-migration

Refreshes the migration state

Debug

Command

Description

debug:autowiring

List classes/interfaces you can use for autowiring

debug:business-events

Dumps all business events

debug:config

Dump the current configuration for an extension

debug:container

Display current services for an application

debug:dotenv

Lists all dotenv files with variables and values

debug:event-dispatcher

Display configured listeners for an application

debug:messenger

List messages you can dispatch using the message buses

debug:router

Display current routes for an application

debug:translation

Display translation messages information

debug:twig

Show a list of twig functions, filters, globals and tests

debug:validator

Display validation constraints for classes

Docs

Command

Description

docs:app-system-events

Dump the app events

docs:generate-scripts-reference

Generate the script reference

Dotenv

Command

Description

dotenv:dump

Compiles .env files to .env.local.php

Command

Description

es:admin:index

Index the elasticsearch for the admin search

es:admin:reset

Reset Admin Elasticsearch indexing

es:admin:test

Allows you to test the admin search index

es:create:alias

Create the elasticsearch alias

es:index

Index all entities into elasticsearch

es:index:cleanup

Clean outdated indices

es:reset

Reset the elasticsearch index

es:status

Show the status of the elasticsearch index

es:test:analyzer

Test the elasticsearch analyzer

Feature

Command

Description

feature:dump

[administration:dump:features|administration:dump:features] Dumps all features

Framework

Command

Description

framework:demodata

Generates demo data

framework:dump:class:schema

Dumps the schema of the given entity

framework:schema

Dumps the schema of the given entity

HTTP

Command

Description

http:cache:warm:up

Warm up the http cache

Import

Command

Description

import:entity

Import entities from a csv file

Import-Export

Command

Description

import-export:delete-expired

Deletes expired files

Lint

Command

Description

lint:container

Ensure that arguments injected into services match type declarations

lint:twig

Lint a Twig template and outputs encountered errors

lint:xliff

Lint an XLIFF file and outputs encountered errors

lint:yaml

Lint a YAML file and outputs encountered errors

Mailer

Command

Description

mailer:test

Test Mailer transports by sending an email

Media

Command

Description

media:delete-unused

Deletes all media files which are not used in any entity

media:generate-media-types

Generates media types for all media files

media:generate-thumbnails

Generates thumbnails for all media files

Messenger

Command

Description

messenger:consume

Consume messages

messenger:failed:remove

Remove given messages from the failure transport

messenger:failed:retry

Retry one or more messages from the failure transport

messenger:failed:show

Show one or more messages from the failure transport

messenger:setup-transports

Prepare the required infrastructure for the transport

messenger:status

Show the message count for one or more transports

messenger:stop-workers

Stop workers after their current message

Migration

Command

Description

migration:migrate basicSettingsMigrate basic settings and categories
migration:migrate cmsMigrate CMS layouts
migration:migrate customersOrdersMigrate all customers, orders and documents
migration:migrate mediaMigrate all media and folders
migration:migrate newsletterRecipientMigrate newsletter recipients
migration:migrate productsMigrate all product data and assiciated entities (associated entities from "media" included)
migration:migrate productReviewsMigrate product reviews
migration:migrate promotionsMigrate promotions
migration:migrate seoUrlsMigrate SEO URLs
migration:migrate customerWishlistsMigrate wishlists

In version 13.0.0 of the Migration Assistant, the CLI commands were adjusted. For more details on this and about migrating large data sets via the console, you can learn more here.

Number-range

Command

Description

number-range:migrate

Migrate the increment storage of a number range

Plugin

Command

Description

plugin:activate

Activate a plugin

plugin:create

Creates a new plugin

plugin:deactivate

Deactivates a plugin

plugin:install

Installs a plugin

plugin:list

Lists all plugins

plugin:refresh

Refreshes the plugin list

plugin:uninstall

Uninstall a plugin

plugin:update

Updates a plugin

plugin:zip-import

Imports a plugin from a zip file

Product-export

Command

Description

product-export:generate

Generates a product export file

Router

Command

Description

router:match

Help debug routes by simulating a path info match

S3

Command

Description

s3:set-visibility

Sets the visibility of all files in the s3 filesystem to public

Sales-channel

Command

Description

sales-channel:create

Creates a new sales channel

sales-channel:create:storefront

Creates a new storefront sales channel

sales-channel:list

Lists all sales channels

sales-channel:maintenance:disable

Disable maintenance mode for a sales channel

sales-channel:maintenance:enable

Enable maintenance mode for a sales channel

sales-channel:update:domain

Updates a sales channel domain

Scheduled Tasks

Command

Description

scheduled-task:register

Registers all scheduled tasks

scheduled-task:run

Runs scheduled tasks

Secrets

Command

Description

secrets:decrypt-to-local

Decrypt all secrets and stores them in the local vault

secrets:encrypt-from-local

Encrypt all local secrets to the vault

secrets:generate-keys

Generate new encryption keys

secrets:list

List all secrets

secrets:remove

Remove a secret from the vault

secrets:set

Set a secret in the vault

Sitemap

Command

Description

sitemap:generate

Generates sitemap files

Snippets

Command

Description

snippets:validate

Validates snippets

State-Machine

Command

Description

state-machine:dump

Dumps a state machine to a graphviz file

Store

Command

Description

store:download

Downloads a plugin from the store

store:login

Login to the store

Sync

Command

Description

sync:composer:version

Syncs the composer version with the shopware version

System

Command

Description

system:config:get

Get a config value

system:config:set

Set a config value

system:configure-shop

Configure shop

system:generate-app-secret

Generates a new app secret

system:generate-jwt-secret

Generates a new JWT secret

system:install

Installs the Shopware 6 system

system:setup

Setup the system

system:update:finish

Finishes the update process

system:update:prepare

Prepares the update process

Theme

Command

Description

theme:change

Change the active theme for a sales channel

theme:compile

Compile the theme

theme:create

Create a new theme

theme:dump

Dump the theme configuration

theme:prepare-icons

Prepare the theme icons

theme:refresh

Refresh the theme configuration

Translation

Command

Description

translation:extract

Extract missing translations keys from code to translation files.

translation:pull

Pull translations from a given provider.

translation:push

Push translations to a given provider.

User

Command

Description

user:change-password

Change the password of a user

user:create

Creates a new user

Was this article helpful?