MVR CLI

Use the MVR CLI to manage your package dependencies and to interact with the Move Registry (MVR). The MVR CLI is a command line tool that enables:

  • Adding dependencies to your Move project.
  • Building your Move project with MVR dependencies.

Installation

There are several ways to install the MVR CLI tool.

Cargo

Use the following command to install using Cargo:

cargo install --locked --git https://github.com/mystenlabs/mvr --branch release mvr

From binaries

Download the correct binary file for your OS and architecture from the MVR GitHub release page (opens in a new tab):

After downloading the file, rename the binary to mvr and add its location to your system PATH variable.

  1. Open your .zshrc file. This file is typically located at ~/.zshrc in MacOS. If it doesn't exist, create it.
    $ nano ~/.zshrc
  2. Update or add the following export PATH command. Be sure to change /path/to/your/folder to match your folder path. Separate all paths using a colon, if necessary.
    export PATH="/path/to/your/folder:$PATH"
  3. Save the file and use the source command to apply changes.
    $ source ~/.zshrc

From source

To install from source:

  1. Clone the mvr repository.
    git clone https://github.com/mystenlabs/mvr.git
  2. Open a console or terminal to the mvr/mvr-cli directory of the repository.
    cd mvr/mvr-cli && 
  3. Use cargo to install from current directory.
    cargo install --path .
💡

After completing your install from one of the above methods, use a terminal or console to verify installation by typing mvr --help and pressing Enter. If your operating system does not recognize the command, then retry the installation steps.

Adding dependencies

To add a dependency to your Move code, use the mvr add command. This command adds the dependency to your Move.toml file.

mvr add <package_name> --network <mainnet|testnet>

MVR adds a new entry to your Move.toml file. The following shows an example of the information that MVR adds.

[dependencies]
...
app = { r.mvr = "@mvr/app" }
 
[r.mvr]
network = "mainnet"

Building against MVR dependencies

Use sui move build as usual when building Move packages. The command automatically invokes MVR CLI to resolve dependencies and build your project.

sui move build