vercel

GitHub

提供Vercel REST API访问能力,支持项目与部署管理、构建及运行时日志查询、状态监控、环境变量操作、重新部署及域名配置检查。通过个人访问令牌认证,实现自动化运维与开发工作流集成。

apps/browser/bundled/plugins/vercel/SKILL.md mereyabdenbekuly-ctrl/clodex-ide

触发场景

需要查看或管理Vercel项目部署状态 需要获取应用构建或运行时的日志信息 需要配置或更新项目的环境变量 需要触发项目的重新部署或取消正在进行的构建

安装

npx skills add mereyabdenbekuly-ctrl/clodex-ide --skill vercel -g -y
更多选项

非标准路径

npx skills add https://github.com/mereyabdenbekuly-ctrl/clodex-ide/tree/main/apps/browser/bundled/plugins/vercel -g -y

不安装直接使用

npx skills use mereyabdenbekuly-ctrl/clodex-ide@vercel

指定 Agent (Claude Code)

npx skills add mereyabdenbekuly-ctrl/clodex-ide --skill vercel -a claude-code -g -y

安装 repo 全部 skill

npx skills add mereyabdenbekuly-ctrl/clodex-ide --all -g -y

预览 repo 内 skill

npx skills add mereyabdenbekuly-ctrl/clodex-ide --list

SKILL.md

Frontmatter
{
    "name": "vercel",
    "description": "Complete guide for the Vercel plugin — REST API access for deployments, logs, projects, and environment variables using a Vercel Personal Access Token."
}

Vercel Plugin

This plugin provides access to the Vercel REST API on the user's behalf, using a stored Personal Access Token.

Capabilities:

  • List and inspect projects and deployments
  • Fetch build and runtime logs
  • Check deployment status and watch for completion
  • Read, add, and update environment variables
  • Trigger redeploys or cancel running builds
  • Inspect domain and alias configuration

Authentication

Request the stored Vercel credential. The token field is an opaque placeholder — the sandbox fetch proxy substitutes the real value automatically. Never decode or transform it.

const cred = await API.getCredential('vercel-pat');
if (!cred) {
  return 'Vercel credential is not configured. Ask the user to add a Vercel Personal Access Token at vercel.com/account/tokens, then store it in Settings.';
}

Making Requests

Always pass the token as a Bearer header:

async function vercelGet(path) {
  const res = await fetch(`https://api.vercel.com${path}`, {
    headers: {
      Authorization: `Bearer ${cred.token}`,
      'Content-Type': 'application/json',
    },
  });
  if (!res.ok) throw new Error(`Vercel API ${res.status}: ${await res.text()}`);
  return res.json();
}

async function vercelPost(path, body) {
  const res = await fetch(`https://api.vercel.com${path}`, {
    method: 'POST',
    headers: {
      Authorization: `Bearer ${cred.token}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify(body),
  });
  if (!res.ok) throw new Error(`Vercel API ${res.status}: ${await res.text()}`);
  return res.json();
}

Key Endpoints

Projects

List all projects GET /v9/projects Returns paginated list of projects. Use ?limit=20 to control page size.

Get a project GET /v9/projects/:projectId :projectId can be the project ID or name (slug).

Deployments

List deployments for a project GET /v6/deployments?projectId=:projectId&limit=10 Add &target=production to filter production deployments only. Add &state=ERROR / &state=READY / &state=BUILDING to filter by status.

Get a deployment GET /v13/deployments/:deploymentId Returns full deployment details including status, meta, and build output.

Get deployment build logs GET /v2/deployments/:deploymentId/events Returns a stream of build log events. Each event has type (stdout/stderr) and text.

Redeploy POST /v13/deployments Body: { "deploymentId": "...", "name": "...", "target": "production" }

Cancel a deployment PATCH /v12/deployments/:deploymentId/cancel

Runtime Logs

Get runtime logs GET /v1/deployments/:deploymentId/events?direction=backward&limit=100 Use &since=<timestamp_ms> and &until=<timestamp_ms> to scope by time. Add &statusCode=500 or filter by level field in results (error, warning, info).

Environment Variables

List env vars for a project GET /v9/projects/:projectId/env Returns all env vars. Secret values are redacted — use /decrypt endpoint to retrieve them.

Create an env var POST /v10/projects/:projectId/env Body:

{
  "key": "MY_VAR",
  "value": "my-value",
  "type": "plain",
  "target": ["production", "preview", "development"]
}

type can be "plain", "secret", or "encrypted".

Update an env var PATCH /v9/projects/:projectId/env/:envId Body: { "value": "new-value" }

Delete an env var DELETE /v9/projects/:projectId/env/:envId

Teams

If the user's projects are under a team, many endpoints require ?teamId=:teamId.

List teams GET /v2/teams Returns all teams the token has access to. Note the id field for use as teamId.

Get a team GET /v2/teams/:teamId


Common Patterns

Check if latest deployment succeeded

const cred = await API.getCredential('vercel-pat');
const { deployments } = await vercelGet('/v6/deployments?projectId=YOUR_PROJECT&limit=1&target=production');
const latest = deployments[0];
return { status: latest.state, url: latest.url, createdAt: new Date(latest.createdAt).toISOString() };

Fetch recent error logs for a deployment

const cred = await API.getCredential('vercel-pat');
const events = await vercelGet('/v2/deployments/DEPLOYMENT_ID/events?direction=backward&limit=200');
const errors = events.filter(e => e.level === 'error' || e.type === 'stderr');
return errors.map(e => e.text || e.payload?.text).filter(Boolean).join('\n');

Watch a deployment until it finishes

const cred = await API.getCredential('vercel-pat');
const deploymentId = 'dpl_...';
let status = 'BUILDING';
let attempts = 0;
while (['BUILDING', 'INITIALIZING', 'QUEUED'].includes(status) && attempts < 30) {
  await new Promise(r => setTimeout(r, 5000));
  const { state } = await vercelGet(`/v13/deployments/${deploymentId}`);
  status = state;
  attempts++;
  API.output(`Deployment status: ${status}`);
}
return `Final status: ${status}`;

Important Rules

  • Always call API.getCredential('vercel-pat') before any Vercel API call. If it returns null, prompt the user to configure it.
  • Many endpoints are paginated — check for pagination.next in the response and page through if needed.
  • Team-scoped projects require ?teamId= on most endpoints. If requests return 403 or empty results, ask the user for their team ID or fetch it via GET /v2/teams.
  • Treat env var values as sensitive — do not log or display secret/encrypted values.
  • Rate limits: Vercel enforces per-token rate limits. Avoid tight polling loops; use at least 2–5s between status checks.

版本历史

  • 0f01f5b 当前 2026-07-19 09:02

同 Skill 集合

apps/browser/bundled/plugins/figma/SKILL.md
apps/browser/bundled/plugins/github/SKILL.md
apps/browser/bundled/plugins/javascript-sandbox/SKILL.md
apps/browser/bundled/plugins/mini-apps/SKILL.md
apps/browser/bundled/plugins/open-code-review/SKILL.md
apps/browser/bundled/plugins/openmanus/SKILL.md
apps/browser/bundled/plugins/posthog/SKILL.md
apps/browser/bundled/plugins/remotion/SKILL.md
apps/browser/bundled/plugins/supabase/SKILL.md
apps/browser/bundled/skills/debug/SKILL.md
apps/browser/bundled/skills/learn-skill/SKILL.md
apps/browser/bundled/skills/plan/SKILL.md
apps/browser/bundled/skills/preview/SKILL.md
apps/browser/bundled/skills/implement/SKILL.md

元信息

文件数
0
版本
5244a17
Hash
56d77707
收录时间
2026-07-19 09:02

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-21 20:01
浙ICP备14020137号-1 $访客地图$