vercel-cli-with-tokens – skill Lập trình cho agent AI
Triển khai và quản lý project trên Vercel bằng xác thực dựa trên token. Dùng khi làm việc với Vercel CLI bằng access token thay vì đăng nhập tương tác, ví dụ: \"deploy to vercel\", \"set up vercel\", \"add environment variables to vercel\".
Cài skill vercel-cli-with-tokens bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/vercel-cli-with-tokens-42ca2.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /vercel-cli-with-tokens – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/vercel-cli-with-tokens-42ca2.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $vercel-cli-with-tokens – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/vercel-cli-with-tokens-42ca2.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /vercel-cli-with-tokens – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/vercel-cli-with-tokens-42ca2.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /vercel-cli-with-tokens – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
Vercel CLI with Tokens
Deploy and manage projects on Vercel using the CLI with token-based authentication, without relying on vercel login.
When to Use
- Use this skill when the task matches this description: Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".
Step 1: Locate the Vercel Token
Before running any Vercel CLI commands, identify where the token is coming from. Work through these scenarios in order:
A) VERCEL_TOKEN is already set in the environment
[ -n "${VERCEL_TOKEN:-}" ] && printf 'VERCEL_TOKEN is set\n'If this reports a configured token, you're ready. Skip to Step 2.
B) Token is in a .env file under VERCEL_TOKEN
grep -q '^VERCEL_TOKEN=' .env 2>/dev/null && printf 'VERCEL_TOKEN is present in .env\n'If found, export it:
VERCEL_TOKEN="$(sed -n 's/^VERCEL_TOKEN=//p' .env | tail -n 1)"
export VERCEL_TOKENC) Token is in a .env file under a different name
Look for any variable that looks like a Vercel token (Vercel tokens typically start with vca_):
sed -nE 's/^([A-Z0-9_]*VERCEL[A-Z0-9_]*)=.*/\1/p' .env 2>/dev/nullInspect the output to identify which variable holds the token, then export it as VERCEL_TOKEN:
vercel_var="<VARIABLE_NAME>"
VERCEL_TOKEN="$(sed -n "s/^${vercel_var}=//p" .env | tail -n 1)"
export VERCEL_TOKEND) No token found — ask the user
If none of the above yield a token, ask the user to configure one in approved local secret storage, never paste it into chat. They can create a Vercel access token at vercel.com/account/tokens.
---
Important: Once VERCEL_TOKEN is exported as an environment variable, the Vercel CLI reads it natively — do not pass it as a --token flag. Putting secrets in command-line arguments exposes them in shell history and process listings.
# Bad — token visible in shell history and process listings
vercel deploy --token "vca_abc123"
# Good — CLI reads VERCEL_TOKEN from the environment
[ -n "${VERCEL_TOKEN:-}" ] || { echo "Set VERCEL_TOKEN first" >&2; exit 1; }
vercel deployStep 2: Locate the Project and Team
Similarly, check for the project ID and team scope. These let the CLI target the right project without needing vercel link.
# Check environment
[ -n "${VERCEL_PROJECT_ID:-}" ] && printf 'VERCEL_PROJECT_ID is set\n'
[ -n "${VERCEL_ORG_ID:-}" ] && printf 'VERCEL_ORG_ID is set\n'
# Or check .env
sed -nE 's/^([A-Z0-9_]*VERCEL[A-Z0-9_]*)=.*/\1/p' .env 2>/dev/nullIf you have a project URL (e.g. https://vercel.com/my-team/my-project), extract the team slug:
# e.g. "my-team" from "https://vercel.com/my-team/my-project"
echo "$PROJECT_URL" | sed 's|https://vercel.com/||' | cut -d/ -f1If you have both VERCEL_ORG_ID and VERCEL_PROJECT_ID in your environment, export them — the CLI will use these automatically and skip any .vercel/ directory:
export VERCEL_ORG_ID="<org-id>"
export VERCEL_PROJECT_ID="<project-id>"Note: VERCEL_ORG_ID and VERCEL_PROJECT_ID must be set together — setting only one causes an error.
CLI Setup
Ensure the Vercel CLI is installed and up to date:
npm install -g vercel
vercel --versionDeploying a Project
Always deploy as preview unless the user explicitly requests production. Choose a method based on what you have available.
Quick Deploy (have project ID — no linking needed)
When VERCEL_TOKEN and VERCEL_PROJECT_ID are set in the environment, deploy directly:
vercel deploy -y --no-waitWith a team scope (either via VERCEL_ORG_ID or --scope):
vercel deploy --scope <team-slug> -y --no-waitProduction (only when explicitly requested):
vercel deploy --prod --scope <team-slug> -y --no-waitCheck status:
vercel inspect <deployment-url>Full Deploy Flow (no project ID — need to link)
Use this when you have a token and team but no pre-existing project ID.
Check project state first
# Does the project have a git remote?
git remote get-url origin 2>/dev/null
# Is it already linked to a Vercel project?
cat .vercel/project.json 2>/dev/null || cat .vercel/repo.json 2>/dev/nullLink the project
With git remote (preferred):
vercel link --repo --scope <team-slug> -yReads the git remote and connects to the matching Vercel project. Creates .vercel/repo.json. More reliable than plain vercel link, which matches by directory name.
Without git remote:
vercel link --scope <team-slug> -yCreates .vercel/project.json.
Link to a specific project by name:
vercel link --project <project-name> --scope <team-slug> -yIf the project is already linked, check orgId in .vercel/project.json or .vercel/repo.json to verify it matches the intended team.
Deploy after linking
A) Git Push Deploy — has git remote (preferred)
Git pushes trigger automatic Vercel deployments.
1. Ask the user before pushing. Never push without explicit approval.
2. Commit and push:
git add .
git commit -m "deploy: <description of changes>"
git push
3. Vercel builds automatically. Non-production branches get preview deployments.
4. Retrieve the deployment URL:
sleep 5
vercel ls --format json --scope <team-slug>
Find the latest entry in the deployments array.
B) CLI Deploy — no git remote
vercel deploy --scope <team-slug> -y --no-waitCheck status:
vercel inspect <deployment-url>Deploying from a Remote Repository (code not cloned locally)
1. Clone the repository:
git clone <repo-url>
cd <repo-name>
2. Link to Vercel:
vercel link --repo --scope <team-slug> -y
3. Deploy via git push (if you have push access) or CLI deploy.
About .vercel/ Directory
A linked project has either:
.vercel/project.json— fromvercel link. ContainsprojectIdandorgId..vercel/repo.json— fromvercel link --repo. ContainsorgId,remoteName, and aprojectsmap.
Not needed when VERCEL_ORG_ID + VERCEL_PROJECT_ID are both set in the environment.
Do NOT run vercel project inspect or vercel link in an unlinked directory to detect state — they will interactively prompt or silently link as a side-effect. vercel ls is safe (in an unlinked directory it defaults to showing all deployments for the scope). vercel whoami is safe anywhere.
Managing Environment Variables
# Set for all environments
echo "value" | vercel env add VAR_NAME --scope <team-slug>
# Set for a specific environment (production, preview, development)
echo "value" | vercel env add VAR_NAME production --scope <team-slug>
# List environment variables
vercel env ls --scope <team-slug>
# Pull env vars to local .env.local file
vercel env pull --scope <team-slug>
# Remove a variable
vercel env rm VAR_NAME --scope <team-slug> -yInspecting Deployments
# List recent deployments
vercel ls --format json --scope <team-slug>
# Inspect a specific deployment
vercel inspect <deployment-url>
# View build logs (requires Vercel CLI v35+)
vercel inspect <deployment-url> --logs
# View runtime request logs (follows live by default; add --no-follow for a one-shot snapshot)
vercel logs <deployment-url>Managing Domains
# List domains
vercel domains ls --scope <team-slug>
# Add a domain to the project — linked or env-linked directory (1 arg)
vercel domains add <domain> --scope <team-slug>
# Add a domain — unlinked directory (requires <project> positional)
vercel domains add <domain> <project> --scope <team-slug>Static plan prices/allocations below are historical examples; verify current official plan terms before recommending or making a change. Preview deployments can still expose code/data or incur cost: confirm the target project/team and deployment authority before submission; -y is not user permission.
Stripe Projects Plan Changes
If this project is managed by Stripe Projects. Ask the user before running any paid or destructive plan change — upgrades bill a real card, downgrades remove seats.
First run stripe projects status --json to confirm the Vercel resource's local name. The examples below assume the default (vercel-plan); substitute the actual name if it was renamed at stripe projects add time.
- Upgrade to Pro:
stripe projects add vercel/pro(orstripe projects upgrade vercel-plan pro) - Downgrade to Hobby:
stripe projects downgrade vercel-plan hobby
What Pro gives you
- $20/month platform fee, includes $20/month of usage credit.
- Turbo build machines (30 vCPUs, 60 GB memory) by default for new projects — significantly faster b
… (nội dung đầy đủ có trong gói tải về)
Skill liên quan
- vercel-react-view-transitions – Hướng dẫn view transition trong React và Next.js, animation phần tử dùng chung, chuyển…
- vexor – CLI tìm kiếm tệp theo ngữ nghĩa, được hỗ trợ bởi vector, kèm skill cho Claude/Codex
- vexor-cli – Khám phá tệp theo ngữ nghĩa bằng `vexor`. Dùng bất cứ khi nào cần tìm vị trí một thứ…
- vibe-code-auditor – Kiểm toán mã được tạo nhanh hoặc do AI sinh ra để tìm lỗi cấu trúc, tính dễ vỡ và rủi ro…
- vibe-code-cleanup – Dọn dẹp và gia cố an toàn cho production đối với các ứng dụng fullstack vibe-code…
- vibe-delegate – Chỉ giao việc lập trình cho Mistral Vibe CLI (`vibe`) khi người dùng yêu cầu rõ ràng…
- vibers-code-review – Quy trình review thủ công cho dự án GitHub do AI tạo, với phản hồi dựa trên spec, review…
- videodb-skills – Tải lên, phát trực tuyến, tìm kiếm, chỉnh sửa, phiên âm và tạo video và âm thanh AI bằng…