Documentation Index
Fetch the complete documentation index at: https://hedera-0c6e0218-feat-hip-1313-high-volume-entity-creation.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Scripting with Hiero CLI
Hiero CLI scripts let you run repeatable, end-to-end workflows for Hedera: creating accounts, transferring HBAR, creating tokens, submitting topic messages, and more. These scripts are designed to be non-interactive (safe for CI). Example scripts live in:- examples/scripts/*.sh
- shared helpers: examples/scripts/common/*
Prerequisites
- Node.js 18+
- Build the CLI or have a globally installed version of the CLI
- Provide your Hedera operator credentials. Export these environment variables:
Script structure (recommended pattern)
All example scripts follow the same layout:Step 1: Strict bash mode
-eexit immediately on error-uerror on undefined variables-opipefail fail if any command in a pipe fails
Step 2: Load helpers & Setup
Scripts load shared utilities from examples/scripts/common/. Typical helpers include:- structured log output (print_step, print_info, print_error)
- random alias generator (pick_random_name)
- sleep utilities (sleep_loop) to wait for mirror-node consistency
Step 3: hcli() wrapper (where automation begins)
From this point, scripts start executing real CLI commands.
- ensures commands run from the project root
- uses the built CLI entrypoint
- forces
--format jsonso scripts don’t depend on human formatting - prevents interactive prompts (better for CI / automation)
Quickstart script: create an account and view it
This is the smallest “real” end-to-end example:- configure network + operator
- create one account with 1 HBAR
- view account details
create-account-quickstart.sh with the below script contents: