Skip to content

[good first issue] Enrich 'info' command: chains, contracts, subcommand inventory (JSON) #5

@abhicris

Description

@abhicris

Context

commands::info and --help output are the first thing most agents see. Today Info is a stub and doesn't show supported chains + contract addresses (Create Protocol AgentDeposit, USDC, etc.). A richer info command that emits a machine-parseable inventory of chains / contracts / subcommands is useful for both humans and for MCP-style tool discovery (related to #1).

Scope

  • Fill out commands::info in src/commands.rs to emit JSON with:
    • chains: list of supported chains (currently just Arbitrum + Arbitrum Sepolia — start with that but make the list a constant that's easy to extend).
    • For each chain: chain_id, name, rpc_default, explorer, contracts: {usdc, agent_deposit, uniswap_v3_quoter}.
    • subcommands: array of {name, description, args: [...]}. You can introspect this from clap's CommandFactory — see clap::CommandFactory::command().
    • version from env!("CARGO_PKG_VERSION").
  • For --human output, print a nicely-formatted table.

Acceptance criteria

  • arbitrum-cli info returns JSON.
  • arbitrum-cli info --human prints a readable summary.
  • Test that at least chains[0].chain_id == 42161 and the subcommand list includes every Commands variant.
  • No hardcoded subcommand names — must come from clap reflection so new subcommands auto-appear.

Reference: src/main.rs::Commands for the enum; clap introspection docs; the AgentDeposit command landed in PR #2 shows the contract-address constants pattern.

Estimated effort

S (2–3 hours)

kcolbchain / Abhishek Krishna

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions