### What? Using `create-payload-app` to initialize Payload in an existing Next.js app **that does not already have Payload installed** overwrites any existing data in the `.env` and `.env.example` files. The desired behavior is for Payload variables to get added with no client data lost. ### How? Updates `manageEnvFiles` to check for existing `.env / .env.example` file and appends or creates as necessary. Adds tests to `packages/create-payload-app/src/lib/create-project.spec.ts`. #### Fixes https://github.com/payloadcms/payload/issues/10355
Create Payload App
CLI for easily starting new Payload project
Usage
USAGE
$ npx create-payload-app
$ npx create-payload-app my-project
$ npx create-payload-app -n my-project -t website
OPTIONS
-n my-payload-app Set project name
-t template_name Choose specific template
Available templates:
blank Blank Template
website Website Template
ecommerce E-commerce Template
plugin Template for creating a Payload plugin
payload-demo Payload demo site at https://demo.payloadcms.com
payload-website Payload website CMS at https://payloadcms.com
--use-npm Use npm to install dependencies
--use-yarn Use yarn to install dependencies
--use-pnpm Use pnpm to install dependencies
--no-deps Do not install any dependencies
-h Show help