---
title: Agent CLI
description: Run the repository CLI with explicit credentials, structured output and stable keys for retries.
---

From the repository root, run `pnpm agentsub --help`. Set AGENTSUB_API_URL and AGENTSUB_TOKEN for an authenticated connection.

Supported commands: init, whoami, balance, search, offer, voucher, topup, history, run and mcp. `--json` emits structured output; `--idempotency-key` preserves the request key across retries.

```sh
pnpm agentsub --json balance
pnpm agentsub --json search research
pnpm agentsub --idempotency-key retained-task-1 run <offer-id> '<operation-json>'
```

`pnpm agentsub mcp` starts the stdio MCP adapter using environment credentials; stdio authentication does not use the HTTP OAuth redirect flow.

[Local quickstart](/docs/quickstart) · [SDK](/docs/sdk).
