Skip to content
Dinvolt
Esc
↑↓navigate↵open⌘Jpreview
On this page

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 --json
bunx dinvolt vercel setup --team my-team --project my-project \
  --origin https://my-project.vercel.app --apply --json
pnpm dlx dinvolt vercel setup --team my-team --project my-project \
  --origin https://my-project.vercel.app --apply --json
yarn 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 --json
bunx dinvolt vercel setup --team my-team --new-project my-project \
  --origin https://my-project.vercel.app --apply --json
pnpm dlx dinvolt vercel setup --team my-team --new-project my-project \
  --origin https://my-project.vercel.app --apply --json
yarn dlx dinvolt vercel setup --team my-team --new-project my-project \
  --origin https://my-project.vercel.app --apply --json

Use --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 --json
bunx 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 --json
pnpm 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 --json
yarn 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 --json

The 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 --json
bunx dinvolt vercel setup --team my-team --project my-project \
  --origin https://my-project.vercel.app --preview \
  --email-file ../hosting-email.json --apply --json
pnpm dlx dinvolt vercel setup --team my-team --project my-project \
  --origin https://my-project.vercel.app --preview \
  --email-file ../hosting-email.json --apply --json
yarn dlx dinvolt vercel setup --team my-team --project my-project \
  --origin https://my-project.vercel.app --preview \
  --email-file ../hosting-email.json --apply --json

For 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.

Was this page helpful?