A cli which contains handy helpful commands for daily Shopware tasks
- Manage your Shopware account extensions in the CLI
- Build and validate Shopware extensions
For docs see here
Contributions are always welcome!
CLI for Shopware Account and Shopware 6
License: MIT License
A cli which contains handy helpful commands for daily Shopware tasks
For docs see here
Contributions are always welcome!
storefront is built into folder ResourcesResources
storefront is built into folder Resources
Build a plugin with storefront-stuff.
Add docs for all commands.
shopware-cli extension admin-watch MyPlugin http://localhost
is missing at least.
No response
No response
See FriendsOfShopware/actions#10
see FriendsOfShopware/actions#10
The abandoned plugin uploader had an upload command for the plugin, which we use in a release workflow: https://github.com/FriendsOfShopware/FroshPluginUploader#extupload
Will this also be added to the CLI?
shopware-cli/extension/asset_platform.go
Line 350 in 5c5f150
There is a hardcoded 6.4-Version. The correct version should be determined by the version-constraint in composer.json
curl: (60) SSL certificate problem: unable to get local issuer certificate
Can we somehow ignore any type of ssl-error? :-)
No response
No response
the completion script for bash (I assume others too) are based on command shopware-cli
, but it should be shopware
print and use correct command. Use shopware-cli [command]
or shopware [command]
all over.
install bash completion script and seeing not having auto-completion
Create a Github Release after Uploading the Zip to the Store
No response
7.4
No response
shopware/core
package, which is removed during the creation of the zip filerequire
is not removed during the creation of the zip filecomposer.json
(usually done during build process)
"shopware/core": "^6.4.6"
shopware-cli extension validate plugin-shopware-6
shopware-cli extension zip plugin-shopware-6
No response
No response
MySQL Dump should work without a config
just works
No response
0.1.28
Plugin https://github.com/FriendsOfShopware/FroshPlatformBunnycdnMediaStorage
Run composer install
Compare with shopware-cli extension prepare
Please add possibility to specify composer packages to be filtered out as well.
Additionally, to filterShopwareRequires
.
So, we can use preparation without any plugin-dependency to be installed into plugins vendor.
The cwd of a hook should be always the extension dir
After packaging the extension, we unpack the zip to remove some files and then expose the extension main folder as artifact to GitLab.
This doesn't work anymore, since unzip is no longer available (entry point was /bin/sh -c
before).
$ shopware-cli --version
shopware-cli version 0.1.54
[...]
$ unzip $EXT_INTERNAL_NAME-package.zip
/bin/bash: line 131: unzip: command not found
build:package:
image:
name: ghcr.io/friendsofshopware/shopware-cli:v0.1-phpv8.1
entrypoint: [ "/usr/local/bin/entrypoint.sh" ]
tags:
- docker
variables:
FILE_NAME: $BASE_FILE_NAME.zip
EXT_INTERNAL_NAME_PATTERN: -package.zip
artifacts:
name: $BASE_FILE_NAME
paths:
- "*"
stage: build
script:
- shopware-cli --version
#package the extension (executes prepare, build & zip)
- shopware-cli extension zip ./ package --disable-git --release --verbose
#fetch the internal name from the zip name (the technical name from the extension composer.json)
- EXT_INTERNAL_NAME=$(ls | grep -e "$EXT_INTERNAL_NAME_PATTERN" | head -1)
- EXT_INTERNAL_NAME=${EXT_INTERNAL_NAME/$EXT_INTERNAL_NAME_PATTERN/}
#unzip the package, we need the raw files for our artifact
- unzip $EXT_INTERNAL_NAME-package.zip
# remove everything we don't want in our artifact
- find . -not -name $EXT_INTERNAL_NAME -maxdepth 1 -exec rm -r {} \;
This tool will be first an replacement for https://github.com/FriendsOfShopware/FroshPluginUploader
suggested commands
account login
- Login in your Shopware Accountaccount login
- Logout from your ShopwareAccountaccount company list
- List all possible companiesaccount company use
- Switch company and save it in configaccount producer info
- List producer informationaccount producer extension list
- List all extensions per section: SW5, SW6, Appsaccount producer extension create
- Create a new extensionaccount producer extension delete
- Delete a extensionaccount producer extension update
- Update extension page by configurationaccount producer extension upload
- Upload extension updateextension prepare
- Prepare a zip of the extensionextension zip
- Create a zip of the extensionextension validate
- Validate a Zip or folder
No response
No response
Selects just 6.4.0.0 in the account as supported version
Selects every available version from 6.4.0.0 to 7.0.0.0
Use the constraint for store release
In my setup I use devenv with Caddy.
The problem I encountered is that Caddy can't install it's certificate due to permission issues inside devenv up
(can't run sudo
in non-interactive shell).
This results in the following error if I use shopware-cli project admin-api
:
FATA[0000] Post "https://127.0.0.1:8000/api/oauth/token": x509: “Caddy Local Authority - ECC Intermediate” certificate is not trusted
It would be nice to have a flag/option to ignore this behavior.
No response
No response
It searches for src/Resources/app/storefront/src
But should do Resources/app/storefront/src
Try an app
shopware-cli/cmd/project/platform.go
Lines 185 to 203 in 9e36da7
src/Resources/app/package.json
should be installed, too.
People are using this folder to have changed modules in admin and storefront, f.e.
No response
No response
When having logged in with a old password and want to call login again, the cli detects saved password. also it detects the password is wrong.
The cli should call relogging when saved password is wrong.
Additionally: remove shopware-api-client-token.json
, too on every login.
shopware-cli account login
.shopware-cli account login
againI think extensions for 6.4 should be compatible with PHP7.4 - 8.1.
I was running a validate on 8.0 but it failed in the store which seems to check with PHP7.4.
It would be nice if the CLI uses different PHP versions for validation or shows a message, that you should use a different PHP runtime.
What do you think?
This package is archived, because there is no need for it, since you can wrap errors with fmt.Errorf(".... %w", err)
. Since Go1.20, you are also able to wrap multiple errors or use errors.Join(err1, err2, ...)
from the stdlib.
Both methods can be checked with errors.Is()
and errors.As()
.
As discussed, there could be some reasons to use command shopware-cli
instead of shopware
:
shopware-cli
8.1
6.4.18.1
The extensions are not build when no database connection is available.
Currently I run the following command in the ci:
## Compile
compile:
stage: compile
image:
name: ghcr.io/friendsofshopware/shopware-cli
entrypoint: [ "/usr/local/bin/entrypoint.sh" ]
script:
- shopware-cli project admin-build
The following output:
$ shopware-cli project admin-build
time="2023-02-06T19:36:05Z" level=info msg="Building Administration in root /builds/liebscher-bracht/shop6.liebscher-bracht.com"
Warning: Failed to load plugins. Message: An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused
Warning: Failed to load apps. Loading apps from local. Message: An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused
[OK] Dumped plugin configuration.
Unfortunately the extensions are not buildt.
The same happens when I build the storefront
Expected to build the whole store with all extension without a db connection.
Tried the CI=1 environment. Talk with @shyim on slack about it. He labeled it as a bug.
executeComposerHooks
As mentioned in the docs you should never publish the app-secret. I'm wondering if it's a good idea to automatically remove the <secret>
tag in the manifest.xml
file when packing an app?
Before packing
<setup>
<registrationUrl>https://my.example.com/registration</registrationUrl>
<secret>xxxxx-xxxxx-xxxxx-xxxxx</secret>
</setup>
After packing
<setup>
<registrationUrl>https://my.example.com/registration</registrationUrl>
</setup>
Reference: https://developer.shopware.com/docs/guides/plugins/apps/app-base-guide#registration-response
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates await pending status checks before automerging. Click on a checkbox to abort the branch automerge, and create a PR instead.
github.com/evanw/esbuild
, github.com/yuin/goldmark
)Dockerfile
Dockerfile.base
composer/composer 2-bin
.github/workflows/base-docker.yml
actions/checkout v3
docker/setup-qemu-action v2
docker/setup-buildx-action v2
docker/build-push-action v4
.github/workflows/codeql.yml
actions/checkout v3
github/codeql-action v2
github/codeql-action v2
github/codeql-action v2
.github/workflows/config-schema-update.yml
actions/checkout v3
.github/workflows/go_test.yml
actions/checkout v3
actions/setup-go v4
.github/workflows/lint.yml
actions/checkout v3
actions/setup-go v4
golangci/golangci-lint-action v3
.github/workflows/qodana.yml
actions/checkout v3
.github/workflows/release.yml
actions/checkout v3
actions/setup-go v4
docker/setup-buildx-action v2
sigstore/cosign-installer v3
anchore/sbom-action v0.14.3
goreleaser/goreleaser-action v4
go.mod
go 1.20
github.com/bep/godartsass/v2 v2.0.0
github.com/caarlos0/env/v9 v9.0.0
github.com/doutorfinancas/go-mad v0.0.0-20230320131904-348560be9c36@348560be9c36
github.com/evanw/esbuild v0.18.15
github.com/friendsofshopware/go-shopware-admin-api-sdk v0.0.0-20230318202833-6328f419267d@6328f419267d
github.com/google/uuid v1.3.0
github.com/gorilla/schema v1.2.0
github.com/manifoldco/promptui v0.9.0
github.com/microcosm-cc/bluemonday v1.0.25
github.com/olekukonko/tablewriter v0.0.5
github.com/otiai10/copy v1.12.0
github.com/sashabaranov/go-openai v1.14.1
github.com/spf13/cobra v1.7.0
github.com/stretchr/testify v1.8.4
github.com/vulcand/oxy/v2 v2.0.0-20230427132221-be5cf38f3c1c@be5cf38f3c1c
github.com/yuin/goldmark v1.5.4
go.uber.org/zap v1.24.0
gopkg.in/yaml.v3 v3.0.1
dario.cat/mergo v1.0.0
github.com/NYTimes/gziphandler v1.1.1
golang.org/x/net v0.12.0
wiki/requirements.txt
I'd like to have a command to get/create bearer for packages.shopware.com
Minimum PHP version of shopware is 7.4.
Running "extension prepare" on plugin uses PHP 8.0, which can result in errors while components are installed which are incompatible.
Should we set config.platform.php in composer.json to 7.4?
8.0
6.4.12.0
We have tables in our SW6 database called "SW5_*", e.g. "SW5_s_articles_attributes" which should be ignored when dumping. But they are dumped even if written in .shopware-project.yaml under ignore config.
All tables under ignore config should be ignored when dumping (even the ones with uppercase table names)
dump:
ignore:
- SW5_s_articles_attributes
No response
No response
If using services or classes from the Shopware core the compilation doesn't work.
According to the documentation e.g. import Plugin from 'src/plugin-system/plugin.class';
already causes this error.
shopware-cli extension build custom/static-plugins/shopware-platform-delivery-time/
up to date, audited 2 packages in 5s
found 0 vulnerabilities
npm notice
npm notice New major version of npm available! 8.19.2 -> 9.1.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.1.2
npm notice Run npm install -g [email protected] to update!
npm notice
INFO[0004] Downloading dart-sass
INFO[0005] Using dart-sass binary /root/.cache/dart-sass-embedded/dart-sass-embedded
extension.js 126.4kb
extension.css 21.0kb
⚡ Done in 602ms
INFO[0005] Using dart-sass binary /root/.cache/dart-sass-embedded/dart-sass-embedded
✘ [ERROR] Could not resolve "src/plugin-system/plugin.class"
custom/static-plugins/shopware-platform-delivery-time/src/Resources/app/storefront/src/deliveryDate/deliveryDate.plugin.js:5:19:
5 │ import Plugin from 'src/plugin-system/plugin.class';
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can mark the path "src/plugin-system/plugin.class" as external to exclude it from the bundle,
which will remove this error.
✘ [ERROR] Could not resolve "src/service/http-client.service"
custom/static-plugins/shopware-platform-delivery-time/src/Resources/app/storefront/src/deliveryDate/deliveryDateTime.js:1:23:
1 │ import HttpClient from 'src/service/http-client.service';
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can mark the path "src/service/http-client.service" as external to exclude it from the bundle,
which will remove this error.
2 errors
It should compile
build:
zip:
composer:
enabled: true
assets:
enabled: false
enable_es_build_for_admin: true
enable_es_build_for_storefront: true
pack:
excludes:
paths:
- .cache
- .editorconfig
- .gitignore
- .idea
docker run --rm -ti -v $PWD:/tmp/build -w /tmp/build --entrypoint= ghcr.io/friendsofshopware/shopware-cli:0.1.44 bash
shopware-cli extension build custom/static-plugins/shopware-platform-delivery-time/
This should be disable able using .shopware-extension.yml
shopware-cli/cmd/extension/extension_zip.go
Line 131 in 1db6860
getenv?🤔
8.0.0
6.4.11.1
Tested the watcher on a plugin with the ~scss/variables import:
file: "_file_.scss", context: "@import \"~scss/variables\";\n": Can't find stylesheet to import.
This import is used for using the variables in Shopping Experience blocks (previews).
The import is recognised by the watcher and compiles without breaking
shopware-cli extension admin-watch _PluginDirectory_ http://localhost
Tested the watcher on a plugin that includes an scss file with a ~scss/variables import
No response
No response
I run shopware-cli extension zip /path/to/extension --disable-git
I get
INFO[0001] Downloading dart-sass
INFO[0001] Using dart-sass binary /root/.cache/dart-sass-embedded/dart-sass-embedded
FATA[0001] close |0: file already closed
Build
See actual behavior
8.1
6.4.20
Running package
in our GitLab CI with Docker.
Package fails with building assets: exec: \"npm\": executable file not found in $PATH
Executing "step_script" stage of the job script 00:09
Using docker image sha256:45cbf57a5c858edc1d07d38fb50d4efe17ba532584a20769ea3c7c713ef7f664 for ghcr.io/friendsofshopware/shopware-cli:v0.1-phpv8.1 with digest ghcr.io/friendsofshopware/shopware-cli@sha256:7c29a5043e58e3aa7e56bf2543b6f4264238da4df3020710a67db84702f03bc0 ...
$ shopware-cli --version
shopware-cli version 0.1.54
$ shopware-cli extension zip ./ package --release --verbose
No composer.lock file present. Updating dependencies to latest instead of installing from lock file. See https://getcomposer.org/install for more information.
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Writing lock file
Installing dependencies from lock file
Nothing to install, update or remove
Generating optimized autoload files
Cloning into '/tmp/extension2478198386'...
Updating files: 100% (17171/17171), done.
Usage:
shopware-cli extension zip [path] [branch] [flags]
Flags:
--disable-git Use the source folder as it is
-h, --help help for zip
--release Release mode (remove app secrets)
Global Flags:
--config string config file (default is $HOME/.shopware-cli.yaml)
--verbose show debug output
time="2023-03-08T14:50:21Z" level=fatal msg="building assets: exec: \"npm\": executable file not found in $PATH"
The docker image would provide the required npm
gitlab-ci.yml
build:package:
image:
name: ghcr.io/friendsofshopware/shopware-cli:v0.1-phpv8.1
entrypoint: [""]
tags:
- docker
variables:
FILE_NAME: $BASE_FILE_NAME.zip
EXT_INTERNAL_NAME_PATTERN: -package.zip
artifacts:
name: $BASE_FILE_NAME
paths:
- "*"
stage: build
script:
- shopware-cli --version
#package the extension (executes prepare, build & zip)
- shopware-cli extension zip ./ package --release --verbose
No response
No response
https://github.com/FriendsOfShopware/FroshTools/actions/runs/4221742758/jobs/7329402510#step:10:22
https://github.com/FriendsOfShopware/FroshTools/actions/runs/4221742758/jobs/7329402510#step:10:22
https://github.com/FriendsOfShopware/FroshTools/actions/runs/4221742758/jobs/7329402510#step:10:22
8.0
6.4.12.0
When dumping a SW6 database, the triggers present in the database are not in the resulting dump.sql.
Triggers should also be dumped to dump.sql
Hi,
For automation purposes, we would very much like a sort of latest tag.
Now we need to manually pick a version here: https://github.com/FriendsOfShopware/shopware-cli/releases/
It would be nice to have something available like:
Any other means to find the latest release are welcome :)
7.4.32
6.4.16.0
command shopware-cli project extension list --project-config .shopware-project.dev.yml
return error
FATA[0001] API request failed, got http code 500 with content: Shopware\Core\Framework\Api\Context\AdminApiSource does not have a valid user ID
from app log
[2022-10-11T11:57:09.914365+00:00] request.CRITICAL: Uncaught PHP Exception Shopware\Core\Framework\Api\Context\Exception\InvalidContextSourceUserException: "Shopware\Core\Framework\Api\Context\AdminApiSource does not have a valid user ID" at /var/www/html/vendor/shopware/core/Framework/Store/Authentication/StoreRequestOptionsProvider.php line 97 {"exception":"[object] (Shopware\\Core\\Framework\\Api\\Context\\Exception\\InvalidContextSourceUserException(code: 0): Shopware\\Core\\Framework\\Api\\Context\\AdminApiSource does not have a valid user ID at /var/www/html/vendor/shopware/core/Framework/Store/Authentication/StoreRequestOptionsProvider.php:97)"} []
get list of plugins
run shopware-cli project extension list
Shopware extension store complains about missing icon, it would be cool if the CLI tool already did that.
extra.plugin-icon#missing: missing plugin icon, it must be located under "src/Resources/config/plugin.png", or a custom path defined in "extra"."plugin-icon"
No response
No response
docker run --rm -v ${PWD}:/app ghcr.io/friendsofshopware/shopware-cli extension prepare /app
results in Error: level=fatal msg="prepare zip: PrepareFolderForZipping: exec: \"composer\": executable file not found in $PATH"
should work
call command in plugin
Currently used Logrus is in maintenance mode only. So we should switch to Zap logger.
Zap is already in the dependencies so it should be convenient to switch
No response
No response
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.