Files
MaaAssistantArknights/docs/en-us/manual/cli/install.md
Loong 5f86aeb675 chore: bump maa-cli to 0.4.8 and update documents (#9683)
* chore: bump maa-cli to 0.4.8 and update documents

* docs: 合并 cli 文档中的 README 和 intro

* docs: fix broken link to CLI guide

* docs: update order of CLI manual pages
2024-07-16 18:39:02 +01:00

4.6 KiB
Raw Blame History

order, icon
order icon
1 material-symbols:download

Install and Build

There are multiple ways to install maa-cli, including package managers, precompiled binaries, and building from source with cargo.

Install via Package Manager

For macOS and supported Linux distributions, it is recommended to install maa-cli using a package manager.

macOS

Homebrew users can install maa-cli via the unofficial tap:

  • Stable release:

    brew install MaaAssistantArknights/tap/maa-cli
    
  • Beta releases:

    brew install MaaAssistantArknights/tap/maa-cli-beta
    

Linux

  • Arch Linux users can install the AUR package:

    yay -S maa-cli
    
  • ❄️ Nix users can run directly:

    # Stable release
    nix run nixpkgs#maa-cli
    
    # Nightly build
    nix run github:Cryolitia/nur-packages#maa-cli-nightly
    

    Stable is the maa-cli packaged in nixpkgs, using the nixpkgs's Rust toolchain; Nightly is in NUR, uses the Beta Channel of Rust toolchain, automatically updates and builds for verification by Github Action daily.

  • Users using Homebrew on Linux please refer to the macOS installation method above.

Precompiled Binaries

If package managers are not available on your system or you prefer not to use them, you can download the precompiled binaries for your platform from the following links. After decompressing, place the executable file in your PATH to use.

If your platform is not listed above, you can try to compile and install it yourself (see below).

Build from Source

Rust developers can compile and install maa-cli themselves via cargo:

  • Stable version:

    cargo install --git https://github.com/MaaAssistantArknights/maa-cli.git --bin maa --tag stable --locked
    
  • Development version:

    cargo install --git https://github.com/MaaAssistantArknights/maa-cli.git --bin maa --locked
    

Features

When compiling from source, you can disable the default features with --no-default-features and then enable specific features with --features. The available features are:

  • cli_installer: Provide maa self update command to update self, this feature is enabled by default;
  • core_installer: Provide maa install and maa update commands to install and update MaaCore and resources, this feature is enabled by default;
  • git2: Provide libgit2 resource backend, this feature is enabled by default;
  • vendored-openssl: Build OpenSSL library by self instead of using system library, this feature is disabled by default;

Install MaaCore

maa-cli only provides an interface for MaaCore, it needs MaaCore and resources to run tasks, which can be installed by maa-cli once it is installed:

maa install

For users who installed via package managers, MaaCore can be installed via package managers:

  • Homebrew

    brew install MaaAssistantArknights/tap/maa-core
    
  • Arch Linux

    yay -S maa-assistant-arknights
    
  • Nix

    nix-env -iA nixpkgs.maa-assistant-arknights
    

NOTE: Only users who installed maa-cli via package managers can install MaaCore via package managers. Otherwise, please use the maa install command to install. In addition, the maa install downloads the official precompiled MaaCore, while the MaaCore installed by package managers has different compilation options and dependency versions from the official precompiled version. This does not affect the use of maa-cli but may cause differences in the functionality and performance of MaaCore. For example, the MaaCore installed by package managers uses a newer version of fastdeploy, while the official precompiled MaaCore uses an older version of fastdeploy. In the new version of fastdeploy, logs can be hidden, which can eliminate some unnecessary log output.