PHPackages                             shopwarelabs/sw-cli-tools - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. shopwarelabs/sw-cli-tools

ActiveProject[CLI &amp; Console](/categories/cli)

shopwarelabs/sw-cli-tools
=========================

A CLI toolset for shopware

0.5.3(2y ago)843.2k51[8 issues](https://github.com/shopwareLabs/sw-cli-tools/issues)MITPHPPHP ^7.4 || ^8.0CI passing

Since May 15Pushed 3mo ago39 watchersCompare

[ Source](https://github.com/shopwareLabs/sw-cli-tools)[ Packagist](https://packagist.org/packages/shopwarelabs/sw-cli-tools)[ RSS](/packages/shopwarelabs-sw-cli-tools/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (14)Versions (13)Used By (0)

Shopware CLI Tools
==================

[](#shopware-cli-tools)

[![Build Status](https://github.com/shopwareLabs/sw-cli-tools/actions/workflows/test.yml/badge.svg)](https://github.com/shopwareLabs/sw-cli-tools/actions/workflows/test.yml)[![License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

The shopware CLI tools are your console helpers for all kind of Shopware tasks. They will allow you to:

- setup Shopware from VCS
- setup Shopware from a release tag
- create Shopware plugins
- define a bunch of plugin repositories you use
- install plugins from the repositories and activate them in shopware
- zip plugins in the way the Shopware store or the Shopware plugin manager expect it to be

The shopware CLI tools come with a slim extension interface, so you can extend it for your needs.

This is an **early development preview** - so don't expect it to be stable. Please wait for a 1.0.0 stable release before using this tools for production deployments

Pull requests are very welcome as well as ideas for possible extensions.

Support
=======

[](#support)

Use at your own risk, there is no support for this tools.

Install
=======

[](#install)

Generally we recommend to use the sw.phar release files, you can download them to e.g. ~/bin/sw and add this directory to the $PATH of your local user (download current build from ).

If you want to use the development version of sw-cli-tools, you should checkout the repository and run `composer install` to download all dependencies

Requirements
------------

[](#requirements)

On your system at least the following packages needs to be available.

- openjdk-7-jre-headless
- ant
- git
- curl
- php7-curl
- If you want to use coloring you should enable php.posix in your php.ini

Available commands
------------------

[](#available-commands)

- sw cache:clear
- sw install:vcs
- sw install:release
- sw plugin:install
- sw plugin:zip:dir
- sw plugin:zip:vcs
- sw plugin:create
- sw generate

Using the Commands
------------------

[](#using-the-commands)

### sw plugin:install

[](#sw-plugininstall)

Will install a plugin from one of the configured repos

Valid options/arguments are:

```
--useHttp: use HTTP for checkout if possible (e.g. for VPN, SSH seems to be slow here sometimes)
--small: Show 3 columns of plugins in a short form
--shopware-root Shopware root directory
--branch branch to checkout out
names1…nameN - names of plugins to install

```

This command will automatically create a VCS mapping for phpstorm if `.idea/vcs.xml` can be found. You will need to refresh you config with File-&gt;Sychronize (Control+Alt+Y)

### sw plugin:zip:vcs

[](#sw-pluginzipvcs)

Will checkout a plugin from VCS and zip it properly for the store

Valid options/arguments are:

```
--useHttp: use HTTP for checkout if possible (e.g. for VPN, SSH seems to be slow here sometimes)
--small: Show 3 columns of plugins in a short form
--branch branch to checkout out
names1…nameN - names of plugins to zip

```

If the plugins contains a file in its root named `.sw-zip-blacklist`, the files/directories described there, will be excluded from zipping

### sw plugin:zip:dir

[](#sw-pluginzipdir)

Will zip the given plugin directory. DIRECTORY must point to the directory where the plugin bootstrap can be found.

### sw install:vcs

[](#sw-installvcs)

Checkout the latest shopware version from vcs (for development)

Valid options/arguments are:

```
--branch: The branch to checkout
--databaseName: Name of the database to use
--installDir: Where to install shopware
--user: Github user name. If provided, the checkout will be done via HTTP

```

The options will be read interactively, if not provided The database credentials are configured in ~/.config/sw-cli-tools/config.yaml

### sw install:release

[](#sw-installrelease)

```
--release=RELEASE                Release version. Default: Latest. Possible are all shopware release versions like "4.2.0"
--install-dir[=INSTALL-DIR]      Install directory
--unpack-only                    Only unpack the downloaded release
--skip-download                  Skip release downloading
--db-host=DB-HOST                Database host [default: "localhost"]
--db-port=DB-PORT                Database port [default: "3306"]
--db-socket=DB-SOCKET            Database socket
--db-user=DB-USER                Database user
--db-password=DB-PASSWORD        Database password
--db-name=DB-NAME                Database name
--shop-locale=SHOP-LOCALE        Shop locale [default: "de_DE"]
--shop-host=SHOP-HOST            Shop host [default: "localhost"]
--shop-path=SHOP-PATH            Shop path [default: "/"]
--shop-name=SHOP-NAME            Shop name [default: "Demo shop"]
--shop-email=SHOP-EMAIL          Shop email address [default: "your.email@shop.com"]
--shop-currency=SHOP-CURRENCY    Shop currency [default: "EUR"]
--admin-username=ADMIN-USERNAME  Administrator username [default: "demo"]
--admin-password=ADMIN-PASSWORD  Administrator password [default: "demo"]
--admin-email=ADMIN-EMAIL        Administrator email address [default: "demo@demo.demo"]
--admin-locale=ADMIN-LOCALE      Administrator locale [default: "de_DE"]
--admin-name=ADMIN-NAME          Administrator name [default: "Demo user"]

```

### sw plugin:create

[](#sw-plugincreate)

Will create a Shopware plugin with all the boilerplate code. If the command will be executed from the shopware root folder the plugins will be placed in the plugin folder, otherwise it will be created in the same directory.

Valid options / arguments are:

```
--legacy: Create a legacy Plugin for Shopware versions lower than 5.2
--namespace[="..."]: Namespace of the plugin, default: Frontend
--haveBackend: Generate a backend Controller + a simple ExtJS module
--backendModel[="..."]: The name of the model for your backend application
--haveFilter: Generate Condition/Facet/CriteriaRequestHandler in order to add a new filter in the frontend
--haveFrontend | -f: Generate a frontend controller
--haveModels | -m: Generate a simple doctrine model
--haveCommands | -c: Generate a console command
--haveWidget | -w: Generate a backend widget
--haveApi | -a: Generate an API resource + REST controller
--licenseHeader[="/home/user/license.txt"]: Include a license header file at the beginning of any file name: Name of your plugin. Must at least have a dev prefix + plugin name, e.g. "SwagBundle", "PrefixPluginName"; "SwagBrowserLanguageDetection"
--haveElasticSearch | -e: Generate ElasticSearch blueprint classes and an example of a decorator for the product number search.

```

The options will be read interactively, if not provided. The database credentials are configured in ~/.config/sw-cli-tools/config.yaml

### sw generate

[](#sw-generate)

Will generate data which can be used to fill the shop for e.g. load tests.

!Warning! this command is destructive

Valid options / arguments are:

```
 -a, --articles[=ARTICLES]                          Number of articles to create
     --articleFilterGroups[=ARTICLEFILTERGROUPS]    Number article filter option groups to create
     --articleFilterOptions[=ARTICLEFILTEROPTIONS]  Number article filter options to create
     --articleFilterValues[=ARTICLEFILTERVALUES]    Number article filter values to create per each filter option
 -o, --orders[=ORDERS]                              Number of orders to create
 -c, --categories[=CATEGORIES]                      Number of categories to create
     --categoriesPerArticle[=CATEGORIESPERARTICLE]  Number of categories to assign to each article
 -e, --newsletter[=NEWSLETTER]                      Number of newsletter to create
 -u, --customers[=CUSTOMERS]                        Number of customers to create
     --vouchers[=VOUCHERS]                          Number of vouchers to create
     --chunk-size[=CHUNK-SIZE]                      Chung size
 -s, --seed[=SEED]                                  Random seed
     --installDir[=INSTALLDIR]                      Your Shopware installation path. If provided, data will be automatically injected into the configured database. [default: ""]
 -n, --no-interaction                               Do not ask any interactive question

```

If executed from a Shopware installation, or if 'installDir' is provided, the data will be automatically written into your Shopware database. Otherwise, data will be exported to individual files in the '\\output' folder You need to import the .sql files in the order in which they are generated (see the command output)

Requires 'local-infile=1' in your MySQL installation.

Extending the cli tools
=======================

[](#extending-the-cli-tools)

New Extensions
--------------

[](#new-extensions)

Extensions are created in the `/home/USER/.config/sw-cli-tools/extensions` folder and consist of a vendor folder, the extension folder (with the extension's name) and a `Bootstrap.php` inside the extension folder. Additionally you can provide an own `config.yaml` inside the extension folder which will extend the default `config.yaml`.

The namespace of your extension bootstrap should be `VENDOR_FOLDER\EXTENSION_FOLDER\Bootstrap`.

### Bootstrap

[](#bootstrap)

The bootstrap is the main entry point of your extension. If it implements `ContainerAwareExtension`, it will get the container builder of the application injected via setContainer. This way the container can be extended by your extension. Additionally the Bootstrap can implement `ConsoleAwareExtension`. If this is the case, the method "getConsoleCommands" will be called after creation - please return an array of console command instances here. Finally the extension will call the `getRepositories` method of extensions implementing `RepositoryAwareInterface`.

### Changing existing components

[](#changing-existing-components)

As you Bootstrap.php is instantiated after the container, you can replace any service of the container

Paths
=====

[](#paths)

The SW cli tools make use of the XDG directory standard. Following directories are used:

```
~/.config/sw-cli-tools: Here the main configuration as well as the extensions are stored
~/.cache/sw-cli-tools: Here caches (like repo content) as well as release downloads are cached
~/.local/share/sw-cli-tools: Assets the demo data package are stored here

```

If you changed some of these directories via `XDG` environment variables, those directories are used instead

Configuration
=============

[](#configuration)

The configuration of the script is done in `~/.config/sw-cli-tools/config.yaml`. If the file does not exist on your system, it is created after the first usage of the script.

Repositories
------------

[](#repositories)

In order to use commands like `plugin:zip:vcs` the tool needs to know where the source comes from. For this repositories need to be defined in the `repositories` section of the configuration file. For now the following repository types are supported:

- GitHub
- Stash
- BitBucket
- SimpleList
- GitLab

This is how an example config could look like:

```
repositories:
  GitLab:
    config:
      endpoint: https://gitlab.shopware.com/api/v4/
    repositories:
      Services SW5:
        cache: 86400
        url: groups/92/projects?per_page=100&private_token=your-private-token
        color: red
  GitHub:
    config:
      endpoint: https://api.github.com/search/
    repositories:
      Plugins SW5:
        cache: 86400
        url: repositories?q=org:Shopware5+topic:shopware-plugin
        color: blue
```

Building sw.phar
================

[](#building-swphar)

For building the release package (`sw.phar`) [box](http://box-project.github.io/box2/) is used. A new release is build automatically for every push on the master branch by Travis CI (See `bin/deploy.sh`).

Coding standard
===============

[](#coding-standard)

Coding standard for the project is [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md). Coding standard violations may be detected using php-cs-fixer:

```
./vendor/bin/php-cs-fixer fix -v --level=psr2 ./src
./vendor/bin/php-cs-fixer fix -v --level=psr2 ./tests

```

General hints
=============

[](#general-hints)

Timeouts
--------

[](#timeouts)

If you are having a slow internet connection and e.g. git checkouts or tasks related to the `ProcessExecutor` fail with a timeout, you can increase the timeout by setting the environment variable `SW_TIMEOUT`:

```
SW_TIMEOUT=500 sw install:vcs

```

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance52

Moderate activity, may be stable

Popularity34

Limited adoption so far

Community34

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~168 days

Recently: every ~73 days

Total

12

Last Release

1061d ago

PHP version history (4 changes)0.0.1PHP &gt;=5.5.0

0.2.0PHP &gt;=7.2.0

0.4.0PHP ^7.3

0.5.0PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/3e33c241de9be12145b80356591da2a7b875f1111d77a8f0a5474f55f02c91c1?d=identicon)[dnoegel](/maintainers/dnoegel)

![](https://www.gravatar.com/avatar/7c45ef9077b73fce78afbfab2fa27e611a453dd77de003e2785ac84105d02bef?d=identicon)[shyim](/maintainers/shyim)

![](https://www.gravatar.com/avatar/87bec78135aee2ab0f6ca5c7a0aae17966d8bfec3f873a81932fa65cf6621a20?d=identicon)[janbuecker](/maintainers/janbuecker)

![](https://www.gravatar.com/avatar/f77b2e916b6e203e637b07a5eb8aeb7ac7c9df422846273996d348d6804aec12?d=identicon)[keulinho](/maintainers/keulinho)

---

Top Contributors

[![dnoegel](https://avatars.githubusercontent.com/u/1114384?v=4)](https://github.com/dnoegel "dnoegel (190 commits)")[![bcremer](https://avatars.githubusercontent.com/u/55820?v=4)](https://github.com/bcremer "bcremer (118 commits)")[![mitelg](https://avatars.githubusercontent.com/u/6985627?v=4)](https://github.com/mitelg "mitelg (111 commits)")[![teiling88](https://avatars.githubusercontent.com/u/4624237?v=4)](https://github.com/teiling88 "teiling88 (8 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (8 commits)")[![shyim](https://avatars.githubusercontent.com/u/6224096?v=4)](https://github.com/shyim "shyim (7 commits)")[![ray-magini](https://avatars.githubusercontent.com/u/18124805?v=4)](https://github.com/ray-magini "ray-magini (6 commits)")[![SimonBaeumer](https://avatars.githubusercontent.com/u/9550466?v=4)](https://github.com/SimonBaeumer "SimonBaeumer (5 commits)")[![janbuecker](https://avatars.githubusercontent.com/u/736986?v=4)](https://github.com/janbuecker "janbuecker (4 commits)")[![ndzoesch](https://avatars.githubusercontent.com/u/26064088?v=4)](https://github.com/ndzoesch "ndzoesch (2 commits)")[![DanielRuf](https://avatars.githubusercontent.com/u/827205?v=4)](https://github.com/DanielRuf "DanielRuf (2 commits)")[![Gugiman](https://avatars.githubusercontent.com/u/5836639?v=4)](https://github.com/Gugiman "Gugiman (2 commits)")[![hoist1999](https://avatars.githubusercontent.com/u/665212?v=4)](https://github.com/hoist1999 "hoist1999 (2 commits)")[![jkmw](https://avatars.githubusercontent.com/u/10705308?v=4)](https://github.com/jkmw "jkmw (2 commits)")[![OliverSkroblin](https://avatars.githubusercontent.com/u/1035358?v=4)](https://github.com/OliverSkroblin "OliverSkroblin (2 commits)")[![MoritzKrafeld](https://avatars.githubusercontent.com/u/62691140?v=4)](https://github.com/MoritzKrafeld "MoritzKrafeld (1 commits)")[![Rokko11](https://avatars.githubusercontent.com/u/3337927?v=4)](https://github.com/Rokko11 "Rokko11 (1 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")[![jmatthiesen81](https://avatars.githubusercontent.com/u/2543871?v=4)](https://github.com/jmatthiesen81 "jmatthiesen81 (1 commits)")[![Isengo1989](https://avatars.githubusercontent.com/u/8600299?v=4)](https://github.com/Isengo1989 "Isengo1989 (1 commits)")

---

Tags

shopwareshopware-cli

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/shopwarelabs-sw-cli-tools/health.svg)

```
[![Health](https://phpackages.com/badges/shopwarelabs-sw-cli-tools/health.svg)](https://phpackages.com/packages/shopwarelabs-sw-cli-tools)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M650](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[crunzphp/crunz

Schedule your tasks right from the code.

2292.0M6](/packages/crunzphp-crunz)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19462.3M1.3k](/packages/drupal-core)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
