Skip to main content

IOTA CLI Cheat Sheet

The cheat sheet highlights common IOTA CLI commands.

Addresses & Aliases

CommandDescription
iota client active-addressGet the active address
iota client addressesList the addresses, their aliases, and the active address
iota client new-address ed25519Create a new address with ED25519 scheme
iota client new-address ed25519 MY_ALIASCreate a new address with ED25519 scheme and alias
iota client switch --address ADDRESSMake this the active address (accepts also an alias)
iota keytool convert PRIVATE_KEYConvert private key in Hex or Base64 to new format (Bech32 encoded 33 byte flag || private key starting with "iotaprivkey")
iota keytool generate ed25519Generate a new keypair with ED25519 scheme and save it to file
iota keytool import INPUT KEY_SCHEMEAdd a new key to IOTA CLI Keystore using either the input mnemonic phrase or a Bech32 encoded 33-byte flag || privkey starting with "iotaprivkey"
iota keytool update-alias OLD_ALIAS NEW_ALIASUpdate the alias of an address

Faucet & Gas

CommandDescription
iota client faucetGet a IOTA coin from the faucet associated with the active network
iota client faucet --address ADDRESSGet a IOTA coin for the address (accepts also an alias)
iota client faucet --url CUSTOM_FAUCET_URLGet a IOTA coin from custom faucet
iota client gasList the gas coins for the active address
iota client gas ADDRESSList the gas coins for the given address (accepts also an alias)

Network Command Description

CommandDescription
iota client active-envGet the active environment
iota client envsList defined environments
iota client new-env --rpc URL --alias ALIASCreate a new environment with URL and alias
iota client switch --env ENV_ALIASSwitch to the given environment
iota genesisBootstrap and initialize a new IOTA network
iota startStart the local IOTA network
iota-faucetStart a local faucet. Note this is a different binary

Create, Build, and Test a Move Project

CommandDescription
iota move buildBuild the Move project in the current directory
iota move build --path PATHBuild the Move project from the given path
iota move migrate PATHMigrate to Move 2024 for the package at provided path
iota move new PROJECT_NAMECreate a new Move project in the given folder
iota move testTest the Move project in the current directory

Executing Transactions

CommandDescription
iota client call \
  --package PACKAGE \
  --module MODULE \
  --function FUNCTION
Call a Move package
iota client merge-coin \
  --primary-coin COIN_ID \
  --coin-to-merge COIN_ID
Merge two coins
iota client split-coin \
  --coin-id COIN_ID \
  --amounts 1000
Split a coin into two coins: one with 1000 MIST and the rest

iota client pay-iota \
  --input-coins COIN_ID \
  --recipients ADDRESS \
  --amounts 100000000

Transfer 0.1 IOTA to an address and use the same coin for gas
iota client transfer-iota \
  --iota-coin-object-id COIN_ID \
  --to ADDRESS
Transfer IOTA object to an address and use the same coin for gas

Programmable Transaction Blocks (PTBs)

CommandDescription
iota client ptb --move-call p::m::f "<type>" argsCall a Move function from a package and module
iota client ptb --make-move-vec "<u64>" "[1000,2000]"Make a Move vector with two elements of type u64

iota client ptb \
  --split-coins gas "[1000]" \
  --assign new_coins \
  --transfer-objects "[new_coins]" ADDRESS

Split a gas coin and transfer it to address
iota client ptb --transfer-objects "[object_id]" ADDRESS

Transfer an object to an address. Note that you can pass multiple objects in the array

iota client ptb \
  --move-call iota::tx_context::sender \
  --assign sender \
  --publish "." \
  --assign upgrade_cap \
  --transfer-objects "[upgrade_cap]" sender

Publish a Move package, and transfer the upgrade capability to sender