Communitygithub.com

토큰 기반 Vercel CLI

액세스 토큰을 이용해 Vercel CLI로 프로젝트를 배포하고 관리합니다. 대화형 로그인 없이 토큰 기반 인증을 사용할 때 활용하세요.

토큰 기반 Vercel CLI란 무엇인가요?

이 스킬은 Vercel CLI를 대화형 `vercel login` 없이 액세스 토큰으로 사용하는 방법을 상세히 안내합니다. 환경 변수나 `.env` 파일에서 `VERCEL_TOKEN`을 자동으로 찾고, 프로젝트 ID와 팀 스코프를 설정하여 빠르게 배포할 수 있습니다. `--token` 플래그 대신 환경 변수로 토큰을 전달하여 보안을 강화하고, 기본적으로 프리뷰 배포를 수행하며 사용자 요청 시에만 프로덕션 배포를 진행합니다. Vercel CLI의 설치, 프로젝트 링크, 환경 변수 관리, 도메인 추가, 배포 상태 확인 및 Stripe Projects 요금제 변경까지 폭넓은 기능을 지원합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/alfathafp/portofolio-web-design/tree/HEAD/.agents/skills/vercel-cli-with-tokens

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

토큰 기반 Vercel CLI은(는) 무엇을 하나요?

vercel login 없이 토큰 기반 인증으로 Vercel CLI를 사용하여 프로젝트를 배포하고 관리합니다.

1단계: Vercel 토큰 찾기

Vercel CLI 명령어를 실행하기 전에 토큰이 어디에서 오는지 확인합니다. 다음 시나리오를 순서대로 확인하세요:

A) 환경에 VERCEL_TOKEN이 이미 설정되어 있음

printenv VERCEL_TOKEN

값이 반환되면 준비가 된 것입니다. 2단계로 건너뛰세요.

B) .env 파일에 VERCEL_TOKEN 키로 토큰이 있음

grep '^VERCEL_TOKEN=' .env 2>/dev/null

발견되면 내보냅니다:

export VERCEL_TOKEN=$(grep '^VERCEL_TOKEN=' .env | cut -d= -f2-)

C) .env 파일에 다른 이름으로 토큰이 있음

Vercel 토큰처럼 보이는 변수를 찾습니다 (Vercel 토큰은 보통 vca_로 시작):

grep -i 'vercel' .env 2>/dev/null

출력을 확인하여 어떤 변수가 토큰을 담고 있는지 식별한 후, VERCEL_TOKEN으로 내보냅니다:

export VERCEL_TOKEN=$(grep '^<변수명>=' .env | cut -d= -f2-)

D) 토큰을 찾을 수 없음 — 사용자에게 문의

위 방법으로 토큰을 얻을 수 없으면 사용자에게 토큰을 제공하도록 요청하세요. Vercel 액세스 토큰은 vercel.com/account/tokens에서 생성할 수 있습니다.


중요: VERCEL_TOKEN이 환경 변수로 내보내지면 Vercel CLI가 기본적으로 이를 읽습니다. --token 플래그로 전달하지 마세요. 명령줄 인수에 비밀 정보를 넣으면 셸 기록 및 프로세스 목록에 노출됩니다.

# 나쁨 — 토큰이 셸 기록 및 프로세스 목록에 노출됨
vercel deploy --token "vca_abc123"

# 좋음 — CLI가 환경에서 VERCEL_TOKEN을 읽음
export VERCEL_TOKEN="vca_abc123"
vercel deploy

2단계: 프로젝트 및 팀 찾기

마찬가지로 프로젝트 ID와 팀 스코프를 확인합니다. 이 정보를 통해 vercel link 없이도 CLI가 올바른 프로젝트를 대상으로 삼을 수 있습니다.

# 환경 확인
printenv VERCEL_PROJECT_ID
printenv VERCEL_ORG_ID

# 또는 .env 확인
grep -i 'vercel' .env 2>/dev/null

프로젝트 URL이 있는 경우 (예: https://vercel.com/my-team/my-project), 팀 슬러그를 추출합니다:

# 예: "https://vercel.com/my-team/my-project"에서 "my-team" 추출
echo "$PROJECT_URL" | sed 's|https://vercel.com/||' | cut -d/ -f1

환경에 VERCEL_ORG_ID와 VERCEL_PROJECT_ID가 모두 있는 경우, 내보내면 CLI가 자동으로 사용하며 .vercel/ 디렉토리를 건너뜁니다:

export VERCEL_ORG_ID="<org-id>"
export VERCEL_PROJECT_ID="<project-id>"

참고: VERCEL_ORG_ID와 VERCEL_PROJECT_ID는 함께 설정해야 합니다. 하나만 설정하면 오류가 발생합니다.

CLI 설정

Vercel CLI가 설치되어 있고 최신 버전인지 확인합니다:

npm install -g vercel
vercel --version

프로젝트 배포

사용자가 명시적으로 요청하지 않는 한 항상 프리뷰로 배포합니다. 사용 가능한 정보에 따라 방법을 선택하세요.

빠른 배포 (프로젝트 ID 있음 — 링크 불필요)

환경에 VERCEL_TOKEN과 VERCEL_PROJECT_ID가 설정된 경우 직접 배포합니다:

vercel deploy -y --no-wait

팀 스코프가 있는 경우 (VERCEL_ORG_ID 또는 --scope 사용):

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

프로덕션 (명시적으로 요청된 경우에만):

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

상태 확인:

vercel inspect <deployment-url>

전체 배포 흐름 (프로젝트 ID 없음 — 링크 필요)

토큰과 팀은 있지만 기존 프로젝트 ID가 없는 경우 사용합니다.

먼저 프로젝트 상태 확인

# 프로젝트에 git 리모트가 있나요?
git remote get-url origin 2>/dev/null

# 이미 Vercel 프로젝트에 연결되어 있나요?
cat .vercel/project.json 2>/dev/null || cat .vercel/repo.json 2>/dev/null

프로젝트 연결

git 리모트 사용 (권장):

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

git 리모트를 읽고 일치하는 Vercel 프로젝트에 연결합니다. .vercel/repo.json을 생성합니다. 디렉토리 이름으로 일치시키는 일반 vercel link보다 더 안정적입니다.

git 리모트 없음:

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

.vercel/project.json을 생성합니다.

특정 프로젝트 이름으로 연결:

vercel link --project <project-name> --scope <team-slug> -y

프로젝트가 이미 연결된 경우, .vercel/project.json 또는 .vercel/repo.json의 orgId를 확인하여 의도한 팀과 일치하는지 확인합니다.

연결 후 배포

A) Git 푸시 배포 — git 리모트 있음 (권장)

Git 푸시는 자동으로 Vercel 배포를 트리거합니다.

  1. 푸시 전에 사용자에게 물어보세요. 명시적 승인 없이 푸시하지 마십시오.
  2. 커밋하고 푸시:
    git add .
    git commit -m "deploy: <변경 사항 설명>"
    git push
    
  3. Vercel이 자동으로 빌드합니다. 프로덕션이 아닌 브랜치는 프리뷰 배포를 받습니다.
  4. 배포 URL을 검색합니다:
    sleep 5
    vercel ls --format json --scope <team-slug>
    
    deployments 배열에서 최신 항목을 찾습니다.

B) CLI 배포 — git 리모트 없음

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

상태 확인:

vercel inspect <deployment-url>

원격 저장소에서 배포 (로컬에 코드가 클론되지 않은 경우)

  1. 저장소를 클론합니다:
    git clone <repo-url>
    cd <repo-name>
    
  2. Vercel에 연결합니다:
    vercel link --repo --scope <team-slug> -y
    
  3. git 푸시(푸시 권한이 있는 경우) 또는 CLI 배포를 통해 배포합니다.

.vercel/ 디렉토리 정보

연결된 프로젝트는 다음 중 하나를 가집니다:

  • .vercel/project.json — vercel link에서 생성. projectId와 orgId를 포함합니다.
  • .vercel/repo.json — vercel link --repo에서 생성. orgId, remoteName 및 projects 맵을 포함합니다.

환경에 VERCEL_ORG_ID와 VERCEL_PROJECT_ID가 모두 설정된 경우 필요하지 않습니다.

연결되지 않은 디렉토리에서 상태를 감지하기 위해 vercel project inspect 또는 vercel link를 실행하지 마세요. 대화형 프롬프트가 나타나거나 조용히 연결되어 부작용이 발생합니다. vercel ls는 안전합니다 (연결되지 않은 디렉토리에서는 기본적으로 해당 스코프의 모든 배포를 표시합니다). vercel whoami는 어디서든 안전합니다.

환경 변수 관리

# 모든 환경에 설정
echo "value" | vercel env add VAR_NAME --scope <team-slug>

# 특정 환경에 설정 (production, preview, development)
echo "value" | vercel env add VAR_NAME production --scope <team-slug>

# 환경 변수 목록 조회
vercel env ls --scope <team-slug>

# 로컬 .env.local 파일로 환경 변수 가져오기
vercel env pull --scope <team-slug>

# 변수 제거
vercel env rm VAR_NAME --scope <team-slug> -y

배포 조회

# 최근 배포 목록
vercel ls --format json --scope <team-slug>

# 특정 배포 조회
vercel inspect <deployment-url>

# 빌드 로그 보기 (Vercel CLI v35+ 필요)
vercel inspect <deployment-url> --logs

# 런타임 요청 로그 보기 (기본적으로 실시간으로 따라가며, --no-follow를 추가하면 한 번에 스냅샷)
vercel logs <deployment-url>

도메인 관리

# 도메인 목록
vercel domains ls --scope <team-slug>

# 연결되었거나 환경 변수가 연결된 디렉토리에 도메인 추가 (인수 1개)
vercel domains add <domain> --scope <team-slug>

# 연결되지 않은 디렉토리에 도메인 추가 (<project> 위치 인수 필요)
vercel domains add <domain> <project> --scope <team-slug>

Stripe Projects 요금제 변경

이 프로젝트가 Stripe Projects에 의해 관리되는 경우. 유료 또는 파괴적인 요금제 변경을 실행하기 전에 사용자에게 문의하세요. 업그레이드는 실제 카드로 청구되며, 다운그레이드는 시트를 제거합니다.

먼저 stripe projects status --json을 실행하여 Vercel 리소스의 로컬 이름을 확인하세요. 아래 예제는 기본값(vercel-plan)을 가정합니다. stripe projects add 시 이름이 변경된 경우 실제 이름으로 대체하세요.

  • Pro로 업그레이드: stripe projects add vercel/pro (또는 stripe projects upgrade vercel-plan pro)
  • Hobby로 다운그레이드: stripe projects downgrade vercel-plan hobby

Pro가 제공하는 기능

  • 월 $20 플랫폼 요금, 월 $20 사용 크레딧 포함.
  • 새 프로젝트 기본적으로 Turbo 빌드 머신 (30 vCPUs, 60 GB 메모리) — Hobby보다 훨씬 빠른 빌드.
  • 1개의 배포 시트 + 무제한 무료 Viewer 시트 (읽기 전용 협업자, 프리뷰 댓글).
  • 더 높은 포함 할당량 (월 1TB 빠른 데이터 전송, 1,000만 엣지 요청).
  • 유료 추가 기능 제공: SAML SSO, HIPAA BAA, Flags Explorer, Observability Plus, Speed Insights, Web Analytics Plus.

전체 세부 사항: https://vercel.com/docs/plans/pro-plan

작업 규칙

  • VERCEL_TOKEN을 --token 플래그로 전달하지 마세요. 환경 변수로 내보내고 CLI가 기본적으로 읽도록 하세요.
  • 사용자에게 묻기 전에 환경에서 토큰을 확인하세요. 현재 환경과 .env 파일을 먼저 확인하세요.
  • 기본적으로 프리뷰 배포를 사용하세요. 명시적으로 요청된 경우에만 프로덕션에 배포하세요.
  • git에 푸시하기 전에 물어보세요. 사용자 승인 없이 커밋을 푸시하지 마세요.
  • .vercel/ 파일을 직접 수정하지 마세요. CLI가 이 디렉토리를 관리합니다. 읽기(예: orgId 확인)는 괜찮습니다.
  • 배포된 URL을 확인하기 위해 curl/fetch를 사용하지 마세요. 대신 사용자에게 링크를 반환하세요.
  • 구조화된 출력이 후속 단계에 도움이 될 때 --format json을 사용하세요.
  • 대화형 차단을 피하기 위해 확인을 요청하는 명령어에 -y를 사용하세요.

문제 해결

토큰을 찾을 수 없음

환경 및 존재하는 모든 .env 파일을 확인하세요:

printenv | grep -i vercel
grep -i vercel .env 2>/dev/null

인증 오류

CLI가 Authentication required 오류와 함께 실패하는 경우:

  • 토큰이 만료되었거나 유효하지 않을 수 있습니다.
  • 확인: vercel whoami (환경에서 VERCEL_TOKEN 사용).
  • 사용자에게 새 토큰을 요청하세요.

잘못된 팀

스코프가 올바른지 확인하세요:

vercel whoami --scope <team-slug>

빌드 실패

빌드 로그를 확인하세요:

vercel inspect <deployment-url> --logs

일반적인 원인:

  • 종속성 누락 — package.json이 완전하고 커밋되었는지 확인하세요.
  • 환경 변수 누락 — vercel env add로 추가하세요.
  • 프레임워크 잘못된 구성 — vercel.json을 확인하세요. Vercel은 package.json에서 프레임워크(Next.js, Remix, Vite 등)를 자동 감지합니다. 감지가 잘못된 경우 vercel.json으로 재정의하세요.

CLI가 설치되지 않음

npm install -g vercel

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

alfathafp/portofolio-web-design

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).

alfathafp/portofolio-web-design

Tests in real browsers via Chrome DevTools MCP. Use when building or debugging anything that runs in a browser. Use when you need to inspect the DOM, capture console errors, analyze network requests, profile performance, or verify visual output with real runtime data. Requires the chrome-devtools MCP server to be configured.

alfathafp/portofolio-web-design

Automates CI/CD pipeline setup. Use when setting up or modifying build and deployment pipelines. Use when you need to automate quality gates, configure test runners in CI, or establish deployment strategies.

alfathafp/portofolio-web-design

Conducts multi-axis code review. Use before merging any change. Use when reviewing code written by yourself, another agent, or a human. Use when you need to assess code quality across multiple dimensions before it enters the main branch. Use when asked to review a diff or a pull request, even when the diff is pasted inline.

alfathafp/portofolio-web-design

Simplifies code for clarity. Use when refactoring code for clarity without changing behavior. Use when code works but is harder to read, maintain, or extend than it should be. Use when reviewing code that has accumulated unnecessary complexity.

alfathafp/portofolio-web-design

Establishes a project's quality bar as a written contract and stops agents quietly lowering it. Interviews the user on which dimensions matter, supplies sane default thresholds when they have no number in mind, records everything in CONSTRAINTS.md, and watches the diff for a weakened bar — new @ts-ignore or eslint-disable suppressions, skipped or deleted tests, assertions stripped out, unimplemented stubs, thresholds edited down. Use when no quality bar is written down, when the user says "set up constraints" or "define our standards", when the user wants dimensions they care about — accessibility, web performance, coverage — set up as enforced constraints, when an agent keeps silencing checks or skipping tests to get to green, when you need a coverage or performance threshold and don't know what number to pick, or when an agent writes more code than anyone will read.

alfathafp/portofolio-web-design

Optimizes agent context setup. Use when starting a new session, when agent output quality degrades, when switching between tasks, or when you need to configure rules files and context for a project.

alfathafp/portofolio-web-design

Guides systematic root-cause debugging. Use when tests fail, builds break, something that worked yesterday broke, behavior doesn't match expectations, or you encounter any unexpected error. Use when you need to figure out what broke and why — a systematic approach to finding and fixing the root cause rather than guessing.

alfathafp/portofolio-web-design

Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".

alfathafp/portofolio-web-design

Manages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code.

alfathafp/portofolio-web-design

Use when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.

alfathafp/portofolio-web-design

Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies

alfathafp/portofolio-web-design

Records decisions and documentation. Use when you need to document an architecture decision (ADR) or the reasoning behind a design choice, when changing public APIs, shipping features, or when you need to record context that future engineers and agents will need to understand the codebase.

alfathafp/portofolio-web-design

Subjects every non-trivial decision to a fresh-context adversarial review before it stands. Use when you want every assumption cross-examined before proceeding, when stress-testing a plan for hidden failure modes, when correctness matters more than speed, when working in unfamiliar code, when stakes are high (production auth, security-sensitive logic, a high-stakes migration, irreversible operations), or any time a confident output would be cheaper to verify now than to debug later.

alfathafp/portofolio-web-design

Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available

alfathafp/portofolio-web-design

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work

alfathafp/portofolio-web-design

Builds production-quality, accessible, responsive user-facing UIs. Use when building or modifying interfaces and pages, creating components, implementing layouts, meeting WCAG accessibility requirements, managing state, or when the output needs to look and feel production-quality rather than AI-generated.

alfathafp/portofolio-web-design

Structures git workflow practices. Use when making any code change. Use when committing, branching, resolving conflicts, splitting uncommitted work in a messy working tree into clean atomic commits, opening or reviewing a pull request (PR), pushing to a remote, or when you need to organize work across multiple parallel streams. Use when cutting a release, choosing a semantic version bump, tagging, or writing a changelog.

alfathafp/portofolio-web-design

Refines raw ideas into sharp, actionable concepts through structured divergent and convergent thinking. Use when an idea is still vague, when you need to stress-test assumptions before committing to a plan, or when you want to expand options before converging on one. Triggers on "ideate", "refine this idea", or "stress-test my plan".

alfathafp/portofolio-web-design

Guides stable API and interface design. Use when designing APIs, module boundaries, or any public interface. Use when creating REST or GraphQL endpoints, defining type contracts between modules, or establishing boundaries between frontend and backend.

관련 스킬