IOTA Client CLI
The IOTA CLI client
command provides command-level access to interact with the IOTA network. Typical uses for iota client
include publishing Move smart contracts, getting the information of an object, executing transactions, or managing addresses.
Check IOTA CLI installation
Before you can use the IOTA CLI, you must install it. To check if the CLI exists on your system, open a terminal or console and type the following command:
iota --version
If the terminal or console responds with a version number, you already have the IOTA CLI installed.
If the command is not found, follow the instructions in Install IOTA to get the IOTA CLI on your system.
Commands
The following list itemizes all the available subcommands for the iota client
command.
Usage: iota client [OPTIONS] [COMMAND]
Commands:
active-address Default address used for commands when none specified
active-env Default environment used for commands when none specified
addresses Obtain the Addresses managed by the client
balance List the coin balance of an address
call Call Move function
chain-identifier Query the chain identifier from the rpc endpoint
dynamic-field Query a dynamic field by its address
envs List all IOTA environments
execute-signed-tx Execute a Signed Transaction. This is useful when the user prefers to sign elsewhere and use this command to execute
execute-combined-signed-tx Execute a combined serialized SenderSignedData string
faucet Request gas coin from faucet. By default, it will use the active address and the active network
gas Obtain all gas objects owned by the address. An address' alias can be used instead of the address
merge-coin Merge two coin objects into one coin
new-address Generate new address and keypair with optional key scheme {ed25519 | secp256k1 | secp256r1} which defaults to ed25519, optional alias which defaults to a random one, optional word length { word12 | word15 | word18 | word21 |
word24} which defaults to word12, and optional derivation path which defaults to m/44'/4218'/0'/0'/0' for ed25519, m/54'/4218'/0'/0/0 for secp256k1 or m/74'/4218'/0'/0/0 for secp256r1
new-env Add new IOTA environment
object Get object info
objects Obtain all objects owned by the address. It also accepts an address by its alias
pay Pay coins to recipients following specified amounts, with input coins. Length of recipients must be the same as that of amounts
pay-all-iota Pay all residual IOTA coins to the recipient with input coins, after deducting the gas cost. The input coins also include the coin for gas payment, so no extra gas coin is required
pay-iota Pay IOTA coins to recipients following following specified amounts, with input coins. Length of recipients must be the same as that of amounts. The input coins also include the coin for
gas payment, so no extra gas coin is required
ptb Run a PTB either from file or from the provided args
publish Publish Move modules
split-coin Split a coin object into multiple coins
switch Switch active address and env (e.g. testnet, devnet, localnet, ...)
tx-block Get a transaction block with the effects, events and object changes of its execution
transfer Transfer object
upgrade Upgrade Move modules
verify-bytecode-meter Run the bytecode verifier on the package
verify-source Verify local Move packages against on-chain packages, and optionally their dependencies
profile-transaction Profile the gas usage of a transaction. Unless an output filepath is not specified, outputs a file `gas_profile_{tx_digest}_{unix_timestamp}.json` which can be opened in a flamegraph tool
such as speedscope
replay-transaction Replay a given transaction to view transaction effects. Set environment variable MOVE_VM_STEP=1 to debug
replay-batch Replay transactions listed in a file
replay-checkpoint Replay all transactions in a range of checkpoints
help Print this message or the help of the given subcommand(s)
Options:
--client.config <CONFIG> Sets the file storing the state of our user accounts (an empty one will be created if missing)
--json Return command outputs in json format
-y, --yes
-h, --help Print help
JSON output
Append the --json
flag to commands to format responses in JSON instead of the more human-friendly default IOTA CLI output. This can be useful for extremely large datasets, for example, as those results can have a troublesome display on smaller screens. In these cases, the --json
flag is useful.
Examples
The following examples demonstrate some of the most often used commands.
List available network environments
Use the iota client envs
command to find the network environments set up in the CLI. The information for these environments is also stored in the client.yaml file in the IOTA configuration directory (~/.iota/iota_config
).
╭────────┬─────────────────────────────────────┬────────╮
│ alias │ url │ active │
├────────┼─────────────────────────────────────┼────────┤
│ devnet │ https://api.devnet.iota.cafe:443 │ * │