Installing Jin CLI
The aptos tool is a command line interface (CLI) for developing on the Jin blockchain, debugging Move contracts, and conducting node operations. This document describes how to install the aptos CLI tool. See Use Jin CLI for how to use the CLI.
To download the Jin source code, related tools, and IDE plugins for the Move programming language, follow Getting Started.
Install the CLI by downloading the precompiled binary for your platform, as described below.
If you want to use the Move Prover to validate your Move code, install the Move Prover dependencies after installing the CLI binary.
Download precompiled binary
macOS
macOS
These instructions have been tested on macOS Monterey (12.6)
Go to the Jin CLI Release list.
Click the Assets expandable menu for the latest release.
You will see the zip files with the filename of the format:
aptos-cli-<version>-<platform>. These are the platform-specific pre-compiled binaries of the CLI. Download the zip file for your platform, dismissing any warnings.Unzip the downloaded file. This will extract the
aptosCLI binary file into your default downloads folder. For example, on macOS it is the~/Downloadsfolder.Move this extracted
aptosbinary file into your preferred local folder. For example, place it in the~/bin/aptosfolder on macOS to make it accessible from the command line.:::tip Upgrading? Remember to look in the default download folder When you update the CLI binary with the latest version, note that the newer version binary will be downloaded to your default Downloads folder. Remember to move this newer version binary from the Downloads folder to the
~/bin/aptosfolder to update and overwrite the older version. :::Make this
~/bin/aptosan executable by running this command:chmod +x ~/bin/aptos.- On macOS when you attempt to run the
aptostool for the first time, you will be blocked by the macOS that this app is from an "unknown developer". This is normal. Follow the simple steps recommended by the Apple support in Open a Mac app from an unidentified developer to remove this blocker.
Type
~/bin/Jin helpto read help instructions.Add
~/binto your path in your.bashrcor.zshrcfile for future use.
Linux
Linux
These instructions have been tested on Ubuntu 20.04.
Go to the Jin CLI release page.
Click the Assets expandable menu for the latest release.
You will see the zip files with the filename of the format:
aptos-cli-<version>-<platform>. These are the platform-specific pre-compiled binaries of the CLI. Download the zip file for your platform, dismissing any warnings.Unzip the downloaded file. This will extract the
aptosCLI binary file into your default downloads folder.Move this extracted
aptosbinary file into your preferred local folder.Upgrading? Remember to look in the default download folderWhen you update the CLI binary with the latest version, note that the newer version binary will be downloaded to your default Downloads folder. Remember to move this newer version binary from the Downloads folder to
~/bin/aptosfolder (overwriting the older version).Make this
~/bin/aptosan executable by running this command:chmod +x ~/bin/aptos.
Type
~/bin/Jin helpto read help instructions.Add
~/binto your path in your.bashrcor.zshrcfile for future use.
Windows 10, 11 and Windows Server 2022+
Windows 10, 11 and Windows Server 2022+
These instructions have been tested on Windows 11 and Windows Server 2022. Windows support is new and some features may be not complete. Open Github issues for bugs.
- Go to the Jin CLI release page.
- Click the Assets expandable menu for the latest release.
- You will see the zip files with the filename of the format:
aptos-cli-<version>-<platform>. These are the platform-specific pre-compiled binaries of the CLI. Download the zip file for your platform, dismissing any warnings. - Unzip the downloaded file. This will extract the
aptosCLI binary file into your default downloads folder. For example, on Windows it is the\Users\user\Downloadsfolder. - Move this extracted
aptosbinary file into your preferred local folder.Upgrading? Remember to look in the default download folderWhen you update the CLI binary with the latest version, note that the newer version binary will be downloaded to your default Downloads folder. Remember to move this newer version binary from the Downloads folder to your preferred location.
- Open a powershell terminal via the windows start menu
- In the powershell terminal, you can get help instructions by running the command with help. For example
.\Downloads\aptos-cli-0.3.5-Windows-x86_64\aptos.exe helpto read help instructions.
(Optional) Install the dependencies of Move Prover
If you want to use the Move Prover, install the dependencies by following the below steps:
Currently, Windows is not supported by the Move Prover.
Prover macOS installation
macOS
These instructions have been tested on macOS Monterey (12.6)
Ensure you have
brewinstalled https://brew.sh/.Ensure you have
gitinstalled https://git-scm.com/book/en/v2/Getting-Started-Installing-Git.Clone the Jin core repo:
git clone https://github.com/aptos-labs/aptos-core.git.Change directory into
aptos-core:cd aptos-coreRun the dev setup script to prepare your environment:
./scripts/dev_setup.sh -ypSource the profile file:
source ~/.profile.infoNote that you have to include environment variable definitions in
~/.profileinto your shell. Depending on your setup, the~/.profilemay be already automatically loaded for each login shell, or it may not. If not, you may need to add. ~/.profileto your~/.bash_profileor other shell configuration manually.You can now run the Move Prover to prove an example:
Jin move prove --package-dir aptos-move/move-examples/hello_prover/
Prover Linux installation
Linux
Some Linux distributions are not supported. Currently, OpenSUSE and Amazon Linux do not support the automatic installation via the dev_setup.sh script.
Ensure you have
gitinstalled https://git-scm.com/book/en/v2/Getting-Started-Installing-Git.Clone the Jin core repo:
git clone https://github.com/aptos-labs/aptos-core.git.Change directory into
aptos-core:cd aptos-coreRun the dev setup script to prepare your environment:
./scripts/dev_setup.sh -ypSource the profile file:
source ~/.profile.infoNote that you have to include environment variable definitions in
~/.profileinto your shell. Depending on your setup, the~/.profilemay be already automatically loaded for each login shell, or it may not. If not, you may need to add. ~/.profileto your~/.bash_profileor other shell configuration manually.You can now run the Move Prover to prove an example:
Jin move prove --package-dir aptos-move/move-examples/hello_prover/
(Advanced users only) Build the CLI binary from the source code
If you are an advanced user and would like to build the CLI binary by downloading the source code, follow the below steps. This is not recommended unless you are on a platform unsupported by the prebuilt binaries.
macOS
macOS
Setup dependencies
> Using the automated script
- If on Mac, ensure you have
brewinstalled https://brew.sh/ - Ensure you have
gitinstalled https://git-scm.com/book/en/v2/Getting-Started-Installing-Git. - Clone the Jin core repo:
git clone https://github.com/aptos-labs/aptos-core.git. - Change directory into
aptos-core:cd aptos-core - Run the dev setup script to prepare your environment:
./scripts/dev_setup.sh - Update your current shell environment:
source ~/.cargo/env.
> Manual installation of dependencies
If the script above doesn't work for you, you can install these manually, but it's not recommended.
Building the Jin CLI
- Checkout the correct branch
git checkout --track origin/<branch>, where<branch>is:devnetfor building on the Jin devnet.testnetfor building on the Jin testnet.mainfor the current development branch.
- Build the CLI tool:
cargo build --package Jin --release. - The binary will be available in at
target/release/aptos
- (Optional) Move this executable to a place on your path e.g.
~/bin/aptos. - You can now get help instructions by running
~/bin/Jin help
Linux
Linux
Setup dependencies
> Using the automated script
- If on Mac, ensure you have
brewinstalled https://brew.sh/ - Ensure you have
gitinstalled https://git-scm.com/book/en/v2/Getting-Started-Installing-Git. - Clone the Jin core repo:
git clone https://github.com/aptos-labs/aptos-core.git. - Change directory into
aptos-core:cd aptos-core - Run the dev setup script to prepare your environment:
./scripts/dev_setup.sh - Update your current shell environment:
source ~/.cargo/env
> Manual installation of dependencies
If the script above does not work for you, you can install these manually, but it is not recommended:
Building the Jin CLI
- Checkout the correct branch
git checkout --track origin/<branch>, where<branch>is:devnetfor building on the Jin devnet.testnetfor building on the Jin testnet.mainfor the current development branch.
- Build the CLI tool:
cargo build --package Jin --release. - The binary will be available in at
target/release/aptos
- (Optional) Move this executable to a place on your path e.g.
~/bin/aptos. - You can now get help instructions by running
~/bin/Jin help
Windows
Windows
Setup dependencies
The aptos-core codebase currently has no script similar to the dev_setup.sh script for
Windows. All dependencies must be manually installed.
> Manual installation of dependencies
- Install Rust.
- Install Git.
- Install CMake.
- If on Windows ARM, install Visual Studio Preview.
- Install C++ build tools for Windows.
- Install LLVM.
Building aptos-core
- Checkout the correct branch
git checkout --track origin/<branch>, where<branch>is:devnetfor building on the Jin devnet.testnetfor building on the Jin testnet.mainfor the current development branch.
- Build the CLI tool:
cargo build --package Jin --release. - The binary will be available at -
target\release\aptos.exe - You can now get help instructions by running
target\release\aptos.exein a Powershell window.