Langsung ke konten
Skillpedia
Deploy & cloud (DevOps)48k Β· #6102

vercel-cli-with-tokens

Fungsinya

Tool ini membantu Anda menayangkan proyek ke Vercel menggunakan kode akses khusus (token), tanpa perlu login setiap kali. Tool ini berguna untuk mengotomatisasi proses deploy proyek.

Kapan dipakai

  • βœ“Saat Anda ingin men-deploy proyek ke Vercel secara otomatis.
  • βœ“Saat menyiapkan proyek baru di Vercel melalui command line.
  • βœ“Untuk menambahkan informasi rahasia (seperti API key) ke proyek Vercel Anda.

Link skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/vercel-cli-with-tokens/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/vercel-cli-with-tokens/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBagaimana cara deploy proyek saya ke Vercel menggunakan access token saya?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Tool ini pertama-tama mencari kode akses (token) Anda di tempat-tempat umum, seperti environment variables atau file konfigurasi. Jika tidak ditemukan, tool akan meminta Anda memberikan token. Setelah itu, tool menggunakan token ini untuk berkomunikasi dengan Vercel dan menjalankan tindakan yang Anda minta, seperti men-deploy proyek.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

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_TOKEN

C) 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_):

grep -Eio '^[A-Z0-9_]*VERCEL[A-Z0-9_]*(?==)' .env 2>/dev/null

Inspect 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_TOKEN

D) No token found β€” ask the user

If none of the above yield a token, ask the user to provide one. 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 deploy

Step 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
grep -Eio '^[A-Z0-9_]*VERCEL[A-Z0-9_]*(?==)' .env 2>/dev/null

If 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/ -f1

If 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 --version

Deploying 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-wait

With a team scope (either via VERCEL_ORG_ID or --scope):

vercel deploy --scope <team-slug> -y --no-wait

Production (only when explicitly requested):

vercel deploy --prod --scope <team-slug> -y --no-wait

Check 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/null

Link the project

With git remote (preferred):

vercel link --repo --scope <team-slug> -y

…

Pertanyaan umum

Apa itu access token Vercel?

Ini adalah kode rahasia yang memungkinkan tool dan skrip berinteraksi dengan akun Vercel Anda atas nama Anda, tanpa perlu mengetikkan kata sandi.

Mengapa menggunakan token daripada login?

Penggunaan token lebih aman dan praktis untuk otomatisasi, karena Anda tidak perlu terus-menerus memasukkan kredensial dan risiko informasi sensitif terekspos menjadi lebih kecil.

Di mana saya bisa menemukan access token Vercel?

Anda bisa membuat access token di bagian 'Tokens' pada pengaturan akun Anda di vercel.com.

Detail

Deskripsi asli dari pembuat

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\".

repo: sickn33/agentic-awesome-skills

Popularitas

Bintang GitHub
48k
Peringkat
#6102
Lisensi
MIT
Diperbarui
15/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa