Install this version:
emerge -a =www-apps/wp-cli-2.12.0
If this version is masked, you can unmask it using the autounmask tool or standard emerge options:
autounmask =www-apps/wp-cli-2.12.0
Or alternatively:
emerge --autounmask-write -a =www-apps/wp-cli-2.12.0
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DESCRIPTION="Command line interface for WordPress (upstream phar)"
HOMEPAGE="https://wp-cli.org/ https://github.com/wp-cli/wp-cli"
SRC_URI="https://github.com/wp-cli/wp-cli/releases/download/v${PV}/${P}.phar"
S="${WORKDIR}"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~arm64"
RESTRICT="strip test"
RDEPEND="
dev-lang/php:*[cli,curl,phar,mysqli,zip,xml,ssl,iconv]
"
src_unpack() {
cp "${DISTDIR}/${P}.phar" "${WORKDIR}/wp.phar" || die
}
src_install() {
exeinto /usr/share/${PN}
doexe wp.phar
# thin launcher: the phar needs php's phar stream wrapper, so call php explicitly (no binfmt/phar auto-detection needed)
cat > wp <<-EOF || die
#!/bin/sh
exec php ${EPREFIX}/usr/share/${PN}/wp.phar "\$@"
EOF
dobin wp
}
| Type | File | Size | Source URLs |
|---|---|---|---|
| DIST | wp-cli-2.12.0.phar | 7142777 bytes | https://github.com/wp-cli/wp-cli/releases/download/v2.12.0/wp-cli-2.12.0.phar |