Getting Started with Sui CLI
First, you’ll need to install Sui CLI on your computer. Depending on the operating system and package manager you’re using, here’s how you can install Sui CLI on your computer: Execute this command on your terminal to install Sui CLI if you’re running a Unix-based operating system (macOS or Linux) via Homebrew.[Terminal]
[Terminal]
[Terminal]
--version
flag to verify your installation and check the version of Sui CLI you have installed.
[Terminal]
- help
flag for the description of every command.
[Terminal]

-h
or --help
for help would always be handy.
Environment Management with Sui CLI
Every chain provides you with three fundamental networks: Mainnet, Testnet, and Devnet. You can also spawn a test chain locally to keep development in stealth mode. Here’s the command you’ll execute to spawn a local network.[Terminal]
new-env
command like this:
[Terminal]
[Terminal]
local
environment you’ve created.
[Terminal]
Address and Key Management with Sui CLI
You’ll be switching keys as you deploy smart contracts over the Sui CLI, so here’s how to do that. You can view the currently active address with theactive-address
command
[Terminal]
addresses
command.
[Terminal]
--address
flag before specifying the address.
Key Management with Sui CLI
When building your apps, for security or other reasons, you might want to run CLI commands to work with keys. Thekeytool
command is
You can list all the keys in a keystore with the list
command like this:
[Terminal]
generate
command followed with a specification of the scheme.
[Terminal]
ed25519
since that’s what most wallets use. Specify it like this.
[Terminal]

import command
.
[Terminal]
Gas and Faucet with Sui CLI
When you’re developing your apps, ideally, you’ll start out on devnet, then testnet before deploying to mainnet. Devnet and Testnet gas are free to acquire. But mainnet? nah. You can easily request gas on devnet with theclient faucet
command:
[Terminal]
[Terminal]
client gas
command to check the client’s available gas tokens on the current environment.
[Terminal]
Publishing Packages
You can publish packages on to the Sui network with theclient publish
command.
[Terminal]
5000000
MIST gas budget.
[Terminal]
Coin Management with Sui CLI
When you’re working with SUI coins, You’ll probably need to merge and split them often—especially when youjuggling gas or sending different amounts to various contracts or users. If you’ve have two coins lying around, and you want to consolidate them, use themerge-coin
command like this:
[Terminal]
primary-coin
is the one you’ll keep, and the coin-to-merge
is the one that gets absorbed.
Need to split a coin instead? Maybe you want to pay out to multiple recipients or just need different denominations. You can slice a coin up using split-coin
like this:
[Terminal]
client transfer-sui
command like this:
[Terminal]
pay-sui
command:
[Terminal]
Object Management with Sui CLI
Sui is all about objects. Contracts, tokens, and even your coins—they’re all objects. To get detailed info on any object, just call:[Terminal]
[Terminal]
Programmable Transaction Blocks (PTBs)
Sui is one of the few chains with native PTBs. Programmable Transaction Blocks let you bundle multiple operations into a single transaction—kinda like a mini-script that executes on-chain. Say you need to call a Move function directly from your CLI. You’ll do that like this:[Terminal]
[Terminal]