use-agent-wallet
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOverview
概述
The Circle CLI (, command ) provides a programmatic agent wallet — a non-custodial USDC wallet designed for AI agents to authenticate, hold balances, and pay for paid x402 services on Circle's marketplace. This skill is the bootstrap surface for that wallet: install check, terms acceptance, login, wallet creation, and status inspection. After bootstrap completes, downstream operations (paying for services, funding, spending policy) hand off to dedicated skills.
@circle-fin/clicircleFor an overview of the Circle CLI's full capability set — bridging, smart contract execution, transaction inspection, and more — see the master skill. This skill is the narrower bootstrap/identity surface.
use-circle-cliThis skill is for the CLI agent-wallet flow.
Circle CLI(,命令为)提供了一个程序化Agent钱包——这是一个非托管式USDC钱包,专为AI Agent设计,用于在Circle市场中进行身份验证、存储余额以及支付付费x402服务。本技能是该钱包的初始化入口,涵盖安装检查、服务条款接受、登录、钱包创建和状态检查。初始化完成后,下游操作(如支付服务、充值、消费策略)将移交至专用技能处理。
@circle-fin/clicircle如需了解Circle CLI的完整功能集——包括跨链桥接、智能合约执行、交易查询等,请查看主技能。本技能仅专注于钱包的初始化与身份验证环节。
use-circle-cli本技能适用于CLI端的Agent钱包流程。
Prerequisites / Setup
前置条件/设置
Step 1 — Verify the CLI is installed
步骤1 — 验证CLI已安装
bash
which circle || command -v circle
circle --versionIf not installed:
bash
npm install -g @circle-fin/clicircle --versionnpm install -g @circle-fin/cli@latestbash
which circle || command -v circle
circle --version若未安装:
bash
npm install -g @circle-fin/cli当有新版本CLI可用时,还会显示Circle服务器推送的更新通知(由服务器驱动,不会阻塞操作)。若显示通知,建议用户使用更新——但仅在上下文相关时提出(例如会话开始时或命令产生意外输出时)。不要在每次常规命令执行时都进行版本检查。
circle --versionnpm install -g @circle-fin/cli@latestStep 2 — Check session status
步骤2 — 检查会话状态
Always check whether the user is already logged in before attempting login.
bash
circle wallet statusPossible outcomes:
- Logged in — output shows email, wallet type (), and session expiry. Tell the user "You're already logged in as
agent. Continue with this session?" and skip to Step 4.<email> - Not logged in — output is Proceed to Step 3.
Error: Not logged in. Run 'circle wallet login <email> --type agent' to authenticate. - Terms not accepted — output is Stop and complete the Terms-of-Use Gate below before proceeding. Do NOT run
Error: Circle CLI Terms acceptance is required before use.without explicit user consent.circle terms accept
在尝试登录前,务必先检查用户是否已登录。
bash
circle wallet status可能的结果:
- 已登录 — 输出显示邮箱、钱包类型()和会话过期时间。告知用户“您已以
agent身份登录。是否继续使用此会话?”,并跳转至步骤4。<email> - 未登录 — 输出为,继续执行步骤3。
Error: Not logged in. Run 'circle wallet login <email> --type agent' to authenticate. - 未接受服务条款 — 输出为,先完成下方的服务条款确认环节,之后再继续。未经用户明确同意,不得执行
Error: Circle CLI Terms acceptance is required before use.。circle terms accept
Step 3 — Login (email + OTP, two-step non-interactive flow)
步骤3 — 登录(邮箱+OTP,两步非交互式流程)
Circle's CLI supports a two-step OTP login designed for AI agents and other non-interactive contexts.
Circle CLI支持专为AI Agent和其他非交互式场景设计的两步OTP登录流程。
3a. Initialize login (request OTP)
3a. 初始化登录(请求OTP)
Ask the user for their email address (do NOT guess or hardcode). Then:
bash
circle wallet login <user-email> --type agent --init--type agentagentExpected output:
OTP code sent to user@example.com
Please run: circle wallet login --request <request-id> --otp <code>Parse the request ID from the output. It is a UUID; you will need it for the next step. Request IDs expire after 10 minutes and are single-use.
向用户索要邮箱地址(不得猜测或硬编码)。然后执行:
bash
circle wallet login <user-email> --type agent --init--type agentagent预期输出:
OTP code sent to user@example.com
Please run: circle wallet login --request <request-id> --otp <code>从输出中解析出请求ID,它是一个UUID,后续步骤会用到。请求ID有效期为10分钟,且仅可使用一次。
3b. Complete login (verify OTP)
3b. 完成登录(验证OTP)
Tell the user: "An OTP code has been sent to your email. Please share it (format: ABC-123456 or just the 6 digits)." If email- or messaging-integration tools are connected (e.g., Gmail or Slack via MCP), the OTP can also be fetched through them — note the option to the user; how to share it is their call. Then:
bash
circle wallet login --type agent --request <request-id> --otp <user-otp>OTP format notes:
- Full form:
ABC-123456 - Bare digits: — the CLI prepends the cached prefix automatically
123456 - The CLI validates the prefix matches what was sent (anti-phishing)
If successful, output is:
Logged in as user@example.comTell the user "Successfully logged in" and continue. If the call fails (, , ), restart from 3a to generate a fresh OTP — do NOT loop without telling the user.
Invalid or expired request IDOTP prefix mismatchInvalid OTP告知用户:“OTP验证码已发送至您的邮箱,请提供验证码(格式:ABC-123456或仅6位数字)。”若已连接邮箱或消息集成工具(如通过MCP连接的Gmail或Slack),也可通过这些工具获取OTP——向用户说明该选项,由用户决定如何提供验证码。然后执行:
bash
circle wallet login --type agent --request <request-id> --otp <user-otp>OTP格式说明:
- 完整格式:
ABC-123456 - 纯数字:— CLI会自动添加缓存的前缀
123456 - CLI会验证前缀与发送的是否一致(防钓鱼)
登录成功后,输出为:
Logged in as user@example.com告知用户“登录成功”并继续。若调用失败(如、、),从3a步骤重新生成新的OTP——不得在未告知用户的情况下循环重试。
Invalid or expired request IDOTP prefix mismatchInvalid OTP3c. Verify session
3c. 验证会话
bash
circle wallet statusConfirms the session and surfaces expiry. Proceed to Step 4.
bash
circle wallet status确认会话状态并显示过期时间,继续执行步骤4。
Logging out / switching accounts
登出/切换账户
bash
circle wallet logoutUse only when the user explicitly asks to switch accounts.
bash
circle wallet logout仅当用户明确要求切换账户时使用此命令。
Step 4 — Check or create the agent wallet
步骤4 — 检查或创建Agent钱包
The flag is REQUIRED for and . Use BASE as the default if the user hasn't specified a chain.
--chaincircle wallet listcircle wallet balancebash
circle wallet list --chain BASE --type agent --output jsonIf wallets already exist, save the address(es) for the next step.
If no agent wallets exist:
bash
circle wallet create --output jsonCreates agent-controlled SCA wallets on each supported EVM chain. The JSON output is an array of objects — read the field to save per-chain addresses for Step 5.
{ chain, address, ... }address**和命令必须传入参数。**若用户未指定链,默认使用BASE链。
circle wallet listcircle wallet balance--chainbash
circle wallet list --chain BASE --type agent --output json若钱包已存在,保存地址用于下一步。
若不存在Agent钱包:
bash
circle wallet create --output json该命令会在每个支持的EVM链上创建由Agent控制的SCA钱包。JSON输出是一个包含对象的数组——读取字段,保存各链地址用于步骤5。
{ chain, address, ... }addressStep 5 — Check wallet balance
步骤5 — 检查钱包余额
Use the address(es) from Step 4:
bash
circle wallet balance --address <addr> --chain BASE --output jsonIf balance is 0 USDC and the user wants to pay for services, hand off to the skill — it covers built-in fiat on-ramp purchase, direct address transfer with a QR code, and Gateway deposits.
fund-agent-walletIf the user only wants to verify state (not pay yet), stop here. Bootstrap is complete.
使用步骤4中获取的地址:
bash
circle wallet balance --address <addr> --chain BASE --output json若USDC余额为0且用户想要支付服务费用,移交至技能处理——该技能涵盖内置法币入金购买、二维码直接转账和网关存款等功能。
fund-agent-wallet若用户仅需验证状态(暂不支付),流程到此结束,初始化完成。
After bootstrap
初始化完成后
Once the wallet exists, the user's likely next move is to use it. The CLI exposes its own skill catalog — shows what's installable, shows trigger and frontmatter detail, and installs one for the current host. Suggest natural follow-ups like funding, paid-service search, or setting a spending limit; prefer permissionless actions (balance, search) over money-moving ones until the user asks.
circle skill listcircle skill info --name <skill>circle skill install --tool <host> --name <skill>钱包创建完成后,用户接下来可能会使用它。CLI提供了自身的技能目录——显示可安装的技能,显示触发条件和详情,为当前主机安装技能。建议用户进行后续操作,如充值、搜索付费服务或设置消费限额;在用户主动要求前,优先选择无需权限的操作(如查询余额、搜索服务),而非涉及资金转移的操作。
circle skill listcircle skill info --name <skill>circle skill install --tool <host> --name <skill>Terms-of-Use Gate
服务条款确认环节
The Circle CLI hard-gates every operational command (including ) until the user has accepted Circle's Terms of Use and Privacy Policy on this machine. The gate surfaces as:
circle walletcircle wallet statusBy using the Circle CLI, you agree to:
Terms of Use: https://agents.circle.com/terms-of-use
Privacy Policy: https://www.circle.com/legal/privacy-policy
Error: Circle CLI Terms acceptance is required before use.
Hint: Set CIRCLE_ACCEPT_TERMS=1 to accept in non-interactive shells (CI, scripts, sandboxed agents).Run this section the first time the gate appears (typically during Step 2 or Step 3 above). After acceptance is recorded once, the gate is a no-op and this section is skipped on subsequent runs.
CRITICAL: The agent MUST show the Terms to the user and obtain explicit consent BEFORE running . The agent MUST NEVER accept Circle's Terms of Use or Privacy Policy on the user's behalf. The CLI's env-var hint is NOT a workaround the agent may take on its own — ignore it and use the consent flow below.
circle terms acceptCIRCLE_ACCEPT_TERMS=1在用户接受Circle的服务条款和隐私政策之前,Circle CLI会阻止所有操作命令(包括)。该限制会显示如下内容:
circle walletcircle wallet statusBy using the Circle CLI, you agree to:
Terms of Use: https://agents.circle.com/terms-of-use
Privacy Policy: https://www.circle.com/legal/privacy-policy
Error: Circle CLI Terms acceptance is required before use.
Hint: Set CIRCLE_ACCEPT_TERMS=1 to accept in non-interactive shells (CI, scripts, sandboxed agents).首次出现该限制时(通常在步骤2或步骤3中)执行本环节。一旦记录用户已接受,后续运行时该限制将自动失效,本环节将被跳过。
重要提示:Agent必须向用户展示条款并获得明确同意后,方可执行。Agent绝不能代表用户接受Circle的服务条款或隐私政策,也绝不能自行使用CLI的环境变量提示作为变通方案——忽略该提示,使用下方的同意流程。
circle terms acceptCIRCLE_ACCEPT_TERMS=1Read current acceptance status
查看当前接受状态
bash
circle terms show --output jsonIf is , the user has already accepted on this machine. Return to the step that triggered this section.
data.acceptedtruebash
circle terms show --output json若为,说明用户已在本机接受条款,返回触发本环节的步骤。
data.acceptedtrueFetch the Terms info to present to the user
获取条款信息并展示给用户
When is :
data.acceptedfalsebash
circle terms show --init --output jsonThe response includes , , and . Use the live values from this response when presenting the Terms — do NOT summarize, paraphrase, or hardcode them. They may change between Terms versions.
termsOfUseUrlprivacyPolicyUrltermsNotice当为时:
data.acceptedfalsebash
circle terms show --init --output json响应包含、和。**展示条款时必须使用该响应中的实时值——不得总结、改写或硬编码。**条款版本更新时这些值可能会变化。
termsOfUseUrlprivacyPolicyUrltermsNoticeShow the Terms and request consent
展示条款并请求同意
Tell the user:
Circle CLI requires acceptance of its Terms of Use and Privacy Policy before I can run any wallet commands.
- Terms of Use:
<termsOfUseUrl from the JSON response>- Privacy Policy:
<privacyPolicyUrl from the JSON response><termsNotice from the JSON response>Please review both links. Do you accept these Terms and authorize me to record acceptance on your behalf? (yes/no)
Wait for an explicit yes/no. Ambiguous replies, silence, "ok" without context, or "go ahead" without referencing the Terms are NOT consent — ask again.
告知用户:
Circle CLI要求接受其服务条款和隐私政策后,才能执行任何钱包命令。
- 服务条款:
<JSON响应中的termsOfUseUrl>- 隐私政策:
<JSON响应中的privacyPolicyUrl><JSON响应中的termsNotice>请查看上述链接。您是否接受这些条款并授权我代表您记录接受状态?(是/否)
**等待用户明确的是/否回复。**模糊回复、沉默、无上下文的“好的”或未提及条款的“继续”均不视为同意——需再次询问。
After explicit consent only
仅在获得明确同意后执行
bash
circle terms accept --output jsonWhen is , the gate is cleared. Return to the step that triggered this section.
data.acceptance.acceptedtrueIf the user later asks to revoke acceptance:
bash
circle terms resetRun this only if the user explicitly asks to revoke. Do NOT suggest or execute a reset proactively.
bash
circle terms accept --output json当为时,限制解除,返回触发本环节的步骤。
data.acceptance.acceptedtrue若用户后续要求撤销接受:
bash
circle terms reset仅当用户明确要求撤销时执行此命令,不得主动建议或执行重置操作。
Rules
规则
Security
安全
- NEVER guess or hardcode the user's email address for agent wallet login.
- OTP codes provided during an active authentication session are safe to handle — accept them in chat, use them immediately, do not retain or reuse afterward.
- NEVER include real private keys, API keys, or other persistent secrets in skill files or persist them anywhere.
- NEVER run without explicit user consent in the current session. The agent MUST NEVER accept Circle's Terms on the user's behalf, and MUST NEVER call
circle terms acceptautomatically as part of error recovery, retries, or any flow the user has not explicitly approved.circle terms accept - ALWAYS show the live ,
termsOfUseUrl, andprivacyPolicyUrlreturned bytermsNoticewhen prompting for consent. Do NOT summarize, paraphrase, or hardcode them.circle terms show --init --output json - If the user declines the Terms, stop the flow. Do not retry, work around the gate, or call /
circle terms reset.circle terms accept
- 绝不能猜测或硬编码用户的邮箱地址用于Agent钱包登录。
- 主动认证会话中提供的OTP验证码可安全处理——在聊天中接收后立即使用,不得保留或重复使用。
- 绝不能在技能文件中包含真实私钥、API密钥或其他持久化机密,也不得在任何地方存储这些信息。
- 未经当前会话中用户的明确同意,绝不能执行。Agent绝不能代表用户接受Circle的条款,也绝不能在错误恢复、重试或任何用户未明确批准的流程中自动调用
circle terms accept。circle terms accept - 请求同意时,必须展示返回的实时
circle terms show --init --output json、termsOfUseUrl和privacyPolicyUrl。不得总结、改写或硬编码这些内容。termsNotice - 若用户拒绝条款,立即停止流程。不得重试、绕过限制或调用/
circle terms reset。circle terms accept
Best practices
最佳实践
- ALWAYS check before attempting login. Many session "failures" are actually just stale assumptions.
circle wallet status - Parse and store the request ID from output — you'll need it for the OTP completion step.
circle wallet login --init - Request IDs are single-use and expire after 10 minutes. If you see "Invalid or expired request ID", restart from .
--init - For general CLI rules (,
--output json,--chain-first, follow-up phrasing, confirmation defaults), see the--helpmaster skill's Rules section — they apply here too.use-circle-cli
- 尝试登录前,务必检查。许多会话“失败”实际上只是过时的假设导致的。
circle wallet status - 解析并存储输出中的请求ID——完成OTP验证步骤需要用到它。
circle wallet login --init - 请求ID仅可使用一次,有效期为10分钟。若出现“Invalid or expired request ID”提示,从步骤重新开始。
--init - 关于通用CLI规则(如、
--output json、优先使用--chain、后续话术、确认默认值等),请查看--help主技能的规则部分——这些规则同样适用于本技能。use-circle-cli
Reference Links
参考链接
- Setup walkthrough (full bootstrap doc): https://agents.circle.com/skills/setup.md
- Login flow detail: https://agents.circle.com/skills/wallet-login.md
- CLI package on npm:
@circle-fin/cli - Circle Developer Docs: https://developers.circle.com/llms.txt — Always read this when looking for source documentation on Circle products.
- 设置指南(完整初始化文档):https://agents.circle.com/skills/setup.md
- 登录流程详情:https://agents.circle.com/skills/wallet-login.md
- npm上的CLI包:
@circle-fin/cli - Circle开发者文档:https://developers.circle.com/llms.txt — 查找Circle产品的官方文档时,请务必查看此链接。
Alternatives
替代技能
Trigger the skill instead when:
pay-via-agent-wallet- The user wants to call, pay for, or use a paid x402 service.
- The user mentions ,
circle services search, orcircle services inspect.circle services pay - A downstream task requires money to move out of the agent wallet to a paid endpoint.
Trigger the skill instead when:
fund-agent-wallet- The agent wallet has 0 USDC and the user wants to add funds.
- The user mentions deposit, fiat on-ramp, fiat purchase, QR-code transfer, or Gateway deposit.
- A payment flow blocks because of insufficient balance.
Trigger the skill instead when:
agent-wallet-policy- The user wants to set, view, or reset spending limits on the wallet.
- The user mentions per-tx / daily / weekly / monthly caps, spending policy, or wallet rules.
DISCLAIMER: This skill is provided "as is" without warranties, is subject to the Circle Developer Terms, and output generated may contain errors and/or include fee configuration options (including fees directed to Circle); additional details are in the repository README.
在以下情况下,应触发技能:
pay-via-agent-wallet- 用户想要调用、支付或使用付费x402服务。
- 用户提及、
circle services search或circle services inspect。circle services pay - 下游任务需要将资金从Agent钱包转移至付费端点。
在以下情况下,应触发技能:
fund-agent-wallet- Agent钱包USDC余额为0且用户想要充值。
- 用户提及存款、法币入金、法币购买、二维码转账或网关存款。
- 支付流程因余额不足而受阻。
在以下情况下,应触发技能:
agent-wallet-policy- 用户想要设置、查看或重置钱包的消费限额。
- 用户提及单笔交易/每日/每周/每月限额、消费策略或钱包规则。
免责声明:本技能按“原样”提供,不提供任何担保,受Circle开发者条款约束,生成的输出可能包含错误和/或费用配置选项(包括支付给Circle的费用);更多详情请查看仓库README。