Documentation Index
Fetch the complete documentation index at: https://hedera-0c6e0218-514-egress-ports.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
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: 18.0.0 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 (For Developers)
Manual Setup (For Developers)
Manual Setup (For Developers)
If you want to contribute to the development of the Hiero CLI or run it from source, follow these instructions.Prerequisites- Node.js installation: 18.0.0 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 options are defined on the roothcli program (see hcli --help). They work together with each command’s own flags.
--format <type>: Output format:human(default) orjsonfor machine-readable output.-N, --network <network>: Target network:testnet,mainnet,previewnet, orlocalnet. Runs the command against this network without necessarily changing your saved default (see the Network plugin for switching defaults).-P, --payer <payer>: Payer for transactions in this command: account alias, oraccount-id:private-keyformat. Overrides the default operator as payer when supported by the command.--confirm: Skip interactive confirmation prompts for commands that would otherwise ask for confirmation (for example, some delete operations).-h, --help: Show help for the current command.-V, --version: Print the installed Hiero CLI version.
Configuration and State
Runtime state (accounts, tokens, operator settings, and other plugin data) is stored under your home directory by default:- Default directory:
~/.hiero-cli/state/
local— keys stored in plain text in the state directory (typical for development)local_encrypted— keys encrypted with AES-256-GCM before storage (stronger protection)
--key-manager where the command supports it (for example account import or network set-operator). Details are covered in the plugin reference pages.
Local Hedera Network (Localnet)
To use the CLI against a local Hedera node, configure an operator forlocalnet and select that network. Default connection settings shipped with the CLI match the usual local node layout (see src/core/services/network/network.config.ts in the Hiero CLI repository).
Example:
Plugins Overview
The CLI loads a fixed set of default plugins. The pages below document the shipped plugins and their CLI commands.Network Plugin
Switch networks, manage operator credentials, and check network health
Credentials Plugin
Manage operator credentials and keys
Account Plugin
Create, import, manage accounts, and view balances
HBAR Plugin
Transfer HBAR between accounts
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
Batch Plugin
Create, execute, list, and delete batches of Hedera transactions
Schedule Plugin
Create, sign, delete, and verify Hedera scheduled transactions
Contract Plugin
Compile, deploy, import, list, and delete Solidity smart contracts
Contract ERC-20 Plugin
Call ERC-20 view and state-changing functions on deployed contracts
Contract ERC-721 Plugin
Call ERC-721 view and state-changing functions on deployed NFT contracts
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.