Sui CLI Cookbook

The sui CLI is the primary command-line interface for interacting with Sui nodes, wallets, and developer tools. This cookbook provides quick, copy-paste examples for common tasks.

Install

Homebrew (macOS / Linux / WSL)

brew install sui

Chocolatey (Windows)

choco install sui

Install with suiup

suiup is a tool similar to rustup. Install it and then install sui:

curl -sSfL https://raw.githubusercontent.com/Mystenlabs/suiup/main/install.sh | sh
suiup install sui

Alternatively, download releases from the Sui GitHub Releases.

Cookbook

Below are unordered, practical commands you can copy and paste. For many commands, you may need to run sui client once and accept prompts to create the configuration and an initial keypair.

Note

Sui’s documentation is sometimes inconsistent about RPC endpoints. The canonical fullnode RPC endpoints are:

  • Devnet: https://fullnode.devnet.sui.io:443
  • Testnet: https://fullnode.testnet.sui.io:443
  • Mainnet: https://fullnode.mainnet.sui.io:443

[!INFORMATION] Many commands accept --help for usage (for example sui client --help). To get JSON output for scripting, append --json.

Creating Accounts

Create an ed25519 account (alias alice):

sui client new-address ed25519 alice

Create secp256k1 and secp256r1 accounts:

sui client new-address secp256k1 bob
sui client new-address secp256r1 charlie

Request faucet funds (testnet/devnet or local faucet):

sui client faucet --address alice

Check an account balance:

sui client balance alice

Starting a Local Network

Start a local network (example with faucet):

RUST_LOG="off,sui_node=info" sui start --with-faucet --force-regenesis

Add a local RPC endpoint and switch the CLI to it:

sui client new-env --alias localnet --rpc http://localhost:9000
sui client switch --env localnet

Request funds from the local faucet:

sui client faucet --address alice

Using dApps with Localnet

Nightly App and other wallets (e.g., Surf) can connect to a local network. In Nightly, add https://localhost:9000 (or http://localhost:9000 if the dApp supports it) as a custom RPC endpoint.

Quick tips

  • Use --help on any sui subcommand for details (for example, sui start --help).
  • Use --json where available to integrate sui output into scripts.