Introduction to Hiero CLI
The Hiero CLI is a command‑line interface that offers a simple way to interact with the Hedera network. It consolidates many common network operations into easy-to‑use commands so you can:- Test your Hedera applications quickly.
- Automate repetitive tasks without writing bulky code.
- Simplify key management, letting you focus on building and scaling your solutions.
Getting Started
Prerequisites:- Node.js installation: LTS 16.20.2 or higher
- Hedera Account (for mainnet, testnet, or previewnet) or Hedera Local Node (for localnet)
hcli command:
First-time setup (Initialization):
When you run any command that requires an operator (like transferring HBAR or creating tokens) in interactive mode, the CLI will automatically launch an initialization wizard to guide you through configuring the operator account, private key, and settings. In script mode (non-interactive), an error will be thrown instead, requiring you to usehcli network set-operator to configure the operator first.Manual Setup (Build custom plugins)
Manual Setup (Build custom plugins)
Manual Setup (For Developers)
If you want to contribute to the development of the Hiero CLI or create your own version or plugins, follow these instructions.Prerequisites- Node.js installation: LTS 16.20.2 or higher
- Hedera Account (for mainnet, testnet, or previewnet) or Hedera Local Node (for localnet)
- Git
- Load all default plugins from
dist/plugins/ - Initialize the Core API with the selected output format
- Register all plugin commands
- Use testnet as the default network
- macOS / Linux (bash/zsh)
- Windows (PowerShell)
Add the following line to your Then reload your shell:
~/.bashrc, ~/.bash_profile, or ~/.zshrc:Global Flags
These flags are available on all Hiero CLI commands. They control output, help, and versioning, regardless of the specific plugin or command you’re using.--format <type>: Controls how command output is formatted.
Supported valueshuman(default) orjsonfor machine-readable output.-h, --help: Displays help information for a command.-V, --version: Outputs the installed Hiero CLI version.
Plugins Overview
Credentials Plugin
Manage operator credentials and keys
Network Plugin
Switch networks, manage operator credentials, and check network health
HBAR Plugin
Transfer HBAR between accounts
Account Plugin
Create, import, manage accounts, and view balances
Token Plugin
Create, associate, and transfer tokens
Topic Plugin
Create topics and manage topic messages
Config Plugin
Inspect and update CLI configuration values
Plugin Management Plugin
Add, remove, enable/disable, and inspect plugins
Scripting
Once you’re familiar with the available CLI commands, you can take the next step with scripting. Scripting is especially useful for CI/CD pipelines, setting up test environments, and automating repeated workflows.Scripting Quickstart
Learn how to create your first script using Hiero CLI commands.