CLI reference
Every flag of create-payload-stack.
npx create-payload-stack@latest [name] [options]| Flag | Values | Default |
|---|---|---|
-n, --name <name> | Project name (also the directory) | prompt |
-d, --db <db> | postgres, mongodb, sqlite, vercel-postgres | prompt (postgres) |
--db-connection-string <url> | Written to .env as DATABASE_URL | prompt, per-database default |
--auth <list> | Comma-separated: email-password, magic-link, passkey | prompt |
--social <list> | Comma-separated: google, github | prompt |
--organizations / --no-organizations | Enable teams | prompt (on) |
--billing <mode> | organization, user, none | prompt |
--storage <adapter> | none, vercel-blob, s3, r2, azure, gcs, uploadthing | prompt (none = local disk) |
--emails / --no-emails | Edit email copy in the admin with Payload Emails | prompt (on) |
--consent / --no-consent | Cookie banner and audited legal pages with Payload Consent | prompt (on) |
--scheduler / --no-scheduler | Scheduled and recurring actions with Payload Action Scheduler | prompt (on) |
--runner <kind> | clock, vercel, server, later — what runs the job queue. Asked only with a scheduler; see Scheduled actions | prompt (clock) |
--use-pnpm, --use-npm, --use-yarn, --use-bun | Package manager | detected |
--no-install | Skip dependency installation | install |
--no-git | Skip git init | init |
-y, --defaults | Accept defaults for every unanswered prompt | |
--branch <ref> | Branch or tag of the template repository | main |
--local-template <path> | Scaffold from a local checkout of templates/payload-stack | |
--dry-run | Print 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 \
-yWhat the CLI writes
src/stack.config.tsfrom your answers.src/payload.config.tswith the chosen database adapter (between thedatabase-adaptermarkers) and the chosen storage adapter (between thestorage-adaptermarkers; local disk when skipped).package.jsonwith the matching@payloadcms/db-*and@payloadcms/storage-*dependencies and your project name.src/emailsin one of two shapes, and the plugin registration between theemails-pluginmarkers ofpayload.config.ts— see Emails.src/consentin one of two shapes: a plainlegal-pagescollection, or Payload Consent with the banner, the consent records and the audited legal pages — see Legal pages and consent.src/schedulerin 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, avercel.jsonthat runs the queue..envfrom.env.example, withDATABASE_URL, a generatedPAYLOAD_SECRETandBETTER_AUTH_SECRET,NEXT_PUBLIC_APP_URL, and — with a scheduler — a generatedCRON_SECRET(andRUN_JOBS_IN_PROCESSfor--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.