SuperAPI AI 工具集

domain-check

部署与运维

查看项目

更新于 10-16 04:02

技能介绍

用途

Domain Check 用于在 Vercel 上完成域名的检查、购买与管理。它面向需要为新项目挑选并注册域名的用户,覆盖从可用性查询、价格对比到下单购买,以及后续的域名归属与项目绑定等操作。

主要能力

  • 可用性检查与价格查询:对给定名称在多个顶级域下查询状态与价格。
  • 购买域名:通过交互式 CLI 命令完成购买,购买前显示价格并请求确认。
  • 域名管理:列出已拥有域名、查看已拥有域名的信息、将域名添加到 Vercel 项目、在团队间移动域名、将域名转入 Vercel、从团队中移除域名。
  • 脚本化调用:提供直接调用 Vercel Registrar API 的示例,用于在脚本中查询价格与购买。

使用方式

检查可用性与价格:

domain-check myproject

检查指定的顶级域:

domain-check myproject com,io,dev,app,ai

购买域名(交互式,需 pty:true):

npx vercel domains buy mydomain.com

常用 Vercel CLI 域名命令:

命令 描述
npx vercel domains list 显示所有域名
npx vercel domains inspect <domain> 域名信息(仅限已拥有域名)
npx vercel domains buy <domain> 购买(交互式)
npx vercel domains add <domain> <project> 添加到 Vercel 项目
npx vercel domains move <domain> <dest> 转移到另一个团队
npx vercel domains transfer-in <domain> 转入 Vercel
npx vercel domains remove <domain> 从团队中移除

通过 API 直接查询价格与可用性(示例):

VERCEL_TOKEN=$(jq -r '.token' ~/.local/share/com.vercel.cli/auth.json)
TEAM=$(jq -r '.currentTeam // empty' ~/.local/share/com.vercel.cli/config.json)
TEAM_PARAM="${TEAM:+?teamId=$TEAM}"

# Check price/availability
curl -s "https://api.vercel.com/v1/registrar/domains/example.com/price${TEAM_PARAM}" \
  -H "Authorization: Bearer $VERCEL_TOKEN"
# Returns: { "years": 1, "purchasePrice": 11.25, "renewalPrice": 11.25, "transferPrice": 11.25 }
# purchasePrice: null = taken, number = available

# Buy via API
curl -s -X POST "https://api.vercel.com/v1/registrar/domains${TEAM_PARAM}" \
  -H "Authorization: Bearer $VERCEL_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "example.com"}'

调用购买命令的示例:

# Example exec call
exec(command: "npx vercel domains buy myproject.dev", pty: true, timeout: 30)

工作原理

可用性检查使用 Vercel Registrar API(/v1/registrar/domains/{domain}/price):purchasePrice 为 null 表示域名已被占用;purchasePrice 为数字表示该域名可用,并给出对应价格。

身份验证

需要 Vercel CLI 身份验证(npx vercel login)。令牌从 ~/.local/share/com.vercel.cli/auth.json 读取。团队 ID 会从 Vercel CLI 配置中自动检测,也可通过设置 VERCEL_TEAM_ID 环境变量覆盖;两者都未设置时使用个人账户。

适用场景

  • 为新项目批量比较同一名称在多个后缀下的可用性与价格。
  • 在 Vercel 上直接购买域名并绑定到项目。
  • 管理已拥有的域名,包括查看、移动、转入与移除。
  • 在脚本中通过 API 查询价格或执行购买。

限制与注意事项

  • Vercel registrar API 已替代旧的 v4 domains/price 端点(2025 年 11 月停止服务)。
  • domains inspect 仅对已拥有的域名生效;查询可用性应使用 price API。
  • .ai 域名在各注册商处均价格较高(每年 140 美元)。
  • 通过 CLI 购买时,交互式确认提示需要设置 pty: true。
  • 上述典型 TLD 价格仅供参考(.com 约 11.25 美元/年、.dev 约 13、.app 约 15、.co 约 27、.io 约 46、.ai 约 140、.org 约 9.99、.net 约 13.50、.xyz 约 13)。

暂未提供

关于该技能支持的运行环境、安装方式、是否收费以及更多限制,资料未提供。