> ## Documentation Index
> Fetch the complete documentation index at: https://docs.polygon.technology/llms.txt
> Use this file to discover all available pages before exploring further.

# Get started with the Polygon Agent CLI

> Install the Polygon Agent CLI, connect a wallet with a $20 allowance, fund it, and make a first trade, previewing it before anything moves.

In this tutorial, you'll give the CLI a wallet with a \$20 allowance, add a few dollars of USDC, and swap \$1 of it. Along the way you'll see the two things every agent built on OMS relies on: a limit the person approves, and a preview before money moves. Everything in this tutorial is live.

You need Node.js 22 or later, a browser on the same computer, and a few dollars of USDC on Polygon in any wallet or exchange account.

**1. Install the CLI**

```bash theme={null}
npm install -g @polygonlabs/agent-cli
agent --version
```

You'll see the version number. The CLI is also available as `polygon-agent`.

**2. Connect a wallet with an allowance**

```bash theme={null}
agent wallet login --allowance 20 --days 7
```

A sign-in page opens in your browser. Sign in with your email or Google account. The page shows what you're approving: up to \$20 over 7 days for this install.

Back in the terminal, the CLI prints your wallet address and a dashboard link. The wallet is yours. The CLI holds only a key that can spend within the \$20.

**3. Check the connection**

```bash theme={null}
agent wallet status
```

Notice `connected: true`, `mode: "session"`, and the allowance you have left. Run this whenever you want to know where the agent stands.

**4. Add funds**

```bash theme={null}
agent fund
```

The dashboard opens with your wallet address. Send \$3 or more of USDC on Polygon to it. When it arrives, check:

```bash theme={null}
agent balances
```

You'll see the USDC in a table of tokens and amounts.

**5. Preview a swap**

```bash theme={null}
agent swap --from USDC --to USDT --amount 1 --dry-run
```

Nothing moves yet. The CLI shows a quote: what you'd sell, what you'd get at minimum, the fees, and when the quote expires. It also prints an `intentId` and the command to execute it.

**6. Execute the swap**

Run the command the preview printed, with your `intentId`:

```bash theme={null}
agent swap --intent <intentId> --broadcast
```

The swap goes through, and the CLI shows the transaction link. Run `agent balances` again to see about 1 USDT next to your USDC.

**7. See what's left of the allowance**

```bash theme={null}
agent wallet allowance
```

The swap came out of your \$20. When the allowance runs out or the 7 days end, the CLI asks you to sign in again before it spends more.

You've connected an agent to a wallet you own, limited what it can spend, and watched it preview and then execute a trade.

## Next

> [card] [Use it from your assistant](https://docs.polygon.technology/payment-services/agentic-payments/cli/assistants.md)
>
> Give Muse, Grok, Claude Code, or another assistant the same wallet.

> [card] [Move money](https://docs.polygon.technology/payment-services/agentic-payments/cli/move-money.md)
>
> Send, bridge, set price watches, and earn yield.
