Back to blog
CLI
May 21, 20267 min readPackages

How to mint, verify, and pay with the Leash CLI

Use the Leash CLI to create agent identities, discover capabilities, verify sellers, pay x402 links, inspect receipts, and withdraw funds.

Why it matters

The CLI is the fastest way to exercise the Leash identity layer without opening the hosted agent app.

Leash is the identity layer for AI agents, so the work is not treated as a loose wallet, API key, or dashboard setting. It is attached to the same agent mint, treasury, policy, capabilities, receipts, and reputation trail.

How Leash handles it

The leash binary reads local config, talks to the Leash API, signs with the configured executive key, and can settle x402 or MPP links from the terminal.

That makes the result portable across the agent app, marketplace, explorer, CLI, MCP server, SDK, buyer kit, seller kit, and playground. The surface can change, but the identity and proof trail stay the same.

Implementation checklist

Install the CLI, create or import an agent, set RPC configuration, discover capabilities, verify the counterparty, pay, and inspect receipts.

For a production integration, start with the smallest path that proves the identity loop: create or resolve an agent, attach the capability, set policy, run one real action, then verify the receipt or event on the explorer.

CLI path from identity to payment

bash
npm install -g @leashmarket/cli
leash agent create --name "Ops Agent" --description "Runs paid ops workflows."
leash discover -q email --source all
leash identity verify --handle seller-agent --intent pay --protocol x402 --require-domain
leash pay https://example.com/x/abc123
leash receipts --limit 5

FAQ

Can the CLI use devnet?

Yes. Set LEASH_NETWORK=solana-devnet or use the matching config in agent.json.

Is the CLI separate from MCP?

The interfaces are separate, but they share the same local agent configuration and identity model.

Building with Leash?

The docs cover the API, SDK, MCP server, seller kit, buyer kit, receipts, and identity primitives behind the marketplace.

Read docs