The Platform.sh CLI is the official command-line interface for Platform.sh. Use this tool to interact with your Platform.sh projects, and to build them locally for development purposes.
This repository hosts the source code and releases of the new CLI.
This product includes PHP software, freely available from the PHP website
To install the CLI, use either Homebrew (on Linux, macOS, or the Windows Subsystem for Linux) or Scoop (on Windows):
brew install platformsh/tap/platformsh-cliIf you have issues with missing libraries on a Mac, see how to troubleshoot CLI installation on M1/M2 Macs.
scoop bucket add platformsh https://github.com/platformsh/homebrew-tap.gitscoop install platformUse the bash installer for an automated installation, using the most preferable way for your system.
curl -fsSL https://raw.githubusercontent.com/platformsh/cli/main/installer.sh | bashThe installer is configurable using the following environment variables:
INSTALL_LOG- the install log fileINSTALL_METHOD- force a specific installation method, possible values arebrewandrawINSTALL_DIR- the installation directory for therawinstallation method, for example you can useINSTALL_DIR=$HOME/.local/binfor a single user installationVERSION- the version of the CLI to install, if you need a version other than the latest one
Force the CLI to be installed using the raw method
curl -fsSL https://raw.githubusercontent.com/platformsh/cli/main/installer.sh | INSTALL_METHOD=raw bash Install a specific version
curl -fsSL https://raw.githubusercontent.com/platformsh/cli/main/installer.sh | VERSION=4.0.1 bash Install the CLI in a user owned directory
curl -fsSL https://raw.githubusercontent.com/platformsh/cli/main/installer.sh | INSTALL_METHOD=raw INSTALL_DIR=$HOME/.local/bin bash sudo apk add --no-cache bashcurl -1sLf \ 'https://dl.cloudsmith.io/public/platformsh/cli/setup.alpine.sh' \ | sudo -E bashManual setup
apk add --no-cache curl curl -1sLf 'https://dl.cloudsmith.io/public/platformsh/cli/rsa.4F1C2AC5106DA770.key' > /etc/apk/keys/cli@platformsh-4F1C2AC5106DA770.rsa.pub curl -1sLf "https://dl.cloudsmith.io/public/platformsh/cli/config.alpine.txt" >> /etc/apk/repositories apk update # Install the CLIapk add platformsh-cliapt-get updateapt-get install -y apt-transport-https curlcurl -1sLf \ 'https://dl.cloudsmith.io/public/platformsh/cli/setup.deb.sh' \ | sudo -E bashManual setup
apt-get update # Only needed for Debian apt-get install -y debian-keyring debian-archive-keyring apt-get install -y apt-transport-https curl gnupg curl -1sLf 'https://dl.cloudsmith.io/public/platformsh/cli/gpg.6ED8A90E60ABD941.key' | gpg --dearmor >> /usr/share/keyrings/platformsh-cli-archive-keyring.gpg # If you use an Ubuntu derivative distro, such as Linux Mint, you may need to use UBUNTU_CODENAME instead of VERSION_CODENAME below. curl -1sLf "https://dl.cloudsmith.io/public/platformsh/cli/config.deb.txt?distro=$(. /etc/os-release && echo "$ID")&codename=$(. /etc/os-release && echo "$VERSION_CODENAME")" > /etc/apt/sources.list.d/platformsh-cli.list apt-get update # Install the CLIapt-get install -y platformsh-clicurl -1sLf \ 'https://dl.cloudsmith.io/public/platformsh/cli/setup.rpm.sh' \ | sudo -E bash # Install the CLIyum install -y platformsh-cliFor manual installation, you can also download the latest binaries.
Upgrade using the same tool:
brew update && brew upgrade platformsh/tap/platformsh-cliscoop update platformcurl -fsSL https://raw.githubusercontent.com/platformsh/cli/main/installer.sh | bashapk add -l platformsh-cliapt-get upgrade platformsh-cliyum upgrade -y platformsh-cliThe New Platform.sh CLI is built with backwards compatibility in mind. This is why we've embedded PHP, so that all Legacy PHP CLI commands can be executed in the exact same way, making sure that nothing breaks when you switch to it.
Build a single binary
# Build a single binary for Platform.shmake single # Build a single binary for Upsunmake single GORELEASER_ID=upsunBuild a snapshot
# Build and snapshot for Platform.sh and Upsunmake snapshot # Build a snapshot for a vendor # Download the config file at internal/config/embedded-config.yamlmake vendor-snapshot VENDOR_NAME='Upsun staging' VENDOR_BINARY='upsunstg'Create a release
# First, create a new tag, if not already on a Git taggit tag -f -m 'Release v5.0.0' '5.0.0' # Create a release for Platform.sh and Upsun # Expose a GITHUB_TOKEN to use for the releasemake release # Create a release for a vendor with the default .gorelease.vendor.yaml.tpl # Download the config file at internal/config/embedded-config.yaml # Optionally, download the .goreleaser.vendor.yaml file to use a custom onemake vendor-release VENDOR_NAME='Upsun staging' VENDOR_BINARY='upsunstg'This binary redistributes PHP in a binary form, which comes with the PHP License.