Skip to main content

Sui CLI Cheat Sheet

The cheat sheet highlights common Sui CLI commands.

Addresses and aliases

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

Faucet and gas

Faucet availability

sui client faucet works on Devnet and Localnet only. It does not work on Testnet. For Testnet tokens, use the web faucet at faucet.sui.io, Discord (#testnet-faucet), or the TypeScript SDK. All faucets are rate-limited. If you hit a limit, wait or try a different method. There is no faucet for Mainnet; SUI tokens on Mainnet have real monetary value.

CommandDescription
sui client faucetGet a SUI coin from the faucet (Devnet and Localnet only)
sui client faucet --address ADDRESSGet a SUI coin for the address (accepts also an alias)
sui client faucet --url CUSTOM_FAUCET_URLGet a SUI coin from custom faucet
sui client gasList the gas coins for the active address
sui client gas ADDRESSList the gas coins for the given address (accepts also an alias)
sui client balanceList all coin balances for the active address

Network command description

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

Create, build, and test a Move project

CommandDescription
sui move buildBuild the Move project in the current directory
sui move build --path PATHBuild the Move project from the given path
sui move migrate PATHMigrate to Move 2024 for the package at provided path
sui move new PROJECT_NAMECreate a new Move project in the given folder
sui move testTest the Move project in the current directory
sui move test --traceCreate an execution trace for the Move tests in the current directory. Use with the Move Trace Debugger extension.

Publishing and upgrading packages

CommandDescription
sui client publishPublish the Move package in the current directory
sui client publish --dry-runSimulate publish to estimate gas cost without executing
sui client publish --serialize-unsigned-transactionOutput unsigned base64 transaction bytes for external or multisig signing
sui client test-publishPublish for testing with temporary address handling (transaction still lands on-chain)
sui client upgrade \
  --upgrade-capability CAP_ID
Upgrade a previously published package
sui client verify-source PACKAGE_PATHVerify on-chain bytecode matches local source code

Objects and dynamic fields

CommandDescription
sui client objectsList all objects owned by the active address
sui client object OBJECT_IDShow details for a specific object (type, owner, content)
sui client object OBJECT_ID --jsonShow object details in JSON format
sui client dynamic-field OBJECT_IDList dynamic fields attached to an object

Transaction inspection

CommandDescription
sui client tx-block DIGESTShow details of an executed transaction by its digest
sui client tx-block DIGEST --jsonShow transaction details in JSON format

Executing transactions

CommandDescription
sui client call \
  --package PACKAGE \
  --module MODULE \
  --function FUNCTION
Call a Move package
sui client ptb \
  --merge-coins @PRIMARY_COIN_ID \
  "[@COIN_ID]"
Merge one or more coins into a primary coin
sui client ptb \
  --split-coins @COIN_ID \
  "[1000]"
Split a coin into two coins: one with 1000 MIST and the rest

sui client ptb \
  --split-coins gas "[100000000]" \
  --assign coin \
  --transfer-objects "[coin]" ADDRESS

Transfer 0.1 SUI to an address using the gas coin
sui client ptb \
  --transfer-objects "[gas]" ADDRESS
Transfer the full gas coin balance to an address

Programmable transaction blocks (PTBs)

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

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

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

Transfer an object to an address. You can pass multiple objects in the array

sui client ptb \
  --move-call sui::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
sui client ptb --move-call p::m::f "<type>" args --dry-runSimulate a PTB execution without committing the transaction
sui client ptb --move-call p::m::f "<type>" args --previewPreview PTB commands instead of executing the transaction
sui client ptb --move-call p::m::f "<type>" args --summaryShow a short summary for a PTB (digest, status, gas cost)

sui client ptb \
  --move-call p::m::f "<type>" args \
  --serialize-unsigned-transaction

Serialize the unsigned PTB as base64 instead of executing it

Troubleshooting

Error or symptomCauseFix
Cannot find gas coin for signer addressActive address has no SUI tokensFund the address with the faucet (Devnet/Localnet) or web faucet (Testnet)
Client/server API version mismatchCLI version doesn't match the network's protocol versionRun suiup update to update the CLI
Your package is already publishedPublished.toml already has an entry for this environmentUse sui client upgrade to upgrade, or switch to a different network with sui client switch --env
Transaction fails with InsufficientGasGas budget too low or insufficient balanceIncrease --gas-budget or fund the address. Use --dry-run to estimate cost first
ObjectVersionUnavailableForConsumptionObject was modified by another transaction since you last read itRe-fetch the object with sui client object OBJECT_ID and retry
Package dependency cannot be foundActive network doesn't have the required dependency publishedVerify your environment with sui client active-env and that dependencies are published on that network
sui client faucet fails on Testnetsui client faucet only supports Devnet and LocalnetUse the web faucet at faucet.sui.io or Discord for Testnet tokens