TronGrid CLI

trongrid-cli is a command-line interface for querying the TRON blockchain through TronGrid, with structured --json output for automation and scripts.

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-cli is currently published on npm: https://www.npmjs.com/package/trongrid-cli.

Install trongrid-cli

npm install -g trongrid-cli

Requires Node.js ≥ 22. The 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 latest --confirmed

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> --json

Related resources