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.
Verify and install on Linux or macOS
Section titled “Verify and install on Linux or macOS”In an empty directory, download and verify the latest release for Linux or macOS on an Intel/AMD 64-bit or ARM64 machine:
(set -ePLATFORM=$(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 ;;esacUA='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 mwcurl -fL -A "$UA" "$RELEASE_URL/downloads/binaries/$ASSET.sha256" -o mw.sha256printf '%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:
printf '%s mw\n' "$(cat mw.sha256)" | shasum -a 256 -c -For an installation in your home directory:
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:
mw versionmw --helpAfter checking the installation, remove the downloaded copies from your working directory:
rm mw mw.sha256Community packages
Section titled “Community packages”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.
Command names and configuration
Section titled “Command names and configuration”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.
Page views: —Sessions: —