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-cliis currently published on npm: https://www.npmjs.com/package/trongrid-cli.
Install
npm install -g trongrid-cliRequires 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 --confirmedFor 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> --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 about 4 hours ago