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.
After downloading the file, rename the binary to mvr and add its location to your system PATH variable.
- Zsh
- Bash
- fish
- Windows
- Open your
.zshrcfile. This file is typically located at~/.zshrcin macOS. If it does not exist, create it.
$ nano ~/.zshrc
- Update or add the following
export PATHcommand. Be sure to change/path/to/your/folderto 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
sourcecommand to apply changes.
$ source ~/.zshrc
- Open your
.bashrcfile (or.bash_profileon macOS). This file is typically located at~/.bashrcin macOS. If it does not exist, create it.
$ nano ~/.bashrc
- Update or add the following
export PATHcommand. Be sure to change/path/to/your/folderto 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
sourcecommand to apply changes.
$ source ~/.bashrc
- Open your fish configuration file.
$ nano ~/.config/fish/config.fish
- Add the following command to the configuration. Be sure to change
/path/to/your/folderto match your folder path.
set -Ux fish_user_paths /path/to/your/folder $fish_user_paths
- Save the file.
- In Search, search for and then select: System (Control Panel).
- Click the Advanced system settings link.
- Click Environment Variables. In the section System Variables find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.
- In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable. Click OK. Close all remaining windows by clicking OK.
From source
To install from source:
- Clone the
mvrrepository.git clone https://github.com/mystenlabs/mvr.git - Open a console or terminal to the
mvr/mvr-clidirectory of the repository.cd mvr/mvr-cli && - Use
cargoto 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.
Add 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"
Build 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