Sylius CLI Commands
Sylius provides several CLI commands in the sylius namespace. This page introduces the available commands and explains their usage.
List available commands
Because Sylius is built on Symfony, it provides the same CLI commands. Run them from your project root with ./bin/console.
You can display the available Sylius-specific commands by listing all commands and grepping for “sylius” with ./bin/console list | grep sylius
sylius
sylius:admin-user:change-password Change password of admin user
sylius:admin-user:create Create a new admin user
sylius:cancel-unpaid-orders Removes order that have been unpaid for a configured period. Configuration parameter - sylius_order.order_expiration_period.
sylius:debug:grid Debug grid configuration
sylius:debug:mailer Debug email messages
sylius:debug:resource Debug resource metadata.
sylius:fixtures:list Lists available fixtures
sylius:fixtures:load Loads fixtures from given suite
sylius:inform-about-gus Informs about Sylius internal statistical service.
sylius:install Installs Sylius in your preferred environment.
sylius:install:assets Installs all Sylius assets.
sylius:install:check-requirements Checks if all Sylius requirements are satisfied.
sylius:install:database Install Sylius database.
sylius:install:jwt-setup Setup JWT token.
sylius:install:sample-data Install sample data into Sylius.
sylius:install:setup Sylius configuration setup.
sylius:payment:generate-key Generate a key for Sylius payment encryption.
sylius:price-history:clear Clears the price history up to a given number of days ago
sylius:promotion:generate-coupons Generates coupons for a given promotion
sylius:remove-expired-carts Removes carts that have been idle for a period set in `sylius_order.expiration.cart` configuration key.
sylius:show-plus-info Shows information about Sylius Plus and Sylius Store
sylius:theme:assets:install Installs themes web assets under a public web directory
sylius:theme:list Shows list of detected themes.
sylius:user:demote Demotes a user by removing a role.
sylius:user:promote Promotes a user by adding roles.sylius:admin-user:change-password
Description
Changes the password for an administrator account for the sylius admin.
Usage
You will then be prompted to enter the email address of the admin account and the new password.
sylius:admin-user:create
Description
Creates a new admin user for the Sylius admin.
Usage
You will then be prompted for the email address, first name, last name, password, locale code, and whether to enable the admin account.
sylius:cancel-unpaid-orders
Description
Removes order that have been unpaid for a configured period. Configuration parameter - sylius_order.order_expiration_period.
Usage
sylius:debug:grid
Description
Debug grid configuration.
Usage
If no argument for the grid is given, all configured grids will be shown.
Arguments
grid
The name or fully-qualified class name (FQCN) of the grid to debug
name example: sylius_admin_product FQCN example: App\Grid\SupplierGrid
Output
If no argument is specified, it will output a list with all configured grids that are available.
Example Output
In this example we output the grid configuration for the sylius_admin_currency grid.
sylius:debug:mailer
Description
Debug email messages.
Usage
If no argument for the email code is given, all configured email messages will be shown.
Arguments
codeOfEmail
Expected email to be shown identified by its code
admin_password_reset
Output
sylius:debug:resource
Description
Debug resource metadata.
Usage
If no argument is given, the list of all project resources will be provided.
When a resource is given, it outputs metadata specific to that resource.
Arguments
resource
Resource to debug
sylius.admin_user
operation
Operation to debug
-
Output
This is the output without any arguments specified.
Example output
In this example we output the resource metadata of sylius.currency
sylius:fixtures:list
Description
Lists available fixtures.
Usage
Output
sylius:fixtures:load
Description
Load a fixture from the given suite. The default suite name is default .
Usage
sylius:inform-about-gus
Description
Informs about Sylius internal statistical service.
Usage
sylius:install
Description
Installs Sylius in your preferred environment.
Usage
This command executes several commands in sequence. However, each of these commands can also be executed individually:
sylius:install:assetssylius:install:check-requirementssylius:install:databasesylius:install:jwt-setupsylius:install:sample-datasylius:install:setup
sylius:install:assets
Description
Downloads and installs all Sylius media assets.
Usage
sylius:install:check-requirements
Description
Checks the system requirements to make sure that Sylius can be installed properly.
Usage
sylius:install:database
Description
Install the Sylius database.
Usage
sylius:install:jwt-setup
Description
Generates a JSON Web Token. The JWT is used for authentication with the Sylius API and should be sent as a Bearer token in the Authorization header of each request.
Usage
sylius:install:sample-data
Description
Installs sample data into Sylius.
Usage
sylius:install:setup
Description
Configures basic Sylius data setup.
Usage
sylius:payment:generate-key
Description
Generates a key for Sylius payment encryption.
Usage
It will ask you if you want to overwrite the existing key.
sylius:price-history:clear
Description
Clears the price history for entries older than the specified number of days.
Usage
Arguments
days
Number of days ago
5
sylius:promotion:generate-coupons
Description
Generates coupons for a given promotion.
Usage
Arguments
promotion-code
Code of the promotion
CHRISTMAS_SALE
count
Amount of coupons to generate
5
sylius:remove-expired-carts
Description
Removes carts idle beyond the duration set in the sylius_order.expiration.cart config key.
Usage
sylius:show-plus-info
Description
Shows information about Sylius Plus and Sylius Store.
Usage
Output
sylius:theme:assets:install
Description
Installs themes web assets under a public web directory.
Usage
Help
sylius:theme:list
Description
Shows list of detected themes.
Usage
sylius:user:demote
Description
Demotes a user by removing roles.
Usage
The command will ask you to choose a user type: admin or shop user. It then asks for two arguments: the email and the roles.
Arguments
roles
Security roles
ROLE_API_ACCESS, ROLE_ADMINISTRATION_ACCESS
sylius:user:promote
Description
Promotes a user by adding roles.
Usage
The command will ask you to choose a user type: admin or shop user. It then asks for two arguments: the email and the roles.
Arguments
roles
Security roles
ROLE_USER
Last updated
Was this helpful?
