SuperAPI AI 工具集

vercel-deploy

部署与运维

查看项目

更新于 10-15 10:54

技能介绍

Vercel Deploy 是一个将任意项目即时部署到 Vercel 的技能,无需认证。

用途 当用户提出部署相关请求时使用,例如“部署我的应用”“把这个部署到生产环境”等。

主要能力

  • 将项目打包为 tarball,打包时排除 node_modules 和 .git。
  • 从 package.json 自动检测框架。
  • 上传到部署服务。
  • 返回 Preview URL(可访问的线上站点)和 Claim URL(用于将部署转移到用户的 Vercel 账户)。

使用方式 通过脚本执行部署:

bash /mnt/skills/user/vercel-deploy/scripts/deploy.sh [path]

参数:

  • path - 要部署的目录,或一个 .tgz 文件(默认使用当前目录)。

示例:

部署当前目录

bash /mnt/skills/user/vercel-deploy/scripts/deploy.sh

部署指定项目

bash /mnt/skills/user/vercel-deploy/scripts/deploy.sh /path/to/project

部署已有的 tarball

bash /mnt/skills/user/vercel-deploy/scripts/deploy.sh /path/to/project.tgz

输出 脚本会输出部署过程信息,例如:

Preparing deployment... Detected framework: nextjs Creating deployment package... Deploying... ✓ Deployment successful!

Preview URL: https://skill-deploy-abc123.vercel.app Claim URL: https://vercel.com/claim-deployment?code=...

脚本还会向 stdout 输出 JSON,便于程序化使用:

{ "previewUrl": "https://skill-deploy-abc123.vercel.app", "claimUrl": "https://vercel.com/claim-deployment?code=...", "deploymentId": "dpl_...", "projectId": "prj_..." }

框架检测 脚本会从 package.json 自动检测框架。支持的框架包括:

  • React:Next.js、Gatsby、Create React App、Remix、React Router
  • Vue:Nuxt、Vitepress、Vuepress、Gridsome
  • Svelte:SvelteKit、Svelte、Sapper
  • 其他前端:Astro、Solid Start、Angular、Ember、Preact、Docusaurus
  • 后端:Express、Hono、Fastify、NestJS、Elysia、h3、Nitro
  • 构建工具:Vite、Parcel
  • 以及更多:Blitz、Hydrogen、RedwoodJS、Storybook、Sanity 等

对于静态 HTML 项目(没有 package.json),框架会被设为 null。

静态 HTML 项目 对于没有 package.json 的项目:

  • 如果存在单个 .html 文件且其名称不是 index.html,它会被自动重命名。
  • 这确保页面在根 URL(/)下被提供。

向用户展示结果 始终展示两个 URL:

✓ Deployment successful!

Preview URL: https://skill-deploy-abc123.vercel.app Claim URL: https://vercel.com/claim-deployment?code=...

在 Preview URL 查看你的站点。 要将此部署转移到你的 Vercel 账户,请访问 Claim URL。

故障排查 网络出口错误 如果部署因网络限制而失败(在 claude.ai 上常见),告知用户:

Deployment failed due to network restrictions. To fix this:

  1. Go to https://claude.ai/settings/capabilities
  2. Add *.vercel.com to the allowed domains
  3. Try deploying again