Skip to content

Command Types

Command Types

Shopware CLI is organized into three main command scopes that cover the most common development and maintenance workflows:

  • Project commands: interact with your Shopware project (e.g., build, dump DB, or sync configuration)
  • Extension commands: build and validate Shopware extensions
  • Store commands: publish or update extensions in the Shopware Store

Automatic refactoring

Shopware CLI also includes an automatic refactoring tool for PHP, JavaScript, and Admin Twig files. It uses:

  • Rector for PHP
  • ESLint for JavaScript
  • Custom rules for Admin Twig

You can run it on an extension or a full project:

bash
# Example: refactor an extension
shopware-cli extension fix /path/to/your/extension

# Example: refactor an entire project
shopware-cli project fix /path/to/your/project

Always back up or version your code before running refactoring commands, as they will modify files in place. Learn more here.

Project commands

Work directly with your Shopware project to automate setup and maintenance tasks. Available commands include:

bash
shopware-cli project create         # Create a new Shopware 6 project
shopware-cli project dump       # Dumps the Shopware database
shopware-cli project ci          # Build Shopware in the CI

Extension commands

Create, build, and validate Shopware extensions and prepare them for the Shopware Store or for distribution. Available commands include:

bash
shopware-cli extension fix   # Fix an extension
shopware-cli extension build    # Builds assets for extensions
shopware-cli extension validate         # Validate an extension

Store commands

Publish and manage your extensions in the Store, with commands such as:

bash
shopware-cli account login    # Log in to the Shopware Store (account.shopware.com)
shopware-cli token            # Manage tokens for Store authentication

Run any command with --help to see its available options. Example: shopware-cli extension --help

Was this page helpful?
UnsatisfiedSatisfied
Be the first to vote!
0.0 / 5  (0 votes)