Automate Vercel setup
Agents and scripts
Authenticate with the Vercel CLI or provide VERCEL_TOKEN before running without prompts. Complete database setup separately; this mode does not open other wizards.
Configure an existing project
Replace the sample team, project and origin with your values:
npx dinvolt vercel setup --team my-team --project my-project \
--origin https://my-project.vercel.app --apply --jsonbunx dinvolt vercel setup --team my-team --project my-project \
--origin https://my-project.vercel.app --apply --jsonpnpm dlx dinvolt vercel setup --team my-team --project my-project \
--origin https://my-project.vercel.app --apply --jsonyarn dlx dinvolt vercel setup --team my-team --project my-project \
--origin https://my-project.vercel.app --apply --json--apply is required. The origin must be verified and assigned to that project. Existing local links must match your choices.
Create a new project
Use --new-project instead of --project:
npx dinvolt vercel setup --team my-team --new-project my-project \
--origin https://my-project.vercel.app --apply --jsonbunx dinvolt vercel setup --team my-team --new-project my-project \
--origin https://my-project.vercel.app --apply --jsonpnpm dlx dinvolt vercel setup --team my-team --new-project my-project \
--origin https://my-project.vercel.app --apply --jsonyarn dlx dinvolt vercel setup --team my-team --new-project my-project \
--origin https://my-project.vercel.app --apply --jsonUse --preview for staging-backed previews. If several Git remotes exist, select one with --git-remote.
Use --add-domain to associate a domain you already own. Its ownership and DNS must be ready.
Replace an existing variable
List only the variables you intend to replace using target:KEY:
npx dinvolt vercel setup --team my-team --project my-project \
--origin https://app.example.com --add-domain \
--replace production:NEXT_PUBLIC_SITE_URL,production:BETTER_AUTH_URL \
--apply --jsonbunx dinvolt vercel setup --team my-team --project my-project \
--origin https://app.example.com --add-domain \
--replace production:NEXT_PUBLIC_SITE_URL,production:BETTER_AUTH_URL \
--apply --jsonpnpm dlx dinvolt vercel setup --team my-team --project my-project \
--origin https://app.example.com --add-domain \
--replace production:NEXT_PUBLIC_SITE_URL,production:BETTER_AUTH_URL \
--apply --jsonyarn dlx dinvolt vercel setup --team my-team --project my-project \
--origin https://app.example.com --add-domain \
--replace production:NEXT_PUBLIC_SITE_URL,production:BETTER_AUTH_URL \
--apply --jsonThe authentication variable in this example applies to admin projects. Other variables and branch overrides are preserved.
Supply recovery-email settings
Save a private file outside Git, such as ../hosting-email.json:
{
"production": {
"RESEND_API_KEY": "<production-api-key>",
"EMAIL_FROM": "My App <noreply@example.com>"
},
"preview": {
"RESEND_API_KEY": "<preview-api-key>",
"EMAIL_FROM": "My App Preview <preview@example.com>"
}
}
Then select both targets:
npx dinvolt vercel setup --team my-team --project my-project \
--origin https://my-project.vercel.app --preview \
--email-file ../hosting-email.json --apply --jsonbunx dinvolt vercel setup --team my-team --project my-project \
--origin https://my-project.vercel.app --preview \
--email-file ../hosting-email.json --apply --jsonpnpm dlx dinvolt vercel setup --team my-team --project my-project \
--origin https://my-project.vercel.app --preview \
--email-file ../hosting-email.json --apply --jsonyarn dlx dinvolt vercel setup --team my-team --project my-project \
--origin https://my-project.vercel.app --preview \
--email-file ../hosting-email.json --apply --jsonFor Production only, omit --preview and remove the preview entry from the file.
JSON output contains the plan, verified result and completed steps without variable values. See CLI options and JSON results for the full reference.