paritytech / paritytech/polkadot-cli
Epic: Make polkadot-cli agent-ready
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 10
- Forks
- 2
- Avg merge
- 12h 35m
- Merged PRs (30d)
- 4
Description
Epic: Make polkadot-cli Agent-Ready
Problem
The dot CLI is well-built for human use, but AI agents and MCP server wrappers can't reliably consume its output. Only query and const support --output json — transaction output is spinner-based colored text, inspect/chain/account commands are text-only, and errors are unstructured strings. This makes the CLI unusable for programmatic automation without fragile text parsing.
Goal
Transform dot into the definitive tool for AI agents to investigate on-chain state, decode data, and orchestrate transactions on Polkadot — with structured, predictable output for every command.
Design Principles
- Structured, deterministic output is the highest-leverage change — an agent calling
dot tx ... --output jsonand getting back a JSON object withtxHash,status,eventscan operate autonomously - Errors are data, not messages — agents need
{"error":true,"code":"E_CONNECTION","message":"..."}to decide whether to retry or report - Introspection without prior knowledge — an agent that can
dot inspect --output jsonanddot decodecan figure out anything on any chain - Composability before new features — making existing commands machine-readable is more valuable than adding new ones
Sub-Issues
Phase 1 — Foundation (structured output everywhere)
- #64 —
--output jsonfortx,inspect,chain,accountcommands - #65 — Structured error output with error codes and context + granular exit codes
Phase 2 — New introspection commands
- #66 —
dot decodecommand for call data, storage values, events - #67 —
dot infocommand for chain identity (token, decimals, SS58 prefix, runtime version)
Phase 3 — Batch operations
- #68 — Batch query support via stdin JSON
Phase 4 — Real-time monitoring
- #69 —
dot watch blocks|storage|eventswith NDJSON streaming
Priority
Phase 1 is the foundation — everything else depends on it. Phase 2 adds high-value introspection. Phases 3-4 are efficiency and monitoring capabilities.
MCP Server Use Case
An MCP server wrapping this CLI would:
dot info --output jsonon startup to discover chain propertiesdot inspect --output jsonto enumerate pallets/calls/storagedot query ... --output jsonfor state readsdot tx ... --output jsonfor writes, parsing NDJSON for progressdot decode call 0x... --output jsonfor opaque hex data
All of this requires Phase 1 + Phase 2 to work.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the Phase 1 sub-issues, #64 and #65, since this epic identifies structured output and errors as prerequisites. Then use the later sub-issues (#66–#69) to understand the dependent scope; this epic is complete when the planned commands and error handling support predictable machine-readable operation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100