mcpField
V
vercel-deploy

vercel-deploy

github.com/mavcui云与 DevOps19360 次安装33 周前更新
代码仓库

关于 vercel-deploy

vercel-deploy 是将项目打包并部署到 Vercel 的 Agent 技能,无需身份验证。部署后会返回预览 URL,以及用于将部署转移到 Vercel 账户的认领 URL。

主要功能

  1. 01将项目打包为 tarball
  2. 02根据 package.json 检测框架
  3. 03将项目部署到 Vercel
  4. 04返回预览和认领 URL
  5. 05处理静态 HTML 项目

适用场景

  1. 01发布项目预览
  2. 02部署项目目录
  3. 03部署现有 .tgz 包
  4. 04将部署转移到 Vercel 账户

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/mavcui/agent-skills-hunter --skill vercel-deploy

安装后在 Claude Code 中输入/vercel-deploy确认已加载。

详细介绍

Vercel 部署

立即将任何项目部署到 Vercel。无需身份验证。

工作原理

  1. 将项目打包为 tarball(排除 node_modules 和 .git)
  2. 根据 package.json 自动检测框架
  3. 上传到部署服务
  4. 返回 预览 URL(已上线的网站)和 认领 URL(转移到你的 Vercel 账户)

用法

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

参数:

  • path - 要部署的目录,或 .tgz 文件(默认为当前目录)

示例:

# Deploy current directory
bash /mnt/skills/user/vercel-deploy/scripts/deploy.sh

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

# Deploy existing 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=...

该脚本还会将 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 的项目:

  • 如果只有一个名称不是 index.html 的 .html 文件,系统会自动将其重命名
  • 这样可以确保页面通过根 URL(/)提供服务

向用户展示结果

始终显示两个 URL:

✓ Deployment successful!

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

View your site at the Preview URL.
To transfer this deployment to your Vercel account, visit the 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

评论

支持 Markdown