Jump to content

Cli/guide/Installation: Difference between revisions

From mediawiki.org
Content deleted Content added
Update: sudo required for mw update
Generic-ify download command
Line 9: Line 9:
== Download ==
== Download ==


Download the binary (version 0.20.0 as of this writing) by running the following commands, which include a checksum check:
Download the binary (version 0.22.1 as of this writing) by running the following commands, which include a checksum check:


<syntaxhighlight lang="shell">
<syntaxhighlight lang="shell">
MW_PLATFORM=$(uname | tr '[:upper:]' '[:lower:]') bash -c 'curl -s "https://gitlab.wikimedia.org/api/v4/projects/16/packages/generic/mwcli/v0.20.0/mw_v0.20.0_${MW_PLATFORM}_amd64" -o mw && curl -s "https://gitlab.wikimedia.org/api/v4/projects/16/packages/generic/mwcli/v0.20.0/mw_v0.20.0_${MW_PLATFORM}_amd64.sha256" -o mw.sha256 && echo $(cat mw.sha256 | tr -d '\n') " mw" > mw.sha256 && shasum -a 256 -c mw.sha256 && rm -v mw.sha256'
ARCH=amd64 VER=v0.22.1 MW_PLATFORM=$(uname | tr '[:upper:]' '[:lower:]') bash -c 'curl -s "https://gitlab.wikimedia.org/api/v4/projects/16/packages/generic/mwcli/${VER}/mw_${VER}_${MW_PLATFORM}_${ARCH}" -o mw && curl -s "https://gitlab.wikimedia.org/api/v4/projects/16/packages/generic/mwcli/${VER}/mw_${VER}_${MW_PLATFORM}_${ARCH}.sha256" -o mw.sha256 && echo $(cat mw.sha256 | tr -d '\n') " mw" > mw.sha256 && shasum -a 256 -c mw.sha256 && rm -v mw.sha256'
</syntaxhighlight>
</syntaxhighlight>



Revision as of 01:37, 23 July 2023

Install mwcli for Linux, Windows, or macOS using the instructions below.

If you are running Windows, please install mwcli in WSL as it has significantly better performance than Windows.[1] The following commands will only work in the WSL shell.

Alternatively, you can find binaries for most operating systems and CPU architectures on the releases page.

Download

Download the binary (version 0.22.1 as of this writing) by running the following commands, which include a checksum check:

ARCH=amd64 VER=v0.22.1 MW_PLATFORM=$(uname | tr '[:upper:]' '[:lower:]') bash -c 'curl -s "https://gitlab.wikimedia.org/api/v4/projects/16/packages/generic/mwcli/${VER}/mw_${VER}_${MW_PLATFORM}_${ARCH}" -o mw && curl -s "https://gitlab.wikimedia.org/api/v4/projects/16/packages/generic/mwcli/${VER}/mw_${VER}_${MW_PLATFORM}_${ARCH}.sha256" -o mw.sha256 && echo $(cat mw.sha256 | tr -d '\n') " mw" > mw.sha256 && shasum -a 256 -c mw.sha256 && rm -v mw.sha256'

If successful, you'll see the following output:

mw: OK
removed 'mw.sha256'

Install

# install the binary to '/usr/local/bin/mw' with the correct permissions
sudo install mw /usr/local/bin/mw

Update

Check your installation for available updates by running:

sudo mw update

See Cli/guide/Update for more details.

Cleanup

After installing, delete the mw binary in your current working directory.

rm -v mw