Useful for deployment agents, but production commands need strict approval gates.
Whether the CLI can return JSON, YAML, or stable machine-readable output.
Whether common workflows can run predictably without an interactive prompt.
Whether read-only, dry-run, scoped auth, and destructive command boundaries are clear.
安装方式
$ npm i -g vercel 常用命令
$ vercel pull --yes --environment=preview Fetches project settings for local checks.
$ vercel deploy --prebuilt Creates a preview deployment.
$ vercel deploy --prod Ships to production and should require approval.
Agent 使用示例
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 创建预览部署。