Installation
You can install the pre-compiled binary (in several different ways), use Docker or compile from the source.
Below you can find the steps for each of them.
Install the pre-compiled binary
Shopware-CLI is published in various package managers. You can install it using the following commands.
Homebrew
brew install shopware/tap/shopware-cli
Debian/Ubuntu — APT based Linux
curl -1sLf \
'https://dl.cloudsmith.io/public/friendsofshopware/stable/setup.deb.sh' \
| sudo -E bash
sudo apt install shopware-cli
Fedora/CentOS/SUSE/RedHat — YUM based Linux
curl -1sLf \
'https://dl.cloudsmith.io/public/friendsofshopware/stable/setup.rpm.sh' \
| sudo -E bash
sudo dnf install shopware-cli
Archlinux User Repository (AUR)
yay -S shopware-cli-bin
Manually: deb,rpm apt packages
Download the .deb
, .rpm
or .apk
packages from the releases page and install them with the appropriate tools.
Nix
Install Nix package from here:
nix profile install nixpkgs#shopware-cli
or directly from the FriendsOfShopware repository (more up to date)
nix profile install github:FriendsOfShopware/nur-packages#shopware-cli
Devenv
Update devenv.yaml
with a new input:
inputs:
nixpkgs:
url: github:NixOS/nixpkgs/nixpkgs-unstable
froshpkgs:
url: github:FriendsOfShopware/nur-packages
inputs:
nixpkgs:
follows: "nixpkgs"
Then you can use the new input in the devenv.nix
file. Don't forget to add the inputs
argument, to the first line.
{ pkgs, inputs, ... }: {
packages = [
inputs.froshpkgs.packages.${pkgs.system}.shopware-cli
];
}
GitHub Codespaces
{
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"ghcr.io/shyim/devcontainers-features/shopware-cli:latest": {}
}
}
GitHub Action
Using Shopware CLI Action :
- name: Install shopware-cli
uses: shopware/shopware-cli-action@v1
Gitlab CI
build:
stage: build
image:
name: shopware/shopware-cli:latest
entrypoint: [ "/bin/sh", "-c" ]
script:
- shopware-cli --version
ddev
Add a file .ddev/web-build/Dockerfile.shopware-cli
# .ddev/web-build/Dockerfile.shopware-cli
COPY --from=shopware/shopware-cli:bin /shopware-cli /usr/local/bin/shopware-cli
Docker Image
Add the following line to your docker image to copy the binary into your image.
# Dockerfile
COPY --from=shopware/shopware-cli:bin /shopware-cli /usr/local/bin/shopware-cli
Manually
Download the pre-compiled binaries from the releases page and copy them to the desired location.
Running with Docker
You can also use it within a Docker container. To do that, you will need to execute something more or less like the examples below.
Registries:
Example usage:
Builds assets of an extension
docker run \
--rm \
-v $(pwd):$(pwd) \
-w $(pwd) \
-u $(id -u) \
shopware/shopware-cli \
extension build FroshPlatformAdminer
Compiling from source
If you just want to build from source for whatever reason, follow these steps:
git clone https://github.com/shopware/shopware-cli
cd shopware-cli
go mod tidy
go build -o shopware-cli .
./shopware-cli --version