IOTA CLI
IOTA provides a command line interface (CLI) tool to interact with the IOTA network, its features, and the Move programming language. The complete suite of tools is called the IOTA CLI, with commands grouped together by feature. Each group of commands is commonly referred to by its top-level command: IOTA Client CLI, IOTA Console CLI, IOTA Keytool CLI, IOTA Move CLI, and IOTA Validator CLI.
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.
Update CLI
To get the latest version of the CLI, you can run the following command from a terminal or console. Be sure to replace <BRANCH-NAME>
with develop
, devnet
, testnet
, or mainnet
to get the desired version. For more information on the branches available, see IOTA Environment Setup.
cargo install --locked --git https://github.com/iotaledger/iota.git --branch <BRANCH-NAME> --features tracing iota
The --features tracing
flag is necessary only if you want to run gas profiles for transactions.
IOTA CLI commands
There are a number of top-level commands available, to get an overview of them, use the iota help
command.
The six most useful commands to users are the following:
- IOTA Client CLI: Use the
iota client
command to interact with the IOTA network. - IOTA Client PTB CLI: Use the
iota client ptb
command to build and execute PTBs. - IOTA Console CLI: Use
iota console
to open an interactive console with the currently active network. - IOTA Keytool CLI: Use the
iota keytool
command to access cryptography utilities. - IOTA Move CLI: Use the
iota move
command to work with the Move programming language. - IOTA Validator CLI: Use the
iota validator
command to access tools useful for IOTA validators. - IOTA Genesis Ceremony CLI: Use the
iota ceremony
command to build a genesis blob.
Use the help
flag for the commands that are not documented yet. For example, iota validator --help
.
IOTA CLI Completion
You can generate completion files per shell using the gen-completions
feature.
cargo install --locked --git https://github.com/iotaledger/iota.git --branch <BRANCH-NAME> --features gen-completions iota
- Bash
- Elvish
- Fish
- Powershell
- Zsh
iota generate-completions -s bash -o ~/.iota
echo "source ~/.iota/iota.bash" >> ~/.bashrc
The following commands create a new iota
module and add it to the interactive startup script rc.elv
.
mkdir ~/.config/elvish
iota generate-completions -s elvish -o ~/.config/elvish/lib
echo "use iota" >> ~/.config/elvish/rc.elv
iota generate-completions -s fish -o ~/.config/fish/completions
The following commands will create your profile if it doesn't exist and append the completions to it. Only run it once as appending the completions twice will end up in errors.
touch $profile
iota generate-completions -s powershell >> $profile
In order to use Zsh completions, you must first install Oh My Zsh.
Then, install zsh-autocomplete
.
Finally, you can generate the completions file and install it using the following command:
iota generate-completions -s zsh -o ~/.oh-my-zsh/completions
To see the completions, restart the terminal session.