CLI

trongrid-cli is a command-line interface for querying the TRON blockchain through TronGrid, with a --json mode for AI agents and scripts.

Overview

trongrid-cli is a command-line interface for querying the TRON blockchain through TronGrid, designed for both human terminals and AI coding agents. 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

npm install -g trongrid-cli

Requires Node.js ≥ 22. The installed binary is trongrid.

Quick Start

# 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

For AI Agents and Scripts

The --json flag emits structured, machine-readable output suitable for piping into agents and scripts:

trongrid account view TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t --json
trongrid token balance USDT TMuA6YqfCeX8EhbfYEg5y7S4DqzSJireY9 --json
trongrid tx view <hash> --json

Related Resources