vercel-labs/agent-skills

deploy-to-vercel

先识别项目关联与账号,再选正确的 Vercel 部署路径

  • SKILL.md 已保存
  • 中文用法已整理
  • 安装与运行未实测
先判断是否解决你的问题

deploy-to-vercel 是什么?

vercel-labs/agent-skills 的 deploy-to-vercel 根据 Git 远程仓库、.vercel 项目关联和 Vercel CLI 登录状态选择部署方式。通常先做预览部署,再返回部署地址与构建状态;已有关联的项目可沿用 Git 推送流程,没有远程仓库则走 CLI。

中文说明由本站依据来源整理;英文原文保留在页面下方。

适合用在

  • 已有一个能构建的网站或应用,希望让 Agent 在当前项目中创建 Vercel 预览,并交回部署链接。
  • 本地目录与 Vercel 项目名称不同,或仓库内有多个项目,需要先读 .vercel/project.json、.vercel/repo.json 确认目标。
  • Agent 所在环境没有可交互的登录入口,需要判断是否能使用该版本来源说明的免登录临时部署。

这些情况不适合

  • 只要求预览,却直接向生产分支推送或给 CLI 加 --prod;Git 关联并不意味着每次推送都会生成预览。
  • 把安装 Vercel CLI、拿到部署 URL 或触发构建,当成网站已经构建成功和功能验收通过。
  • 已经关联 Vercel 项目的目录或 CI 环境中的免登录临时部署;绑定版本的源文件明确说该方式不支持这两种场景。
按客户端选择安装入口

怎么接入你的 Agent?

  1. 定位完整 Skill 目录

    打开本项目来源,核对 SKILL.md 及其引用的脚本和资料。

  2. 交给你正在用的 Agent

    在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。

  3. 确认识别,再做具体任务

    让 Agent 回报安装目录和识别到的名称 deploy-to-vercel,然后按本页使用示例提供材料。

展开并复制给 Codex 的安装指令
发送给 Codex

安装并检查 deploy-to-vercel

请在 Codex 的当前工作环境中安装并检查 deploy-to-vercel 这个 Skill。

项目身份:vercel-labs/agent-skills / deploy-to-vercel
来源:https://github.com/vercel-labs/agent-skills/blob/1a2c79d4e6c4a2283dc2c614b6538cbe1ed5ca62/skills/deploy-to-vercel/SKILL.md
已定位的源文件:skills/deploy-to-vercel/SKILL.md

1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。
准备输入,再按步骤执行

装好以后,具体怎么用?

准备哪些材料

  • 提供实际项目目录、要部署的 Git 分支或本地内容、预览还是生产的目标。项目的框架、构建命令和必要环境变量应由实际工程与 Vercel 配置确定,本 Skill 不会自动补齐缺失的业务配置。
  • 先读取四项状态:git remote get-url origin、.vercel/project.json 或 .vercel/repo.json、vercel whoami,以及已登录时的 vercel teams list --format json。关联文件中的 orgId 决定已有项目所属团队;多团队且未关联时需要用户选 team slug。
  • 若走已登录 CLI 部署,环境需要 Vercel CLI 与相应账号访问权。来源给出的 npm install -g vercel 安装 CLI,vercel login 完成账号认证;这些都不是安装 deploy-to-vercel 这个 Skill。

会得到什么

  • 本次部署 URL、所用项目/团队与部署方式;CLI 使用 --no-wait 时同时报告 vercel inspect 返回的实际构建状态。
  • Git 路线无法从 CLI 读取 URL 时,明确让用户到 Vercel 控制台或 Git 提交状态查看,不编造地址。
  • 如使用免登录临时方式,分别交代部署地址、CLI 打印的到期时间与 claim URL;claim 链接用于认领,应单独保存,不当作公开访问链接分享。

实际使用顺序

  1. 在实际项目目录回读 Git 和 .vercel 状态;两种关联文件任一存在,都按已关联处理。未关联时不要用 vercel link、vercel ls 或 vercel project inspect 试探状态,以免检查动作顺带创建关联。
  2. 已关联且有 Git remote,先确认当前分支与 Vercel 的生产分支关系。源文件要求推送前取得用户明确批准,再提交并推送;非生产分支才是这里的预览路线,不能为预览任务直接推生产分支。
  3. 已关联而无 Git remote,使用 vercel deploy . -y --no-wait 做 CLI 预览部署;若已选定团队,在命令中带对应 --scope。记录返回 URL,再运行 vercel inspect 查询该部署的构建状态。URL 返回时构建可能仍未完成。
  4. 未关联但已登录时,有 remote 使用 vercel link --repo --scope 关联仓库;没有 remote 使用 vercel link --scope 选择或创建项目。团队参数必须来自已确认的实际 team slug,随后按 Git 或 CLI 路线部署。
  5. 未登录时,可在能交互的环境中登录后关联;不能登录的环境才考虑 npx vercel@latest deploy . --temporary -y。这个版本将其描述为会过期的临时 production URL,并返回 claim URL,和普通 preview 不同。若当前只授权普通预览,先说明差异,确认用户接受临时 production 后再采用。
  6. 构建报错时保留部署地址和 vercel inspect 的实际状态,不报告已完成;认证失败先核对账号与团队。若环境禁用外网,按该环境的网络设置处理,不能把沙箱的网络失败误判为项目构建失败。最终汇报使用的分支、团队、部署方式、URL 和状态。
使用示例

从一个具体任务开始

本站根据源文件编写的使用示例,未在本站实际运行。示例中的文件由你提供。

安装并识别 Skill 后发送

复制一个具体任务

教学示例:请用 deploy-to-vercel 把当前工作区的 ./demo-web 做一次普通 preview 部署,不做 production,不提交或推送 Git。

本例的预设状态是:demo-web 已有 .vercel/project.json、Vercel CLI 已登录、没有 Git remote。请先进入 demo-web 回读真实状态,不把这些教学前提当成已确认事实。若状态不同,停在方法选择处说明差异;若需要团队选择,列出实际 team slug。

状态符合时,在该目录运行普通 vercel deploy . -y --no-wait,必要时附已确认的团队 scope。返回 URL 后用 vercel inspect 查询构建状态。构建失败就给出实际错误与后续处理,不把拿到 URL 写成成功。不要改成 --prod,也不要自行采用 --temporary;本例只要普通 preview。按该版本 Skill 的要求返回链接与 CLI 状态,不通过 curl/fetch 访问部署网址来声称验收完成。
预期结果

预期在确认项目关联和 CLI 身份后,生成一次普通预览部署,报告返回的 URL 与 inspect 状态;若仍在构建则写明未完成,失败则保留错误。本站没有执行本例,也没有据此验证公网页面或业务功能。

使用前先看这些限制

使用条件与边界

  • 默认目标是 preview;生产部署需要明确请求。Git 路线由实际生产分支决定发布类型,不能只看是否写了 --prod。
  • 该版本 SKILL.md 要求不要用 curl 或 fetch 访问部署地址验证,只返回地址并查询 CLI 状态。因此本页不把该流程写成网站端到端可用性测试;公网功能验收是另一个任务。
  • 来源提供的免登录临时部署有期限,且是临时 production URL,不能表述为永久免费托管、普通 preview 或已经认领到用户账号。
  • 源文件中的网络升级参数依赖 Agent 运行环境;网站不会把某个 Agent 的沙箱参数当成所有客户端都通用的命令。
  • 本页只审读了指定提交的完整 Skill 文档,没有安装 CLI、登录账号、关联项目或实际部署。
针对这个 Skill 的疑问

常见问题

拿到 Vercel URL 就算部署成功了吗?

不一定。--no-wait 会先返回 URL,不等构建结束;还需要用 vercel inspect 读取实际构建状态。即使构建完成,也不能据此声称页面交互、接口或登录功能都已验收。

`.vercel/project.json` 和 `.vercel/repo.json` 都要存在吗?

不需要。这个版本的 Skill 把任一文件存在都视为已关联:project.json 通常记录单项目关联,repo.json 记录仓库级目录到项目的映射。应读取现有配置,不能只检查其中一种后重新关联。

为什么预览部署不能直接 `git push main`?

绑定版本的来源说明:推到 Vercel 生产分支会触发生产部署,生产分支通常是 main,但必须按当前项目确认。只要预览时,应选择非生产分支,并遵守源文件关于推送前取得明确批准的要求。

没有 Vercel 账号能使用吗?

这个版本记录了 vercel deploy --temporary 免登录路径,CLI 会打印临时部署地址、认领链接和到期时间。它不适用于 CI 或已关联目录,而且被来源描述为临时 production URL;不能把它与普通 preview 混称。

CLI 认证或网络失败后要怎么区分?

认证错误先检查 whoami、现有项目所属团队和访问权;网络超时、DNS 或连接重置先查 Agent 环境的出站限制。绑定版本还为 claude.ai 列出允许 *.vercel.com、registry.npmjs.org 的设置建议,其他环境需按自身网络机制处理。

需要核对时再展开原文

来源原文与资料状态

源文件
已保存 SKILL.md,抓取于 2026-11-16T12:36:35.145Z
中文使用说明
已针对下方源文件版本整理用途、用法和常见问题
安装与任务测试
本站未执行安装或任务测试
来源复核
本页中文用法已对照保存版本的完整 SKILL.md 阅读整理
展开 SKILL.md 原文、章节与历史收录资料

skills/deploy-to-vercel/SKILL.md · 抓取时间 2026-11-16T12:36:35.145Z

以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。

抓取成功不代表已完成安装或任务测试。

来源 description(原文)

Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".

查看源文件章节 / Source sections
  • 原文:Deploy to Vercel
  • 原文:Step 1: Gather Project State
  • 原文:Team selection
  • 原文:Step 2: Choose a Deploy Method
  • 原文:Linked (`.vercel/` exists) + has git remote → Git Push
  • 原文:Linked (`.vercel/` exists) + no git remote → `vercel deploy`
  • 原文:Not linked + CLI is authenticated → Link first, then deploy
  • 原文:Not linked + CLI not authenticated → Install, auth, link, deploy
  • 原文:No-Auth Fallback — `vercel deploy --temporary`
  • 原文:Agent-Specific Notes
  • 原文:Claude Code / terminal-based agents
  • 原文:Sandboxed environments (claude.ai, Codex)
  • 原文:Output
  • 故障排查 / Troubleshooting
  • 原文:Network Egress Error (claude.ai)
  • 原文:Escalated Network Access (Codex / sandboxed environments)
  • 原文:CLI Auth Failure
原文:Deploy to Vercel

Deploy any project to Vercel. **Always deploy as preview** (not production) unless the user explicitly asks for production. The goal is to get the user into the best long-term setup: their project linked to Vercel with git-push deploys. Every method below tries to move the user closer to that state.

原文:Step 1: Gather Project State

Run all four checks before deciding which method to use: ```bash # 1. Check for a git remote git remote get-url origin 2>/dev/null # 2. Check if locally linked to a Vercel project (either file means linked) cat .vercel/project.json 2>/dev/null || cat .vercel/repo.json 2>/dev/null # 3. Check if the Vercel CLI is installed and authenticated vercel whoami 2>/dev/null # 4. List available teams (if authenticated) vercel teams list --format json 2>/dev/null ```

原文:Team selection

If the user belongs to multiple teams, present all available team slugs as a bulleted list and ask which one to deploy to. Once the user picks a team, proceed immediately to the next step — do not ask for additional confirmation. Pass the team slug via `--scope` on all subsequent CLI commands (`vercel deploy`, `vercel link`, `vercel inspect`, etc.): ```bash vercel deploy [path] -y --no-wait --scope <team-slug> ``` If the project is already linked (`.vercel/project.json` or `.vercel/repo.json` exists), the `orgId` in those files determines the team — no need to ask again. If there is only one team (or just a personal account), skip the prompt and use it directly. **About the `.vercel/` directory:** A linked project has either: - `.vercel/project.json` — created by `vercel link` (single project linking). Contains `projectId` and `orgId`. - `.vercel/repo.json` — created by `vercel link --repo` (repo-based linking). Contains `orgId`, `remoteName`, and a `projects` array mapping directories to Vercel project IDs. Either file means the project is linked. Check for both. **Do NOT** use `vercel project inspect`, `vercel ls`, or `vercel link` to detect state in an unlinked directory — without a `.vercel/` config, they will interactively prompt (or with `--yes`, silently link as a side-effect). Only `vercel whoami` is safe to run anywhere.

原文:Linked (`.vercel/` exists) + has git remote → Git Push

This is the ideal state. The project is linked and has git integration. 1. **Ask the user before pushing.** Never push without explicit approval: ``` This project is connected to Vercel via git. I can commit and push to trigger a deployment. Want me to proceed? ``` 2. **Commit and push:** ```bash git add . git commit -m "deploy: <description of changes>" git push ``` Vercel automatically builds from the push. Non-production branches get preview deployments; the production branch (usually `main`) gets a production deployment. 3. **Retrieve the preview URL.** If the CLI is authenticated: ```bash sleep 5 vercel ls --format json ``` The JSON output has a `deployments` array. Find the latest entry — its `url` field is the preview URL. If the CLI is not authenticated, tell the user to check the Vercel dashboard or the commit status checks on their git provider for the preview URL. ---

原文:Linked (`.vercel/` exists) + no git remote → `vercel deploy`

The project is linked but there's no git repo. Deploy directly with the CLI. ```bash vercel deploy [path] -y --no-wait ``` Use `--no-wait` so the CLI returns immediately with the deployment URL instead of blocking until the build finishes (builds can take a while). Then check on the deployment status with: ```bash vercel inspect <deployment-url> ``` For production deploys (only if user explicitly asks): ```bash vercel deploy [path] --prod -y --no-wait ``` ---

原文:Not linked + CLI is authenticated → Link first, then deploy

The CLI is working but the project isn't linked yet. This is the opportunity to get the user into the best state. 1. **Ask the user which team to deploy to.** Present the team slugs from Step 1 as a bulleted list. If there's only one team (or just a personal account), skip this step. 2. **Once a team is selected, proceed directly to linking.** Tell the user what will happen but do not ask for separate confirmation: ``` Linking this project to <team name> on Vercel. This will create a Vercel project to deploy to and enable automatic deployments on future git pushes. ``` 3. **If a git remote exists**, use repo-based linking with the selected team scope: ```bash vercel link --repo --scope <team-slug> ``` This reads the git remote URL and matches it to existing Vercel projects that deploy from that repo. It creates `.vercel/repo.json`. This is much more reliable than `vercel link` (without `--repo`), which tries to match by directory name and often fails when the local folder and Vercel project are named differently. **If there is no git remote**, fall back to standard linking: ```bash vercel link --scope <team-slug> ``` This prompts the user to select or create a project. It creates `.vercel/project.json`. 4. **Then deploy using the best available method:** - If a git remote exists → commit and push (see git push method above) - If no git remote → `vercel deploy [path] -y --no-wait --scope <team-slug>`, then `vercel inspect <url>` to check status ---

文件 SHA256:418ca2a60d35c551e6cb645f4e82c1b704a8335486ffe74b1b3d0617a17504e5

仓库许可证记录:未提供;not-established,查看来源。

Skills.sh收录简介 · 2026-07-28

Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this…

查看历史简介来源

这份历史简介在采集时已截断;完整用途和触发条件需打开来源核对。

历史收录数据

Skill标识deploy-to-vercel
来源仓库vercel-labs/agent-skills
榜单快照2026-07-28
榜单口径Skills.sh累计安装量
快照名次222
快照累计安装量98884

历史资料说明

  • 所保留的来源简介在采集时已截断;完整触发条件、依赖及排除项须阅读源文件,本站不补写缺失部分。
  • 安装量用于说明当时的收录次序,不是效果、可信度或当前可用性的证明。

此页用于识别项目与来源。安装入口可在该Skill的Skills.sh页面查看;当前目录是否仍存在、附带脚本和账户依赖尚需按具体版本确认。

返回 Skills 目录,按任务继续筛选 · MCP与Skills教程与资源