返回顶部
b

bitrefill-cliBitrefill命令行工具

Buy gift cards, mobile top-ups, and eSIMs on Bitrefill. Pay with crypto and x402. 1,500+ brands, 180+ countries

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.5.0
安全检测
已通过
291
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

bitrefill-cli

Bitrefill CLI

通过 Bitrefill CLI 搜索、购买和交付数字商品(礼品卡、手机充值、eSIM)。

要求

  • - 使用此技能需要拥有 Bitrefill 账户。通过 Bitrefill API 密钥或 OAuth 进行身份验证。详见设置
  • 需要加密钱包来发送加密货币或支付至 x402 端点(Base 网络上的 USDC)。此技能不提供钱包
  • 建议使用浏览器使用MCP 或 CLI,让代理在品牌网站上兑换代码,以实现完全自主的购物体验。此技能不提供此功能

支持的支付方式

实现即时代理支付的最佳体验是使用 balance 的商店余额,其次是通过 x402 使用 Base 网络上的 USDC,然后是闪电网络。所有其他加密货币支付需要代理轮询发票状态以确认支付。

CLI 通过 bitrefill buy-products --help 返回完整列表。

  • - balance — 即时完成,无需链上等待。用户在 bitrefill.com 预充值。自然消费上限。
  • usdcbase 配合 x402 — 使用 --returnpaymentlink true(默认)获取 x402paymenturl。支持 x402 的代理可通过 Base 网络自主完成支付。
  • lightning — 闪电网络 — lightningInvoice、satoshiPrice
  • ethereum — 以太坊主网(ETH)— address、paymentUri、altcoinPrice
  • ethbase — Base(8453),原生 ETH
  • usdcbase — Base(8453),USDC
  • usdcarbitrum — Arbitrum(42161),USDC
  • usdcpolygon — Polygon(137),USDC
  • usdcerc20 — 以太坊(1),USDC
  • usdcsolana — Solana,USDC
  • usdtpolygon — Polygon(137),USDT
  • usdterc20 — 以太坊(1),USDT
  • --returnpaymentlink true 选项返回的结账页面中提供支付卡、本地支付方式和其他加密货币支付方式。

消费保障

此技能支持真实货币交易。支付确认后,购买将立即完成。

  • - 默认:购买前始终确认。 展示产品、面额、价格和支付方式;等待明确批准后再执行 buy-products。仅当用户明确选择当前会话时,才允许自主购买。
  • 数字商品交付后,仅在无法正常使用时才可退款。根据欧盟消费者权利,礼品卡代码等数字商品不适用 14 天无理由退货政策。
  • 礼品卡代码可视为现金等价物,应安全存储,不得公开分享。只有代理所有者才能访问代码。建议对代码使用加密数据存储,而非纯文本。
  • 尽可能避免重写数字代码。如有可能,在代码兑换前优先使用内存存储,并仅在此时以编程方式访问和使用。
  • 如果用户索要代码,请返回代码,但建议他们安全存储、不要公开分享,并尽快使用
  • 使用专用、余额有限的账户——切勿让代理访问高余额账户。
  • 服务条款: https://www.bitrefill.com/terms/ 包含有关退款政策和购买限制的重要信息。
  • 记录每次购买: invoice_id、产品、金额、支付方式。
  • 非钱包: 此技能不是钱包。它是在 Bitrefill 上购买产品的工具。不负责存储私钥或管理您的加密钱包。
  • 浏览器使用: 尝试在品牌网站上兑换代码时,反机器人保护机制可能会阻止代理。在这种情况下,询问用户是否希望手动完成兑换流程,如果是,则将代码返回给用户。

设置

安装

bash
npm install -g @bitrefill/cli

从源码安装:git clone https://github.com/bitrefill/cli.git && cd cli && pnpm install && pnpm build && npm link

身份验证

bitrefill.com/account/developers 生成 API 密钥:

bash
export BITREFILLAPIKEY=YOURAPIKEY

替代方案:在未设置 API 密钥的情况下运行任何命令,以触发基于浏览器的 OAuth。令牌存储在 ~/.config/bitrefill-cli/api.bitrefill.com.json。使用 bitrefill logout 清除。

环境变量

变量用途
BITREFILLAPIKEY无头身份验证(跳过 OAuth)

核心工作流程

search-products → get-product-details → buy-products → get-invoice-by-id / list-orders

1. 搜索

bash
bitrefill search-products --query Netflix --country US
bitrefill search-products --query eSIM --product_type esim --country IT
bitrefill search-products --query * --category games

--country 必须为大写 Alpha-2 ISO 代码(US、IT、BR)。--product_type:giftcard 或 esim(单数)。

发现类别: 使用 --query * 搜索——响应中包含 categories 数组,包含 slug 和计数(例如 food、games、streaming)。添加 --country 可查看特定国家/地区可用的类别。将这些 slug 用作 --category 值。

2. 获取详情

bash
bitrefill get-product-details --product_id steam-usa

返回 packages 数组。每个条目包含 packagevalue——将其用作 buy-products 中的 packageid。

忽略复合键,如 steam-usa<&>5——仅使用 <&> 之后的值。

三种面额类型:

  • - 数字型: 5、50、200(作为数字传递)
  • 时长型: 1 Month、12 Months(精确字符串,区分大小写)
  • 命名型: 1GB, 7 Days、PUBG New State 300 NC(精确字符串,区分大小写)

仅接受 get-product-details 返回的值——任意金额将被拒绝。

3. 购买

--cart_items 必须为 JSON 数组 [...],即使只有一个商品。

bash

数字型


bitrefill buy-products \
--cartitems [{productid: steam-usa, package_id: 5}] \
--paymentmethod usdcbase

时长型

bitrefill buy-products \ --cartitems [{productid: spotify-usa, package_id: 1 Month}] \ --payment_method balance

命名型(eSIM)

bitrefill buy-products \ --cartitems [{productid: bitrefill-esim-europe, package_id: 1GB, 7 Days}] \ --paymentmethod usdcbase

响应包含 invoiceid、paymentlink 和 x402paymenturl。

每次调用最多 15 个商品。

4. 追踪

bash
bitrefill get-invoice-by-id --invoice_id UUID
bitrefill list-orders --includeredemptioninfo true

关键注意事项

cart_items 必须是数组,而非对象:

bash

错误


--cartitems {productid: steam-usa, package_id: 5}

正确


--cartitems [{productid: steam-usa, package_id: 5}]

使用 <&> 之后的 package_value,而非复合键:

bash

错误:steam-usa<&>5 → 正确:5

命名型/时长型 package_id 必须精确,区分大小写:

bash

错误:1GB → 正确:1GB, 7 Days


错误:300 nc → 正确:PUBG New State 300 NC

国家代码必须为大写 Alpha-2:

bash

错误:us、USA、United States → 正确:US

参考资料

需要时加载:

参考资料使用场景
commands任何命令的完整选项表
payment
支付

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 bitrefill-cli-1776178691 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 bitrefill-cli-1776178691 技能

通过命令行安装

skillhub install bitrefill-cli-1776178691

下载

⬇ 下载 bitrefill-cli v1.5.0(免费)

文件大小: 7.82 KB | 发布时间: 2026-4-15 10:22

v1.5.0 最新 2026-4-15 10:22
v1.5.0 introduces improved documentation and reference materials.

- Added three detailed reference files: `commands.md`, `payment.md`, and `troubleshooting.md`.
- Updated and streamlined the README/skill documentation for clarity, ease of use, and more concise setup instructions.
- Expanded documentation of payment methods, including x402 and major crypto support.
- Clarified spending safety guidelines and recommended best practices.
- Added a "Critical Gotchas" troubleshooting section and new reference links for faster issue resolution.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部