Explore Wikimedia data, work with services, and develop MediaWiki from your terminal. The default command is mw.
- Wikimedia data: Query analytics APIs, graph results, and follow event streams.
- Wikis: Read and edit pages on MediaWiki wikis.
- Cloud VPS: Find instances, connect over SSH, and manage compute and storage.
- Code and collaboration: Work with GitLab and Gerrit, and search Wikimedia code.
- Development environments: Run MediaWiki and supporting services with
mw devand Docker Compose, on your machine or a remote host. - Updates: Update the CLI from releases or CI builds.
Read the guides in this repository, or visit the published documentation.
mw analytics queries the Wikimedia Analytics API for pageviews, edits, editors, new pages, unique devices, and media requests. Omit the article from pageviews or edits for project totals. Rankings support --date YYYYMMDD, --month YYYYMM, and --limit; --offset skips leading results before applying the limit. Without a date, they find the latest available day within the past week. Tables are the default in a terminal; pipes receive JSON. Use --output json|table|jq|csv|graph to choose explicitly. Graphs show time series as lines and rankings as horizontal bars; --graph-width overrides the detected terminal width. Page names in ranking tables and graphs are clickable in terminals that support hyperlinks.
mw analytics pageviews 'Albert Einstein' --agent user --output graph
mw analytics top-pages --project en.wikipedia.org --date 20250101 --offset 1 --limit 10 --output graph
mw analytics mediarequests top --month 202501
mw api 'metrics/pageviews/top/en.wikipedia.org/all-access/2025/01/01' --output jq --format '.items[0].articles[:5]'mw api accepts REST endpoints relative to https://wikimedia.org/api/rest_v1/, an alternative --base-url, or an absolute URL. Use --method (-X), repeatable --header (-H) and --field (-f) flags, or --input FILE (- for stdin). Fields become a JSON POST body by default, or query parameters with --method GET. --include prints response headers; --raw preserves the response body.
Follow the installation guide.
To contribute, see:
- CONTRIBUTING.md: Contribution workflow and review.
- DEVELOPMENT.md: Setup, builds, tests, and releases.
mw remains the default. The same executable can be renamed or symlinked as wm (or another name); help, examples, and generated shell completion follow its invocation name. Both names use the existing mwcli configuration and credentials. Build another name with make BINARY_NAME=wm build, then run ./bin/wm.
The checkout can live anywhere. In Bash, build the CLI and select it for the current shell:
eval "$(make -s dev)"
command -v mwFrom another directory, replace /path/to/cli with your checkout location:
eval "$(make -s -C "/path/to/cli" dev)"For convenience, add an alias to your Bash configuration, using your checkout's absolute path:
alias mw-dev='eval "$(make -s -C "/path/to/cli" dev)"'Run mw-dev to build and activate it. Repeating activation avoids duplicate PATH entries. This affects only the current shell; rerun after changing code or branches. You can also use make build and run ./bin/mw directly.
Existing Bash completion follows the selected binary. To load it explicitly, run source <(mw completion bash).
- Phabricator: #mwcli
- IRC:
#mediawikion Libera.Chat - Mailing List: wikitech-l
See CI.md for GitLab checks, GitHub integration tests, and runner setup.
This project is licensed under the Apache License 2.0. See the LICENSE file for details.