hiero-cli (hcli)
hcli is a command-line tool for interacting with the Hedera blockchain — managing accounts, tokens (FT/NFT), smart contracts, consensus topics, and network configuration.
Binary syntax
hcli <plugin> <command> [options]
Global flags
| Flag |
Short |
Default |
Description |
--format |
-F |
human |
Output format: human or json |
--network |
-N |
active |
Override active network for this command |
--payer |
-P |
operator |
Override payer account for this command; defaults to operator if omitted |
--confirm |
-Y |
false |
Skip all confirmation prompts |
Prerequisites
Before executing blockchain commands:
- Configure network:
hcli network use --global testnet
- Set operator:
hcli network set-operator --operator <accountId>:<privateKey>
Key formats
Keys and signers accept multiple formats:
{accountId}:{privateKey} — inline pair, e.g. 0.0.123:abc123...
{ed25519|ecdsa}:private:{hex} — raw private key with type prefix
{ed25519|ecdsa}:public:{hex} — raw public key (for supply/submit keys)
kr_xxx — key reference stored in KMS
- account alias — name registered in local state
Local state storage
State is persisted in ~/.hiero-cli/state/ as JSON files, one per plugin namespace:
| Plugin |
File |
account |
account-accounts-storage.json |
token |
token-tokens-storage.json |
topic |
topic-topics-storage.json |
batch |
batch-batches-storage.json |
swap |
swap-storage.json |
contract |
contract-contracts-storage.json |
schedule |
schedule-transactions-storage.json |
network |
network-config-storage.json |
config |
config-storage.json |
plugin-management |
plugin-management-storage.json |
credentials (KMS) |
kms-credentials-storage.json, kms-secrets-encrypted-storage.json |
Amount notation
"1" = 1 display unit (e.g. 1 HBAR, or 1 token with decimals applied)
"100t" = 100 base/raw units (tinybars for HBAR, smallest token unit)
Plugin catalog
| Plugin |
Description |
Tasks covered |
account |
Manage Hedera accounts |
create, import, balance, list, view, update, delete, clear |
hbar |
Transfer HBAR |
transfer HBAR, approve/revoke HBAR allowance |
token |
Manage FT & NFT tokens |
create-ft/nft, create-from-file, mint, burn, wipe, transfer, airdrop, associate, dissociate, freeze/unfreeze, pause/unpause, grant/revoke KYC, allowance (FT/NFT), delete-allowance-nft, update-metadata-nft, pending-airdrops, cancel/claim/reject-airdrop, list, view, import, delete |
topic |
Hedera Consensus Service |
create, update, submit/find messages, import, list, delete |
schedule |
Scheduled transactions |
create schedule record, sign pending schedule, delete schedule, verify execution state. Use --scheduled <name> (-X) only on commands marked [scheduled] in the plugin reference |
contract |
Smart contract lifecycle |
compile + deploy Solidity, import, list, delete |
contract-erc20 |
ERC-20 contract calls |
name, symbol, decimals, balanceOf, transfer, transferFrom, approve, allowance, totalSupply. Requires contract plugin (contract must be deployed first) |
contract-erc721 |
ERC-721 contract calls |
balanceOf, ownerOf, approve, setApprovalForAll, safeTransferFrom, transferFrom, mint, name, symbol, tokenURI, getApproved, isApprovedForAll. Requires contract plugin (contract must be deployed first) |
network |
Network configuration |
list networks, switch network, set/get operator |
config |
CLI configuration |
list, get, set config options |
credentials |
Key/credentials management |
generate new key, import existing key, list, remove stored credentials (by id or alias) |
batch |
Batch transactions |
create batch, add transactions, execute, list, delete |
swap |
Multi-party asset exchange |
create swap, add HBAR/FT/NFT transfers, view, list, execute, delete |
eip712 |
EIP-712 typed data signing |
hash compute digest, sign-ecdsa / sign-ed25519 sign payload (accepts pre-computed hash or domain+types+message), verify-ecdsa recover signer EVM address, verify-ed25519 verify Ed25519 signature against a public key |
plugin-management |
Plugin lifecycle |
add, remove, enable, disable, list, reset, info |
Agent instruction
Before executing any command, read references/<plugin>.md for the full command spec, all options, and examples.
Example: to use hcli token create-ft, first read references/token.md.
When working with batch commands, read both references/batch.md AND the reference for the plugin being batched.
Example: to batch hcli token mint-ft, read both references/batch.md and references/token.md.
When working with scheduled transactions, read references/schedule.md AND the reference for the command being scheduled.
Only commands marked [scheduled] in their reference support --scheduled <name> / -X.
Example: to schedule hcli token burn-ft, read both references/schedule.md and references/token.md.
hcli not found / not installed
If any hcli command fails with a "command not found" or similar error, tell the user:
hcli is not installed or not available in PATH.
Docs & quick start: https://www.npmjs.com/package/@hiero-ledger/hiero-cli#quick-start
Install with:
npm install -g @hiero-ledger/hiero-cli
Would you like me to run the install command for you?
Do not run the install automatically — wait for the user's confirmation.
Operator not configured
If a command fails with CLI operator is not configured or similar:
- Inform the user the operator must be set before running any blockchain command
- Guide them:
hcli network set-operator --operator <accountId>:<privateKey>
- Retry the original command after operator is set
Disabled plugin recovery
If a command fails with Plugin 'X' is disabled.:
- Inform the user that the plugin is disabled
- Offer to enable it:
hcli plugin-management enable --name X
- Retry the original command after enabling
Common workflows
Setup (first time)
hcli network use --global testnet
hcli network set-operator --operator 0.0.12345:302e...privatekey...
Create fungible token and transfer
# 1. Create token
hcli token create-ft --token-name "MyToken" --symbol MTK --decimals 2 --initial-supply 1000000
# 2. Associate recipient account
hcli token associate --token MTK --account 0.0.67890:302e...key...
# 3. Transfer tokens
hcli token transfer-ft --token MTK --to 0.0.67890 --amount 100
Deploy ERC-20 contract and interact
# 1. Deploy built-in ERC-20 template
hcli contract create --name myErc20 --default erc20 --constructor-parameter "MyToken" --constructor-parameter "MTK"
# 2. Check balance
hcli contract-erc20 balance-of --contract myErc20 --account 0.0.12345
# 3. Transfer via contract
hcli contract-erc20 transfer --contract myErc20 --to 0.0.67890 --value 50
Batch multiple token mints
# 1. Create batch
hcli batch create --name mintBatch --key 0.0.12345:302e...key...
# 2. Add transactions to batch (using --batch flag on batchify-compatible commands)
hcli token mint-ft --token MTK --amount 1000 --supply-key 0.0.12345:302e...key... --batch mintBatch
# 3. Execute batch
hcli batch execute --name mintBatch
Source: hiero-ledger/hiero-cli — distributed by TomeVault.
1---2name: hiero-ledger-hiero-cli-hiero-cli3description: hiero-cli (hcli)4---56# hiero-cli (hcli)78`hcli` is a command-line tool for interacting with the Hedera blockchain — managing accounts, tokens (FT/NFT), smart contracts, consensus topics, and network configuration.910## Binary syntax1112```13hcli <plugin> <command> [options]14```1516## Global flags1718| Flag | Short | Default | Description |19| ----------- | ----- | -------- | ------------------------------------------------------------------------ |20| `--format` | `-F` | `human` | Output format: `human` or `json` |21| `--network` | `-N` | active | Override active network for this command |22| `--payer` | `-P` | operator | Override payer account for this command; defaults to operator if omitted |23| `--confirm` | `-Y` | `false` | Skip all confirmation prompts |2425## Prerequisites2627Before executing blockchain commands:28291. Configure network: `hcli network use --global testnet`302. Set operator: `hcli network set-operator --operator <accountId>:<privateKey>`3132## Key formats3334Keys and signers accept multiple formats:3536- `{accountId}:{privateKey}` — inline pair, e.g. `0.0.123:abc123...`37- `{ed25519|ecdsa}:private:{hex}` — raw private key with type prefix38- `{ed25519|ecdsa}:public:{hex}` — raw public key (for supply/submit keys)39- `kr_xxx` — key reference stored in KMS40- account alias — name registered in local state4142## Local state storage4344State is persisted in `~/.hiero-cli/state/` as JSON files, one per plugin namespace:4546| Plugin | File |47| ------------------- | -------------------------------------------------------------------- |48| `account` | `account-accounts-storage.json` |49| `token` | `token-tokens-storage.json` |50| `topic` | `topic-topics-storage.json` |51| `batch` | `batch-batches-storage.json` |52| `swap` | `swap-storage.json` |53| `contract` | `contract-contracts-storage.json` |54| `schedule` | `schedule-transactions-storage.json` |55| `network` | `network-config-storage.json` |56| `config` | `config-storage.json` |57| `plugin-management` | `plugin-management-storage.json` |58| `credentials` (KMS) | `kms-credentials-storage.json`, `kms-secrets-encrypted-storage.json` |5960## Amount notation6162- `"1"` = 1 display unit (e.g. 1 HBAR, or 1 token with decimals applied)63- `"100t"` = 100 base/raw units (tinybars for HBAR, smallest token unit)6465## Plugin catalog6667| Plugin | Description | Tasks covered |68| ------------------- | -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |69| `account` | Manage Hedera accounts | create, import, balance, list, view, update, delete, clear |70| `hbar` | Transfer HBAR | transfer HBAR, approve/revoke HBAR allowance |71| `token` | Manage FT & NFT tokens | create-ft/nft, create-from-file, mint, burn, wipe, transfer, airdrop, associate, dissociate, freeze/unfreeze, pause/unpause, grant/revoke KYC, allowance (FT/NFT), delete-allowance-nft, update-metadata-nft, pending-airdrops, cancel/claim/reject-airdrop, list, view, import, delete |72| `topic` | Hedera Consensus Service | create, update, submit/find messages, import, list, delete |73| `schedule` | Scheduled transactions | create schedule record, sign pending schedule, delete schedule, verify execution state. Use `--scheduled <name>` (`-X`) only on commands marked `[scheduled]` in the plugin reference |74| `contract` | Smart contract lifecycle | compile + deploy Solidity, import, list, delete |75| `contract-erc20` | ERC-20 contract calls | name, symbol, decimals, balanceOf, transfer, transferFrom, approve, allowance, totalSupply. **Requires `contract` plugin** (contract must be deployed first) |76| `contract-erc721` | ERC-721 contract calls | balanceOf, ownerOf, approve, setApprovalForAll, safeTransferFrom, transferFrom, mint, name, symbol, tokenURI, getApproved, isApprovedForAll. **Requires `contract` plugin** (contract must be deployed first) |77| `network` | Network configuration | list networks, switch network, set/get operator |78| `config` | CLI configuration | list, get, set config options |79| `credentials` | Key/credentials management | generate new key, import existing key, list, remove stored credentials (by id or alias) |80| `batch` | Batch transactions | create batch, add transactions, execute, list, delete |81| `swap` | Multi-party asset exchange | create swap, add HBAR/FT/NFT transfers, view, list, execute, delete |82| `eip712` | EIP-712 typed data signing | `hash` compute digest, `sign-ecdsa` / `sign-ed25519` sign payload (accepts pre-computed hash or domain+types+message), `verify-ecdsa` recover signer EVM address, `verify-ed25519` verify Ed25519 signature against a public key |83| `plugin-management` | Plugin lifecycle | add, remove, enable, disable, list, reset, info |8485## Agent instruction8687**Before executing any command, read `references/<plugin>.md` for the full command spec, all options, and examples.**8889Example: to use `hcli token create-ft`, first read `references/token.md`.9091**When working with batch commands, read both `references/batch.md` AND the reference for the plugin being batched.**9293Example: to batch `hcli token mint-ft`, read both `references/batch.md` and `references/token.md`.9495**When working with scheduled transactions, read `references/schedule.md` AND the reference for the command being scheduled.**9697Only commands marked **[scheduled]** in their reference support `--scheduled <name>` / `-X`.9899Example: to schedule `hcli token burn-ft`, read both `references/schedule.md` and `references/token.md`.100101## hcli not found / not installed102103If any `hcli` command fails with a "command not found" or similar error, tell the user:104105> `hcli` is not installed or not available in PATH.106> Docs & quick start: https://www.npmjs.com/package/@hiero-ledger/hiero-cli#quick-start107>108> Install with:109>110> ```111> npm install -g @hiero-ledger/hiero-cli112> ```113>114> Would you like me to run the install command for you?115116Do not run the install automatically — wait for the user's confirmation.117118## Operator not configured119120If a command fails with `CLI operator is not configured` or similar:1211221. Inform the user the operator must be set before running any blockchain command1232. Guide them: `hcli network set-operator --operator <accountId>:<privateKey>`1243. Retry the original command after operator is set125126## Disabled plugin recovery127128If a command fails with `Plugin 'X' is disabled.`:1291301. Inform the user that the plugin is disabled1312. Offer to enable it: `hcli plugin-management enable --name X`1323. Retry the original command after enabling133134## Common workflows135136### Setup (first time)137138```bash139hcli network use --global testnet140hcli network set-operator --operator 0.0.12345:302e...privatekey...141```142143### Create fungible token and transfer144145```bash146# 1. Create token147hcli token create-ft --token-name "MyToken" --symbol MTK --decimals 2 --initial-supply 1000000148149# 2. Associate recipient account150hcli token associate --token MTK --account 0.0.67890:302e...key...151152# 3. Transfer tokens153hcli token transfer-ft --token MTK --to 0.0.67890 --amount 100154```155156### Deploy ERC-20 contract and interact157158```bash159# 1. Deploy built-in ERC-20 template160hcli contract create --name myErc20 --default erc20 --constructor-parameter "MyToken" --constructor-parameter "MTK"161162# 2. Check balance163hcli contract-erc20 balance-of --contract myErc20 --account 0.0.12345164165# 3. Transfer via contract166hcli contract-erc20 transfer --contract myErc20 --to 0.0.67890 --value 50167```168169### Batch multiple token mints170171```bash172# 1. Create batch173hcli batch create --name mintBatch --key 0.0.12345:302e...key...174175# 2. Add transactions to batch (using --batch flag on batchify-compatible commands)176hcli token mint-ft --token MTK --amount 1000 --supply-key 0.0.12345:302e...key... --batch mintBatch177178# 3. Execute batch179hcli batch execute --name mintBatch180```181182---183> Source: [hiero-ledger/hiero-cli](https://github.com/hiero-ledger/hiero-cli) — distributed by [TomeVault](https://tomevault.io).184<!-- tomevault:4.0:skill_md:2026-06-18 -->