{"id":13765444,"url":"https://github.com/shopwareLabs/sw-cli-tools","last_synced_at":"2025-05-10T21:30:57.115Z","repository":{"id":37588046,"uuid":"20680680","full_name":"shopwareLabs/sw-cli-tools","owner":"shopwareLabs","description":"The shopware CLI tools are your console helpers for all kind of shopware tasks","archived":false,"fork":false,"pushed_at":"2024-12-03T08:29:16.000Z","size":7709,"stargazers_count":85,"open_issues_count":9,"forks_count":52,"subscribers_count":38,"default_branch":"master","last_synced_at":"2025-04-08T18:18:30.355Z","etag":null,"topics":["shopware","shopware-cli"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shopwareLabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-06-10T10:02:54.000Z","updated_at":"2024-12-10T02:39:51.000Z","dependencies_parsed_at":"2025-01-13T09:01:55.108Z","dependency_job_id":"c86ad521-bb41-4a0d-b0ec-c8d911b1496e","html_url":"https://github.com/shopwareLabs/sw-cli-tools","commit_stats":{"total_commits":409,"total_committers":46,"mean_commits":8.891304347826088,"dds":0.7359413202933985,"last_synced_commit":"e20e63311da12bcbca37c759a998fc8c01b89b1f"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shopwareLabs%2Fsw-cli-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shopwareLabs%2Fsw-cli-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shopwareLabs%2Fsw-cli-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shopwareLabs%2Fsw-cli-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shopwareLabs","download_url":"https://codeload.github.com/shopwareLabs/sw-cli-tools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253484889,"owners_count":21915917,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["shopware","shopware-cli"],"created_at":"2024-08-03T16:00:39.117Z","updated_at":"2025-05-10T21:30:56.760Z","avatar_url":"https://github.com/shopwareLabs.png","language":"PHP","funding_links":[],"categories":["PHP","Command Line"],"sub_categories":[],"readme":"\n# Shopware CLI Tools\n\n[![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)\n[![License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)\n\nThe shopware CLI tools are your console helpers for all kind of Shopware tasks. They will allow you to:\n\n * setup Shopware from VCS\n * setup Shopware from a release tag\n * create Shopware plugins\n * define a bunch of plugin repositories you use\n * install plugins from the repositories and activate them in shopware\n * zip plugins in the way the Shopware store or the Shopware plugin manager expect it to be\n\nThe shopware CLI tools come with a slim extension interface, so you can extend it for your needs.\n\nThis 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\n\n Pull requests are very welcome as well as ideas for possible extensions.\n\n# Support\n\nUse at your own risk, there is no support for this tools.\n\n# Install\n\nGenerally 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 http://shopwarelabs.github.io/sw-cli-tools/).\n\nIf you want to use the development version of sw-cli-tools, you should checkout the repository and run `composer install` to download all dependencies\n\n## Requirements ###\nOn your system at least the following packages needs to be available.\n\n * openjdk-7-jre-headless\n * ant\n * git\n * curl\n * php7-curl\n * If you want to use coloring you should enable php.posix in your php.ini\n\n## Available commands\n* sw cache:clear\n* sw install:vcs\n* sw install:release\n* sw plugin:install\n* sw plugin:zip:dir\n* sw plugin:zip:vcs\n* sw plugin:create\n* sw generate\n\n## Using the Commands\n### sw plugin:install\nWill install a plugin from one of the configured repos\n\nValid options/arguments are:\n\n    --useHttp: use HTTP for checkout if possible (e.g. for VPN, SSH seems to be slow here sometimes)\n    --small: Show 3 columns of plugins in a short form\n    --shopware-root Shopware root directory\n    --branch branch to checkout out\n    names1…nameN - names of plugins to install\n\nThis command will automatically create a VCS mapping for phpstorm if `.idea/vcs.xml` can be found. You will need\nto refresh you config with File-\u003eSychronize (Control+Alt+Y)\n\n### sw plugin:zip:vcs\nWill checkout a plugin from VCS and zip it properly for the store\n\nValid options/arguments are:\n\n    --useHttp: use HTTP for checkout if possible (e.g. for VPN, SSH seems to be slow here sometimes)\n    --small: Show 3 columns of plugins in a short form\n    --branch branch to checkout out\n    names1…nameN - names of plugins to zip\n\nIf the plugins contains a file in its root named `.sw-zip-blacklist`, the files/directories described there, will be excluded from zipping\n\n### sw plugin:zip:dir\nWill zip the given plugin directory. DIRECTORY must point to the directory where the plugin bootstrap can be found.\n\n### sw install:vcs\nCheckout the latest shopware version from vcs (for development)\n\nValid options/arguments are:\n\n    --branch: The branch to checkout\n    --databaseName: Name of the database to use\n    --installDir: Where to install shopware\n    --user: Github user name. If provided, the checkout will be done via HTTP\n\nThe options will be read interactively, if not provided\nThe database credentials are configured in ~/.config/sw-cli-tools/config.yaml\n\n### sw install:release\n    --release=RELEASE                Release version. Default: Latest. Possible are all shopware release versions like \"4.2.0\"\n    --install-dir[=INSTALL-DIR]      Install directory\n    --unpack-only                    Only unpack the downloaded release\n    --skip-download                  Skip release downloading\n    --db-host=DB-HOST                Database host [default: \"localhost\"]\n    --db-port=DB-PORT                Database port [default: \"3306\"]\n    --db-socket=DB-SOCKET            Database socket\n    --db-user=DB-USER                Database user\n    --db-password=DB-PASSWORD        Database password\n    --db-name=DB-NAME                Database name\n    --shop-locale=SHOP-LOCALE        Shop locale [default: \"de_DE\"]\n    --shop-host=SHOP-HOST            Shop host [default: \"localhost\"]\n    --shop-path=SHOP-PATH            Shop path [default: \"/\"]\n    --shop-name=SHOP-NAME            Shop name [default: \"Demo shop\"]\n    --shop-email=SHOP-EMAIL          Shop email address [default: \"your.email@shop.com\"]\n    --shop-currency=SHOP-CURRENCY    Shop currency [default: \"EUR\"]\n    --admin-username=ADMIN-USERNAME  Administrator username [default: \"demo\"]\n    --admin-password=ADMIN-PASSWORD  Administrator password [default: \"demo\"]\n    --admin-email=ADMIN-EMAIL        Administrator email address [default: \"demo@demo.demo\"]\n    --admin-locale=ADMIN-LOCALE      Administrator locale [default: \"de_DE\"]\n    --admin-name=ADMIN-NAME          Administrator name [default: \"Demo user\"]\n\n### sw plugin:create\nWill 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.\n\nValid options / arguments are:\n\n    --legacy: Create a legacy Plugin for Shopware versions lower than 5.2\n    --namespace[=\"...\"]: Namespace of the plugin, default: Frontend\n    --haveBackend: Generate a backend Controller + a simple ExtJS module\n    --backendModel[=\"...\"]: The name of the model for your backend application\n    --haveFilter: Generate Condition/Facet/CriteriaRequestHandler in order to add a new filter in the frontend\n    --haveFrontend | -f: Generate a frontend controller\n    --haveModels | -m: Generate a simple doctrine model\n    --haveCommands | -c: Generate a console command\n    --haveWidget | -w: Generate a backend widget\n    --haveApi | -a: Generate an API resource + REST controller\n    --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\"\n    --haveElasticSearch | -e: Generate ElasticSearch blueprint classes and an example of a decorator for the product number search.\n\nThe options will be read interactively, if not provided.\nThe database credentials are configured in ~/.config/sw-cli-tools/config.yaml\n\n### sw generate\nWill generate data which can be used to fill the shop for e.g. load tests.\n\n!Warning! this command is destructive\n\nValid options / arguments are:\n\n     -a, --articles[=ARTICLES]                          Number of articles to create\n         --articleFilterGroups[=ARTICLEFILTERGROUPS]    Number article filter option groups to create\n         --articleFilterOptions[=ARTICLEFILTEROPTIONS]  Number article filter options to create\n         --articleFilterValues[=ARTICLEFILTERVALUES]    Number article filter values to create per each filter option\n     -o, --orders[=ORDERS]                              Number of orders to create\n     -c, --categories[=CATEGORIES]                      Number of categories to create\n         --categoriesPerArticle[=CATEGORIESPERARTICLE]  Number of categories to assign to each article\n     -e, --newsletter[=NEWSLETTER]                      Number of newsletter to create\n     -u, --customers[=CUSTOMERS]                        Number of customers to create\n         --vouchers[=VOUCHERS]                          Number of vouchers to create\n         --chunk-size[=CHUNK-SIZE]                      Chung size\n     -s, --seed[=SEED]                                  Random seed\n         --installDir[=INSTALLDIR]                      Your Shopware installation path. If provided, data will be automatically injected into the configured database. [default: \"\"]\n     -n, --no-interaction                               Do not ask any interactive question\n\nIf executed from a Shopware installation, or if 'installDir' is provided, the data will\nbe automatically written into your Shopware database.\nOtherwise, data will be exported to individual files in the '\u003ccurrent dir\u003e\\output' folder\nYou need to import the .sql files in the order in which they are generated (see the command output)\n\nRequires 'local-infile=1' in your MySQL installation.\n\n# Extending the cli tools\n\n## New Extensions\n\nExtensions 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`.\n\nThe namespace of your extension bootstrap should be `VENDOR_FOLDER\\EXTENSION_FOLDER\\Bootstrap`.\n\n### Bootstrap\nThe bootstrap is the main entry point of your extension. If it implements `ContainerAwareExtension`, it will get the container builder\n of the application injected via setContainer. This way the container can be extended by your extension.\nAdditionally the Bootstrap can implement `ConsoleAwareExtension`. If this is the case, the method \"getConsoleCommands\" will be\ncalled after creation - please return an array of console command instances here.\nFinally the extension will call the `getRepositories` method of extensions implementing `RepositoryAwareInterface`.\n\n### Changing existing components\n\nAs you Bootstrap.php is instantiated after the container, you can replace any service of the container\n\n# Paths\nThe SW cli tools make use of the XDG directory standard. Following directories are used:\n\n    ~/.config/sw-cli-tools: Here the main configuration as well as the extensions are stored\n    ~/.cache/sw-cli-tools: Here caches (like repo content) as well as release downloads are cached\n    ~/.local/share/sw-cli-tools: Assets the demo data package are stored here\n\nIf you changed some of these directories via `XDG` environment variables, those directories are used instead\n\n# Configuration\nThe configuration of the script is done in `~/.config/sw-cli-tools/config.yaml`.\nIf the file does not exist on your system, it is created after the first usage of the script.\n\n## Repositories\nIn order to use commands like `plugin:zip:vcs` the tool needs to know where the source comes from.\nFor this repositories need to be defined in the `repositories` section of the configuration file.\nFor now the following repository types are supported:\n- GitHub\n- Stash\n- BitBucket\n- SimpleList\n- GitLab\n\nThis is how an example config could look like:\n\n```yml\nrepositories:\n  GitLab:\n    config:\n      endpoint: https://gitlab.shopware.com/api/v4/\n    repositories:\n      Services SW5:\n        cache: 86400\n        url: groups/92/projects?per_page=100\u0026private_token=your-private-token\n        color: red\n  GitHub:\n    config:\n      endpoint: https://api.github.com/search/\n    repositories:\n      Plugins SW5:\n        cache: 86400\n        url: repositories?q=org:Shopware5+topic:shopware-plugin\n        color: blue\n```\n\n# Building sw.phar\nFor building the release package (`sw.phar`) [box](http://box-project.github.io/box2/) is used.\nA new release is build automatically for every push on the master branch by Travis CI (See `bin/deploy.sh`).\n\n# Coding standard\nCoding standard for the project is [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md).\nCoding standard violations may be detected using php-cs-fixer:\n\n    ./vendor/bin/php-cs-fixer fix -v --level=psr2 ./src\n    ./vendor/bin/php-cs-fixer fix -v --level=psr2 ./tests\n\n# General hints\n## Timeouts\nIf you are having a slow internet connection and e.g. git checkouts or tasks related to the `ProcessExecutor` fail\nwith a timeout, you can increase the timeout by setting the environment variable `SW_TIMEOUT`:\n\n    SW_TIMEOUT=500 sw install:vcs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FshopwareLabs%2Fsw-cli-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FshopwareLabs%2Fsw-cli-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FshopwareLabs%2Fsw-cli-tools/lists"}