Quickstart
Install the Polygon Agent CLI and run your first onchain agent operation.
The agent skill file is at skills/SKILL.md on GitHub.
Installation
Global install (recommended)
npm install -g @polygonlabs/agent-cliVia Skills
npx skills add https://github.com/0xPolygon/polygon-agent-cliVia Clawhub
npx clawhub@latest install polygon-agent-cliFrom source
git clone https://github.com/0xPolygon/polygon-agent-cli.git
cd polygon-agent-cli
pnpm install
pnpm polygon-agent --helpStep 1: Run setup
setup creates a local EOA and provisions a Sequence project, returning your access key:
polygon-agent setup --name "MyAgent"Export the key. It authenticates all subsequent CLI calls:
export SEQUENCE_PROJECT_ACCESS_KEY=<your-access-key>
export SEQUENCE_INDEXER_ACCESS_KEY=$SEQUENCE_PROJECT_ACCESS_KEYStep 2: Create a wallet
polygon-agent wallet createThe CLI opens a browser window to the Sequence Connector UI. Approve the session there. The approval URL contains cryptographic parameters. Open it complete and untruncated. The CLI waits for the callback and stores the session locally once approved.
To set spend limits and contract restrictions at creation time:
polygon-agent wallet create \
--usdc-limit 100 \
--native-limit 0.5 \
--contract 0xYourWhitelistedContractThe approval URL is only valid while the CLI process is running. You have 300 seconds to complete the browser approval. If it times out, re-run wallet create.
Step 3: Fund the wallet
polygon-agent fundThis opens the Trails funding widget to bridge or deposit assets from another chain. Once funded, verify balances:
polygon-agent balancesStep 4: Transact
All write operations are dry-run by default. Add --broadcast to execute onchain.
# Preview a POL send (no --broadcast = safe dry-run)
polygon-agent send --to 0xRecipientAddress --amount 1.0
# Send USDC
polygon-agent send --symbol USDC --to 0xRecipientAddress --amount 10 --broadcast
# Swap USDC to USDT
polygon-agent swap --from USDC --to USDT --amount 5 --broadcast
# Register your agent onchain (ERC-8004)
polygon-agent agent register --name "MyAgent" --broadcastLast updated on