create-easystarter
v0.3.0
Published
Create a new EasyStarter SaaS project from the official template
Maintainers
Readme
create-easystarter
Public CLI for scaffolding a new EasyStarter project. The template repository stays private.
Requires Node.js 22+. Accept the collaborator invite to sunshineLixun/easystarter, then:
npx create-easystarter login
npx create-easystarter my-app
npx create-easystarter init
npx create-easystarter deploypnpm create easystarter my-app and pnpm exec create-easystarter <command> work the same way after the package is installed.
Login
Machine-level auth for the two accounts this CLI needs:
- GitHub — download the private template during
create - Cloudflare —
wrangler loginforinitanddeploy
npx create-easystarter login
npx create-easystarter login github
npx create-easystarter login cloudflare
npx create-easystarter login --github-token ghp_xxx
npx create-easystarter login --forceGitHub is resolved in this order: GITHUB_TOKEN / GH_TOKEN, a token saved by login, a logged-in GitHub CLI (gh), then SSH access to sunshineLixun/easystarter. Saved tokens go to ~/.config/create-easystarter/credentials.json (or %APPDATA%\create-easystarter on Windows).
login cannot mint CLOUDFLARE_API_TOKEN. Remote D1 migrations still need that token; init opens a pre-filled dashboard form if it is missing.
Create
Scaffold a project from github:sunshineLixun/easystarter#master:
npx create-easystarter my-app
npx create-easystarter my-app --yes
npx create-easystarter my-app --auth email-password github --payments stripe --email resendUseful flags: --app-name, --auth, --payments, --native-payments, --email, --credits / --no-credits, --template, --install / --no-install, --git / --no-git, --db-migrate / --no-db-migrate, --dev / --no-dev, -y.
Init
Connect an existing project to Cloudflare D1 and R2. This does not deploy.
npx create-easystarter init
npx create-easystarter init --d1-name my-app-db --r2-name my-app-bucket
npx create-easystarter init --migrateinit logs into Cloudflare if needed, asks for D1 and R2 names (defaults {project}-db and {project}-bucket), creates or reuses those resources, writes names and the D1 id into apps/server/wrangler.jsonc, and stores account values in apps/server/.dev.vars and apps/server/.env.production. Pass --api-token to skip the dashboard form. Use --no-migrate or -y to skip optional steps.
Deploy
After init, deploy server then web to Cloudflare Workers. Server goes first so the web service binding has a target.
npx create-easystarter deploy
npx create-easystarter deploy --target server
npx create-easystarter deploy --yes --migrate --secrets
npx create-easystarter deploy --dry-run--dry-run prints the plan without deploying. --website-url and --server-url write production URLs into wrangler before deploy.
Doctor
From an EasyStarter project directory, check Node, files, selected integration secrets, Cloudflare bindings, and app-config drift against easystarter.json:
npx create-easystarter doctorSecrets
Generate a missing BETTER_AUTH_SECRET, rotate it, or fill integration keys that easystarter.json says this project uses:
npx create-easystarter secret
npx create-easystarter secret --rotate
npx create-easystarter secret --yes --set GOOGLE_CLIENT_ID=xxx --set GOOGLE_CLIENT_SECRET=yyyAdd integrations
Enable auth, payments, email, or credits on an existing project. This updates packages/app-config/src/app-config.ts and easystarter.json.
npx create-easystarter add auth github
npx create-easystarter add payments stripe
npx create-easystarter add native-payments revenuecat
npx create-easystarter add email resend
npx create-easystarter add creditsLocal development
pnpm install
pnpm cli login
pnpm cli -- playground/my-app --yes --no-dev
pnpm cli init playground/my-app
pnpm cli doctor playground/my-app
pnpm cli deploy playground/my-app --dry-runTo iterate against a local checkout of the template instead of GitHub:
pnpm cli -- playground/my-app --yes --template /path/to/easystarter --no-install --no-git --no-devGenerated test apps live in playground/ and are gitignored.
Publish
pnpm publish --access public --registry=https://registry.npmjs.org/