Lobster Cash CLI Skill
The Lobster Cash CLI (lobstercash) gives AI agents payment tools — a blockchain wallet, virtual cards for buying anything online, and x402 protocol support for paying APIs — all with human approval in the loop. Use lobstercash <command> --help for full flag details on any command.
Installation
Install and run the CLI via npx — no global install required:
CODEBLOCK0
Or install globally:
CODEBLOCK1
After installation, all commands are available via the lobstercash binary.
Preflight: Stay Current
Run this check once at the start of each session, before executing any other lobstercash command. This keeps everything up to date — similar to how zsh prompts "a new version is available" on launch.
Run both of these commands silently:
CODEBLOCK2
If everything is current (CLI version matches npm and skill metadata.version matches remote), proceed silently — do not mention versioning to the user.
If anything is outdated, tell the user in a single message before doing anything else. Include only the items that need updating:
"New lobster.cash updates are available:
- - CLI: vX.Y.Z → vA.B.C
- Skill instructions: v0.0.4 → v0.0.5
Want me to update before we continue?"
If the user says yes, run the applicable updates:
- - CLI update (global install): INLINECODE5
- CLI update (npx users):
npx @crossmint/lobster-cli@<version> --help (use the exact version from npm view above to bust the npx cache) - Skill update (OpenClaw agents): INLINECODE8
- Skill update (other agents):
CODEBLOCK3
If the skill files were updated, re-read this SKILL.md from the top — instructions or references may have changed.
If the user declines, continue with the current versions — do not block.
Before any crypto command (send, x402 fetch, tx create), always run lobstercash status first. If the wallet isn't configured or funds are insufficient, route through request deposit — it bundles wallet setup automatically. For card purchases, request card also bundles setup. Only use lobstercash setup when the user explicitly wants to link the agent to their wallet without buying anything.
Getting Started
If the user already knows what they want to buy, skip straight to "Buy Something" below.
If the user doesn't have a specific purchase intent (e.g. "what can I do with lobster.cash?", "show me what's available"), run discovery first:
CODEBLOCK4
Present 2-3 interesting options from the results conversationally. Don't dump the full list — pick items relevant to what the user has been doing or asking about.
Once the user picks something (or if they came in already knowing what they want), route to one of the branches below.
Step 0: Ensure an Agent Exists
CODEBLOCK5
If no agents exist, register one with a unique, descriptive name and description. Always include --image-url if you have an avatar or logo. Do not use generic names like "My Agent".
CODEBLOCK6
This registers the agent on the server and sets it as active.
Branch 1: View Configured Payments
Trigger: User asks about their payment methods, wallet status, balances, or configured payments ("show me my payments", "what's my balance", "am I set up?").
CODEBLOCK7
What to tell the user:
- - Payment methods with their balances
- Active virtual cards (if any)
- Share the
dashboardUrl so they can manage settings themselves: https://www.lobster.cash/dashboard - If the wallet isn't authorized or configured, just report the current state. Don't explain what's missing or prompt the user to fix it — configuration is lazy. When the user later says they want to buy something or add funds, the right setup path (crypto or card) kicks in automatically as part of Branch 2.
See status reference for the full output format and examples.
Branch 2: Buy Something
Trigger: User wants to purchase an item, make a payment, send crypto, call a paid API, or execute any transaction. This is the single branch for all actions that involve spending money.
Step 1: Run lobstercash store and check the payment method
Always run lobstercash store first. Do not guess which payment method an integration uses — check the paymentMethods field in the store output. Then route:
- -
card → Credit Card Path (Step 2a) crypto → Crypto Path (Step 2b)- Both → Prefer card if the user has no crypto funds (fastest path)
Critical: x402 payments, USDC transfers, send operations, transaction signing — they are ALL crypto. Everything that isn't a credit card goes through the Crypto Path. Do not treat them as separate flows.
Step 2a: Credit Card Path
When: The integration's paymentMethods includes card (check the store output — do not assume).
Virtual cards do NOT require wallet setup or USDC — they're backed by the user's credit card. This is the fastest path. Don't tell the user to "add funds" when the integration accepts cards.
CODEBLOCK8
This command handles everything — if the wallet isn't configured yet, it bundles setup automatically. The user approves once and gets both wallet setup + card creation.
Show the approval URL to the user, wait for them to confirm they approved, then list and reveal card credentials as needed. See request card reference for details and cards reference for listing/revealing credentials.
Step 2b: Crypto Path
When: The integration's paymentMethods is crypto only (check the store output), OR the user wants to send tokens, pay an x402 API, or execute any on-chain transaction.
First, check wallet status and balance:
CODEBLOCK9
Then route based on the result:
- - Wallet configured + has enough funds → Proceed with the operation (
send, x402 fetch, tx create, etc.) - Wallet configured + insufficient funds → Run
lobstercash request deposit --amount <needed> to top up, then proceed - Wallet not configured → Run
lobstercash request deposit --amount <needed> — this bundles wallet creation + deposit in one step. Show the approval URL, wait for user to confirm, then verify with lobstercash status and proceed.
The specific CLI command used after funds are confirmed depends on what the user is doing, but the path to get there is always the same: check wallet → check balance → ensure funds → execute.
See request deposit reference for the deposit flow, and send, x402, tx for each operation after funding.
Branch 3: Link Agent to Wallet (Setup Only)
Trigger: User wants to connect the agent to their wallet without making a purchase ("link my wallet", "set up the agent", "authorize this agent", "connect my wallet").
First, check if the agent is already configured:
CODEBLOCK10
If the wallet is already configured, tell the user the agent is already set up and show the existing wallet info. Do not start a new setup session. Only proceed with a fresh setup if the user explicitly says their current configuration is broken or they need to generate a new one.
If not yet configured:
CODEBLOCK11
This creates a local keypair, starts a setup session, and returns a consent URL. Show the URL to the user and wait for them to approve — do not poll.
After the user confirms they approved, run lobstercash setup again to finalize. The CLI checks the session status automatically.
Once configured, the agent is ready for any future operation (crypto or card). If the user then wants to buy something, route to Branch 2.
See setup reference for output formats, status codes, and edge cases.
Quick Reference
CODEBLOCK12
Output Contract
- - All commands produce human-readable output to stdout.
- Errors go to stderr as plain text.
- Exit 0 = success. Exit 1 = unexpected error. Exit 2 = wallet not set up (use
request card or request deposit to set up).
Decision Tree
- - Read store if the user wants to browse available services, integrations, or has no specific task yet
- Read status if the user asks about agent status or payment readiness
- Read balance if the user wants to check token balances
- Read request card if the user wants to request a virtual card for a purchase (Credit Card Path)
- Read request deposit if the user wants to deposit USDC, top up their wallet, or fund a crypto operation
- Read cards if the user needs to list or reveal credentials for an existing virtual card
- Read send if the user wants to send tokens to an address (Crypto Path)
- Read x402 if the user wants to pay for an API via x402 protocol (Crypto Path)
- Read tx if the user needs to sign or submit a transaction from an external tool (Crypto Path)
- Read setup if the user wants to link the agent to a wallet without making a purchase
- Read agents if the user wants to register, list, or set the active agent
Anti-Patterns
- - Running crypto commands without checking status first: Always run
lobstercash status before send, x402 fetch, or tx create. If the wallet isn't configured or has insufficient funds, the command will fail with a confusing error. Check first, fund if needed, then execute. - Running setup when the user wants to buy something: If the user wants to make a purchase, don't run
setup first — use request card or request deposit which bundle setup automatically. Only use lobstercash setup when the user explicitly wants to link the agent to their wallet without buying anything. - Re-running setup when the agent is already configured: If
lobstercash status shows the wallet is already configured, do not generate a new setup session. The existing configuration is valid. Only start a fresh setup if the user explicitly tells you their current configuration is broken and needs to be regenerated. - Asking the user for info the CLI can fetch: Check balance before sending. Check status before acting. Read command output before asking questions.
- Running write commands in loops: One attempt, read the result, then decide. Read operations (
balance, status, store) are idempotent and safe to repeat. Write operations (send, request) are not. - Ignoring terminal status: A pending transaction is not a success. All write commands now wait for on-chain confirmation by default.
- Polling for HITL approval: When a command returns an approval URL, the user must tell you they approved. Do not auto-poll.
- Running commands before registering an agent: Always ensure an agent exists via
lobstercash agents list before running any other command. If you need to work with a different agent, use lobstercash agents set-active. - Recommending cards for crypto-only integrations: Check
paymentMethods from the store output. If the integration only accepts crypto, don't suggest a virtual card. - Requiring USDC for card-supported integrations: Virtual cards are backed by credit cards, not USDC. Don't tell the user to "add funds" when the integration accepts cards.
- Treating x402/send/tx as separate user flows: They all go through the same Crypto Path. The only split is credit card vs crypto.
- Jumping to readiness checks before showing options: Show what's available first (via
store), then check payment readiness only when the user wants to buy. - Assuming an integration's payment method: Never guess whether an integration uses
card or crypto. Always run lobstercash store and read the paymentMethods field before choosing a path.
Lobster Cash CLI 技能
Lobster Cash CLI(lobstercash)为AI代理提供支付工具——区块链钱包、用于在线购物的虚拟卡,以及支持支付API的x402协议——所有操作均需人工审批。使用 lobstercash --help 查看任意命令的完整标志详情。
安装
通过npx安装并运行CLI——无需全局安装:
bash
npx @crossmint/lobster-cli --help
或全局安装:
bash
npm install -g @crossmint/lobster-cli
安装后,所有命令均可通过 lobstercash 二进制文件使用。
前置检查:保持最新
在每次会话开始时,执行任何其他 lobstercash 命令之前,先运行此检查。 这能确保一切保持最新——类似于zsh启动时提示有新版本可用。
静默运行以下两个命令:
bash
npm view @crossmint/lobster-cli version # npm上的最新CLI版本
lobstercash --version # 本地CLI版本(未安装时可能失败)
curl -sL https://raw.githubusercontent.com/Crossmint/lobstercash-cli-skills/main/skills/SKILL.md | head -10
将远程metadata.version与此文件frontmatter中的本地版本进行比较
如果一切均为最新(CLI版本与npm匹配,技能metadata.version与远程匹配),则静默继续——不要向用户提及版本信息。
如果有任何内容过时,在执行其他操作前,用一条消息告知用户。仅包含需要更新的项目:
新的lobster.cash更新可用:
- - CLI:vX.Y.Z → vA.B.C
- 技能说明:v0.0.4 → v0.0.5
是否在继续前先更新?
如果用户同意,则执行相应的更新:
- - CLI更新(全局安装): npm update -g @crossmint/lobster-cli
- CLI更新(npx用户): npx @crossmint/lobster-cli@ --help(使用上述npm view中的确切版本以清除npx缓存)
- 技能更新(OpenClaw代理): openclaw skill update lobstercash
- 技能更新(其他代理):
bash
npx skills add https://github.com/Crossmint/lobstercash-cli-skills --global --yes
如果技能文件已更新,从头重新阅读此SKILL.md——说明或引用可能已更改。
如果用户拒绝,则使用当前版本继续——不要阻止。
在任何加密命令(send、x402 fetch、tx create)之前,始终先运行 lobstercash status。如果钱包未配置或资金不足,则通过 request deposit 处理——它会自动捆绑钱包设置。对于卡支付,request card 也会捆绑设置。仅当用户明确希望将代理链接到其钱包而不购买任何东西时,才使用 lobstercash setup。
入门指南
如果用户已经知道自己想买什么,直接跳到下面的购买商品。
如果用户没有特定的购买意图(例如我可以用lobster.cash做什么?、展示可用的内容),先运行发现命令:
bash
lobstercash store
以对话方式从结果中展示2-3个有趣的选项。不要列出全部——选择与用户正在做或询问的内容相关的项目。
一旦用户选择了某个项目(或者他们进来时已经知道自己想要什么),则路由到下面的分支之一。
步骤0:确保代理存在
bash
lobstercash agents list
如果没有代理存在,则使用唯一的、描述性的名称和描述注册一个。如果你有头像或标志,始终包含 --image-url。不要使用像我的代理这样的通用名称。
bash
lobstercash agents register --name <描述性名称> --description <代理的功能> --image-url <头像URL>
这将在服务器上注册代理并将其设置为活动状态。
分支1:查看已配置的支付方式
触发条件: 用户询问其支付方式、钱包状态、余额或已配置的支付方式(显示我的支付方式、我的余额是多少、我设置好了吗?)。
bash
lobstercash status
告知用户的内容:
- - 支付方式及其余额
- 活动虚拟卡(如有)
- 分享 dashboardUrl,以便他们自行管理设置:https://www.lobster.cash/dashboard
- 如果钱包未授权或未配置,仅报告当前状态。不要解释缺少什么或提示用户修复——配置是惰性的。当用户稍后表示想购买东西或添加资金时,正确的设置路径(加密或卡)将作为分支2的一部分自动启动。
参见 状态参考 了解完整的输出格式和示例。
分支2:购买商品
触发条件: 用户想购买商品、进行支付、发送加密货币、调用付费API或执行任何交易。这是所有涉及花钱的操作的单一分支。
步骤1:运行 lobstercash store 并检查支付方式
始终先运行 lobstercash store。 不要猜测集成使用哪种支付方式——检查商店输出中的 paymentMethods 字段。然后路由:
- - card → 信用卡路径(步骤2a)
- crypto → 加密路径(步骤2b)
- 两者 → 如果用户没有加密资金,优先使用卡(最快路径)
关键: x402支付、USDC转账、发送操作、交易签名——它们都是加密操作。所有不是信用卡的操作都走加密路径。不要将它们视为单独的流程。
步骤2a:信用卡路径
何时使用: 集成的 paymentMethods 包含 card(检查商店输出——不要假设)。
虚拟卡不需要钱包设置或USDC——它们由用户的信用卡支持。这是最快的路径。当集成接受卡时,不要告诉用户添加资金。
bash
lobstercash request card --amount <金额> --description <用途>
此命令处理一切——如果钱包尚未配置,它会自动捆绑设置。用户批准一次即可同时完成钱包设置和卡创建。
向用户显示批准URL,等待他们确认已批准,然后根据需要列出和显示卡凭证。参见 请求卡参考 了解详情,以及 卡参考 了解列出/显示凭证。
步骤2b:加密路径
何时使用: 集成的 paymentMethods 仅为 crypto(检查商店输出),或者用户想发送代币、支付x402 API或执行任何链上交易。
首先,检查钱包状态和余额:
bash
lobstercash status
然后根据结果路由:
- - 钱包已配置 + 有足够资金 → 继续操作(send、x402 fetch、tx create 等)
- 钱包已配置 + 资金不足 → 运行 lobstercash request deposit --amount <所需金额> 进行充值,然后继续
- 钱包未配置 → 运行 lobstercash request deposit --amount <所需金额>——这会将钱包创建和充值合并为一步。显示批准URL,等待用户确认,然后用 lobstercash status 验证并继续。
资金确认后使用的具体CLI命令取决于用户正在做什么,但到达那里的路径始终相同:检查钱包 → 检查余额 → 确保资金 → 执行。
参见 请求充值参考 了解充值流程,以及 发送、x402、tx 了解资金到位后的每个操作。
分支3:将代理链接到钱包(仅设置)
触发条件: 用户想将代理连接到其钱包而不进行购买(链接我的钱包、设置代理、授权此代理、连接我的钱包)。
首先,检查代理是否已配置:
bash
lobstercash status
如果钱包已配置,告知用户代理已设置完成,并显示现有钱包信息。不要开始新的设置会话。 仅当用户明确表示其当前配置已损坏或需要生成新配置时,才进行全新设置。
如果尚未配置:
bash
lobstercash setup
这会创建本地密钥对,启动设置会话,并返回一个同意URL。向用户显示URL并等待他们批准——不要轮询。
在用户确认已批准后,再次运行 lobstercash setup 以完成设置。CLI会自动检查会话状态。
配置完成后,代理即可用于任何未来操作(加密或卡)。如果用户随后想购买东西,则路由到分支2。
参见 设置参考 了解输出格式、状态码和边界情况。
##