Console commands

Edit on GitHub

The list of console commands contains the command names together with a short description of what the command does. The most important commands in Spryker can be split into four categories: collector commands, order management system commands, setup commands, and frontend-related commands. This document provides details about each of the commands.

Collector commands

Collector commands are responsible for exporting the data in the SQL database to the frontend data storages (Redis and Elasticsearch):

  • collector:search:export—exports data to the Elasticsearch storage.
  • collector:search:update—updates the data in the Elasticsearch storage.
  • collector:storage:export—exports data to Key-Value storage (Redis).

Order Management System commands

Check whether conditions are satisfied for the orders that are in the state that is the source state for the transition that has a condition attached.

console oms:check-condition

Options:

  • -s, --store=store—filters by the given store.
  • -l, --limit=limit—limits the number of orders.

Examples:

$ console oms:check-condition -s DE
$ console oms:check-condition --limit=100 --store=DE

Check whether the timeout was reached for the orders that are in the state that is the source state for the transition that has a timeout attached.

console oms:check-timeout

Options:

  • -s, --store=store—filter by the given store
  • -l, --limit=limit—limit the number of orders

Examples:

$ console oms:check-timeout --store=DE --limit=100
$ console oms:check-timeout -l 100

Installation setup commands

  • The following command runs a set of commands necessary for installing or updating the application.
setup:install

The following steps are performed when running this command:

  1. Delete all cache files for all stores:
cache:delete-all
  1. Remove the directory that contains the generated files, such as transfer classes, merged database schema XML files, or autocompletion classes:
setup:remove-generated-directory
  1. Create or migrate the database:
setup:propel
  1. Generate transfer classes for each of the objects defined in the XML transfer files:
transfer:generate
  1. Initialize the database with required data:
setup:init-db
  1. Generate IDE auto-completion files to activate navigation to referenced classes. Generated auto-completion classes can be found for each application under the generated folder.
dev:ide:generate-auto-completion
  1. Build the project resources for Yves and Zed.
  2. Build the navigation tree.
application:build-navigation-tree

Each of the commands contained in the previous steps can also be executed individually.

  • Insert demo data into the database for testing reasons.
setup:install:demo-data
  • Setup propel command runs a set of commands, necessary for creating or migrating the database.
setup:propel

The following steps are performed when running this command:

  1. Write propel configuration:
setup:propel:config:convert
  1. Create the database if it doesn’t exist yet, based on the configuration set in the previous step:
setup:propel:database:create
  1. Ensure compatibility with PostgreSQL, if necessary, by adjusting the Propel XML schema files:
setup:propel:pg-sql-compat
  1. Copy schema files from Spryker and project packages to the generated folder:
setup:propel:schema:copy
  1. Build Propel classes based on the XML schema files:
setup:propel:model:build
  1. Compare the propel models with the database tables and generate the diff to prepare for migration:
setup:propel:diff
  1. Migrate the database: update the database so that’s in sync with the propel models in the project:
setup:propel:migrate

Jenkins setup commands

Cron jobs are scheduled by using Jenkins. For setting up Jenkins, the following console commands can be used from the command line:

  • Start the Jenkins service:
scheduler:resume
  • Shut down the Jenkins service:
scheduler:suspend
  • Set up the cron jobs based on the definitions contained in the configuration file (the config file for jobs is placed in /config/Zed/cronjobs/jobs.php):
scheduler:setup
  • Clean Jenkins jobs:
scheduler:clean
Git Commands

Git commands are activated through console commands and they affect the Spryker packages.

Depending on your environment and needs, there is a number of commands you can run. The following table provides an overview of such commands.

To use the npm commands, download and install Node.js. The minimum version for Node.js is 18.x and for npm it is 9.x. Then, you can use the appropriate commands listed in the table.

ENVIRONMENT COMMAND DESCRIPTION LOCAL COMMAND DOCKER CLI COMMAND
Project/Core
Removes the entire content from the cache directories. console cache:empty-all
Executes your importers (full-import). console data:import
Imports all text translations for the core/project level. console data:import:glossary
Generates transfer objects from transfer XML definition files. console transfer:generate
Generates a cache file for the twig templates. console twig:cache:warmer
Yves Dependencies installation (from the project level). npm install console frontend:project:install-dependencies
Builds the core/project scripts, styles, fonts, and images to the public/Yves/assets folder. npm run yves console frontend:yves:build
Runs a build command every time the core/project scripts or style files change during the development. npm run yves:watch
Runs a production build which compresses and minifies the core/project scripts, styles, fonts, and images to the public/Yves/assets folder. npm run yves:production console frontend:yves:build –environment production
Zed Dependencies installation. Installs and packages all modules from the vendor/spryker (for the split version) and vendor/spryker/spryker (for the nonsplit version) folders. console frontend:project:install-dependencies
Builds Zed scripts, styles, fonts, and images to the public/Zed/assets folder. npm run zed console frontend:zed:build
Runs a build command every time when Zed scripts or style files change during the development. npm run zed:watch
Runs a production build which compresses and minifies Zed scripts, styles, fonts, and images to the public/Zed/assets folder. npm run zed:production console frontend:zed:build –environment production
Merchant Portal Dependencies installation. Installs and packages all modules from the vendor/spryker (for the split version) and vendor/spryker/spryker (for the nonsplit version) folders. console frontend:project:install-dependencies
Builds Merchant Portal scripts, styles, fonts, and images to the public/MerchantPortal/assets folder. npm run mp:build console frontend:mp:build
Runs a build command every time when Merchant Portal scripts or style files change during the development. npm run mp:build:watch
Runs a production build which compresses and minifies Merchant Portal scripts, styles, fonts, and images to the public/MerchantPortal/assets folder. npm run mp:build:production console frontend:mp:build –environment production
Legacy Demoshop Yves Dependencies installation (from the project level). npm install console frontend:project:install-dependencies
Builds the core/project scripts, styles, fonts, and images to the public/Yves/assets/default folder. npm run yves console frontend:yves:build
Runs a build command every time when the core/project scripts or style files change during the development. npm run yves:dev
Runs a production build which compresses and minifies the core/project scripts, styles, fonts, and images to the public/Yves/assets/default folder. npm run yves:prod console frontend:yves:build –environment production
Legacy Demoshop Zed Dependencies installation. Installs and packages all modules from the vendor/spryker (for the split version) and vendor/spryker/spryker (for the nonsplit version) folder. console frontend:project:install-dependencies
Builds Zed scripts, styles, fonts, and images to the public/Zed/assets folder. npm run zed console frontend:zed:build
Runs a build command every time Zed scripts or styles files change during development. npm run zed:dev
Runs a production build which compresses and minifies Zed scripts, styles, fonts, and images to the public/Zed/assets folder. npm run zed:prod