PayloadSolutions

CLI reference

Every flag of create-payload-stack.

npx create-payload-stack@latest [name] [options]
FlagValuesDefault
-n, --name <name>Project name (also the directory)prompt
-d, --db <db>postgres, mongodb, sqlite, vercel-postgresprompt (postgres)
--db-connection-string <url>Written to .env as DATABASE_URLprompt, per-database default
--auth <list>Comma-separated: email-password, magic-link, passkeyprompt
--social <list>Comma-separated: google, githubprompt
--organizations / --no-organizationsEnable teamsprompt (on)
--billing <mode>organization, user, noneprompt
--storage <adapter>none, vercel-blob, s3, r2, azure, gcs, uploadthingprompt (none = local disk)
--emails / --no-emailsEdit email copy in the admin with Payload Emailsprompt (on)
--consent / --no-consentCookie banner and audited legal pages with Payload Consentprompt (on)
--scheduler / --no-schedulerScheduled and recurring actions with Payload Action Schedulerprompt (on)
--runner <kind>clock, vercel, server, later — what runs the job queue. Asked only with a scheduler; see Scheduled actionsprompt (clock)
--use-pnpm, --use-npm, --use-yarn, --use-bunPackage managerdetected
--no-installSkip dependency installationinstall
--no-gitSkip git initinit
-y, --defaultsAccept defaults for every unanswered prompt
--branch <ref>Branch or tag of the template repositorymain
--local-template <path>Scaffold from a local checkout of templates/payload-stack
--dry-runPrint the resolved options, write nothing

Non-interactive example

npx create-payload-stack@latest ridgeline \
  -d postgres \
  --auth email-password,magic-link,passkey \
  --social github \
  --billing organization \
  --storage vercel-blob \
  --emails \
  --consent \
  --scheduler --runner clock \
  -y

What the CLI writes

  • src/stack.config.ts from your answers.
  • src/payload.config.ts with the chosen database adapter (between the database-adapter markers) and the chosen storage adapter (between the storage-adapter markers; local disk when skipped).
  • package.json with the matching @payloadcms/db-* and @payloadcms/storage-* dependencies and your project name.
  • src/emails in one of two shapes, and the plugin registration between the emails-plugin markers of payload.config.ts — see Emails.
  • src/consent in one of two shapes: a plain legal-pages collection, or Payload Consent with the banner, the consent records and the audited legal pages — see Legal pages and consent.
  • src/scheduler in one of two shapes: an empty seam, or the Action Scheduler with its ledger, its action catalogue and a run endpoint locked to a cron secret — see Scheduled actions. With --runner vercel, a vercel.json that runs the queue.
  • .env from .env.example, with DATABASE_URL, a generated PAYLOAD_SECRET and BETTER_AUTH_SECRET, NEXT_PUBLIC_APP_URL, and — with a scheduler — a generated CRON_SECRET (and RUN_JOBS_IN_PROCESS for --runner server).

The template itself is downloaded from the templates/payload-stack directory of the payload-solutions repository, exactly like create-payload-app downloads Payload's templates.

On this page