TronGrid CLI
Query TRON accounts, tokens, transactions, and blocks with TronGrid CLI, including JSON output for scripts and automation.
TronGrid CLI query scope
trongrid-cli is a command-line interface for querying the TRON blockchain through TronGrid. It supports interactive terminal use and automation workflows. It currently covers read-side queries (accounts, tokens, transactions, blocks, and more); write-side and governance commands are planned for later releases.
The CLI talks to the same TronGrid endpoints as the HTTP API, so it shares the same networks (mainnet, Shasta, Nile), API keys, and rate limits.
Distribution
trongrid-cliis currently published on npm: https://www.npmjs.com/package/trongrid-cli.
Install trongrid-cli
The CLI requires Node.js ≥22. Choose a supported LTS release and install its latest patch before installing the CLI:
npm install -g trongrid-cliThe installed binary is trongrid.
Configure a network and run a query
# Configure an API key (free tier works without one, at lower rate limits)
trongrid auth login
# Default network is mainnet; use --network shasta or --network nile for testnets
trongrid account view TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t
trongrid block latestIn trongrid-cli 0.1.2, block latest calls /wallet/getnowblock to query the current chain head. It does not support using --confirmed to query the latest solidified block. To retrieve that block, call /walletsolidity/getnowblock.
Structured JSON output
The --json flag emits structured, machine-readable output suitable for piping into automation tools or scripts:
trongrid account view TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t --json
trongrid token balance USDT TMuA6YqfCeX8EhbfYEg5y7S4DqzSJireY9 --json
trongrid tx view <hash> --jsonRelated resources
- MCP server — connect AI clients to TRON via the Model Context Protocol
- AI agent skills — pre-built natural-language workflows
- TronGrid V1 API overview — the underlying API reference
Updated 3 days ago