CLI Finder / tools / vercel-cli

用于预览和生产部署的 Vercel CLI

适合预览优先部署工作流的前端部署 CLI。

Agent 适配度: 78/100 已验证发布者 持续维护
78 /100

Useful for deployment agents, but production commands need strict approval gates.

Structured output 62/100

Whether the CLI can return JSON, YAML, or stable machine-readable output.

Non-interactive use 82/100

Whether common workflows can run predictably without an interactive prompt.

Safety boundaries 58/100

Whether read-only, dry-run, scoped auth, and destructive command boundaries are clear.

安装方式

npm $ npm i -g vercel

常用命令

Pull environment · 安全 $ vercel pull --yes --environment=preview

Fetches project settings for local checks.

Preview deploy · 需确认 $ vercel deploy --prebuilt

Creates a preview deployment.

Production deploy · 高风险 $ vercel deploy --prod

Ships to production and should require approval.

Agent 使用示例

Codex CLI Use Vercel CLI only after local checks pass. Create preview deployments first and ask before production deploy.

安全说明

  • Agents should run local build checks before any deployment command.
  • Preview deployments can still publish externally visible URLs; summarize the URL and logs after creation.
  • Production deploys, env changes, domains, and team settings require explicit human approval.

TL;DR

Vercel CLI 适合交给 Agent 做“预览优先”的部署流程,但不能让 Agent 在没有确认的情况下直接发布生产环境。

预览优先部署流程

1. 用 `cat package.json | jq '.scripts'` 检查项目脚本。 2. 先跑本地检查:有 `npm test` 就执行,再执行 `npm run build`。 3. 用 `vercel pull --yes --environment=preview` 拉取预览环境配置。 4. 用 `vercel deploy --prebuilt` 创建预览部署。 5. 总结 preview URL、构建结果、警告和关键日志。 6. 在 `vercel deploy --prod` 前停止,除非用户明确批准生产发布。

审批边界

生产部署、环境变量修改、域名修改、团队或项目设置变更,都必须人工确认。Agent 询问前需要写清楚命令和生产环境影响。

推荐组合

用 GitHub CLI 读取 PR 状态,用 jq 解析脚本和 JSON 输出,用 Vercel CLI 创建预览部署。