Skip to content

Install a Wikimedia CLI

Releasev0.35.0 · cfeceb67

Download the binary and matching .sha256 file for your operating system and CPU from the latest release, or use the commands below. Release assets currently use the mw_ prefix. On Windows, use the .exe asset; for the development environment, use a Linux installation inside WSL2.

In an empty directory, download and verify the latest release for Linux or macOS on an Intel/AMD 64-bit or ARM64 machine:

Terminal window
(
set -e
PLATFORM=$(uname -s | tr '[:upper:]' '[:lower:]')
case "$(uname -m)" in
x86_64) ARCH=amd64 ;;
arm64|aarch64) ARCH=arm64 ;;
*) echo 'Choose a binary for your CPU from the releases page.' >&2; exit 1 ;;
esac
UA='a-wikimedia-cli (https://www.mediawiki.org/wiki/Cli)'
RELEASE_URL=$(curl -fsSL -A "$UA" -o /dev/null -w '%{url_effective}' \
https://gitlab.wikimedia.org/repos/releng/cli/-/releases/permalink/latest)
VER=${RELEASE_URL##*/}
ASSET="mw_${VER}_${PLATFORM}_${ARCH}"
curl -fL -A "$UA" "$RELEASE_URL/downloads/binaries/$ASSET" -o mw
curl -fL -A "$UA" "$RELEASE_URL/downloads/binaries/$ASSET.sha256" -o mw.sha256
printf '%s mw\n' "$(cat mw.sha256)" | shasum -a 256 -c -
)

The release version is discovered automatically. A successful checksum check prints mw: OK. For other CPUs or manually downloaded files, save the binary as mw and the matching checksum as mw.sha256, then verify them before installing:

Terminal window
printf '%s mw\n' "$(cat mw.sha256)" | shasum -a 256 -c -

For an installation in your home directory:

Terminal window
mkdir -p "$HOME/.local/bin"
install -m 0755 mw "$HOME/.local/bin/mw"

Add $HOME/.local/bin to your shell’s PATH if needed. To install for all users instead, run sudo install -m 0755 mw /usr/local/bin/mw.

Check the installation:

Terminal window
mw version
mw --help

After checking the installation, remove the downloaded copies from your working directory:

Terminal window
rm mw mw.sha256

Arch Linux users can also use the community-maintained mwcli package in the Arch User Repository (AUR). Community packages may lag behind the latest upstream release. For package-managed installations, follow your package manager’s update procedure.

The project is called a Wikimedia CLI. The default command remains mw; the same executable also works when renamed or symlinked as wm. Help and completion use the name you invoke. Both names use the existing mwcli configuration directory and saved credentials.

Docker is needed for the development environment; the commands for Wikimedia data and remote services do not require it.

Continue with updates or your first local wiki.


Read this guide offline with mw help guides installation.

Adapted from MediaWiki.org under CC BY-SA 4.0; see the linked page history for contributors.

Report an issue with this page

Report a documentation issue

The report includes this page’s link, section and documentation version.

Review and submit on Phabricator, or run the command using your saved CLI profile. The command asks before creating the task.