Skip to content
Latchkey

vercel pull Command Reference

Download project settings and environment variables from Vercel.

vercel pull retrieves a projects settings and environment variables into .vercel so a local or CI build uses the same configuration as the linked Vercel project.

What it does

vercel pull writes the projects build settings and the chosen environments variables into .vercel/.env and project.json. Running it before vercel build ensures the build environment matches the target Vercel environment exactly.

Common flags and usage

  • --environment=ENV: production, preview, or development
  • --yes: accept defaults and skip prompts
  • --token TOKEN: authenticate non-interactively
  • --git-branch BRANCH: pull env vars scoped to a branch
  • requires the project to be linked (VERCEL_ORG_ID, VERCEL_PROJECT_ID)

Example

shell
- name: Pull Vercel env
  env:
    VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
    VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
    VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
  run: vercel pull --yes --environment=production --token "${VERCEL_TOKEN}"

In CI

Set VERCEL_ORG_ID and VERCEL_PROJECT_ID so the project is linked without an interactive vercel link, then run vercel pull --yes --environment=... before vercel build. Pass --token from secrets, and choose the environment that matches the deployment you are about to make.

Key takeaways

  • vercel pull syncs project settings and env vars into .vercel before a build.
  • Set VERCEL_ORG_ID and VERCEL_PROJECT_ID so CI links without prompts.
  • Match --environment to the deployment target for correct env vars.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →