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.
- Open your
.zshrc
file. This file is typically located at~/.zshrc
in MacOS. If it doesn't exist, create it.$ nano ~/.zshrc
- 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"
- Save the file and use the
source
command to apply changes.$ source ~/.zshrc
From source
To install from source:
- Clone the
mvr
repository.git clone https://github.com/mystenlabs/mvr.git
- Open a console or terminal to the
mvr/mvr-cli
directory of the repository.cd mvr/mvr-cli &&
- 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>
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" }
Starting at version 0.0.13
, network
is no longer supported in the Move.toml
file. MVR instead relies on the CLI's active chain identifier to determine
the network to use.
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