Installation and Compilation
About 723 wordsAbout 2 min
There are multiple ways to install maa-cli, including pre-compiled binaries, package managers, and building from source with cargo.
Pre-compiled Binaries
The easiest way to install maa-cli is by using the installation script:
curl -fsSL https://raw.githubusercontent.com/MaaAssistantArknights/maa-cli/main/install.sh | bashInvoke-WebRequest -Uri "https://raw.githubusercontent.com/MaaAssistantArknights/maa-cli/main/install.ps1" -OutFile install.ps1; .\install.ps1You can later update maa-cli by running maa self update.
If your platform is not listed above, you can try to build from source.
Install via Package Manager
For macOS and supported Linux distributions, you can install maa-cli using a package manager.
macOS
Homebrew users can install maa-cli via the unofficial tap:
brew install MaaAssistantArknights/tap/maa-clibrew install MaaAssistantArknights/tap/maa-cli-betaLinux
Arch, Nix, and Linux Homebrew users can install maa-cli via their package managers.
Arch Linux
You can install the AUR package:
paru -S maa-cliyay -S maa-cli❄️ Nix
Users can run directly:
nix run nixpkgs#maa-clinix run github:Cryolitia/nur-packages#maa-cli-nightlyThe stable version is packaged in nixpkgs, using the Rust toolchain from nixpkgs; the nightly build is in NUR, using the Beta channel Rust toolchain, and is automatically updated and verified daily by a GitHub Actions.
Homebrew
For users who use Homebrew on Linux, please refer to the macOS installation method.
Other Distributions
Please use the pre-compiled binaries or build from source.
We welcome interested developers to submit maa-cli to the official or user repositories of more distributions!
Build from Source
Rust developers can compile and install maa-cli using cargo:
cargo install --git https://github.com/MaaAssistantArknights/maa-cli.git --bin maa --tag stable --lockedcargo install --git https://github.com/MaaAssistantArknights/maa-cli.git --bin maa --lockedWarning
The Minimum Supported Rust Version (MSRV) for maa-cli is currently 1.88. Please note that the MSRV may change at any time, and we recommend always using the latest Rust toolchain for the best experience.
Build Options
When compiling from source, you can disable default features with --no-default-features and then enable specific features with --features. The available features are:
cli_installer: Enables themaa self updatecommand for self-updating. Enabled by default.core_installer: Enables themaa installandmaa updatecommands for installing and updating MaaCore and its resources. Enabled by default.git2: Provides thelibgit2backend for resource updates. Enabled by default.
Install MaaCore and Resources
maa-cli only provides a command-line interface; it requires MaaCore and resources to run tasks.
Your steps will differ depending on the installation method and platform:
For users of pre-compiled binaries or those who built from source, maa-cli can help you install and update:
maa installFor Windows users, before running maa install, please run the following command as an administrator in Command Prompt or PowerShell to install the necessary VC++ runtime:
winget install "Microsoft.VCRedist.2015+.x64" --override "/repair /passive /norestart" --uninstall-previous --accept-package-agreements --forceThen run maa install.
You can use maa-cli to install the pre-compiled MaaCore:
maa installYou can also install maa-core via the AUR:
paru -S maa-assistant-arknightsor
yay -S maa-assistant-arknightsmaa-cli on Nix has a hard dependency on MaaCore, so Nix users do not need to, and should not, install MaaCore manually.
Warning
maa install downloads the officially pre-compiled MaaCore. MaaCore installed via package managers may use different compile options and dependency versions, which might lead to slight differences in performance and functionality.
