GenerateSaaS

Init

Scaffold a new SaaS project from the licensed boilerplate - answer grouped prompts to pick your stack and features, or pass every answer as a flag for non-interactive CI.

generatesaas init verifies your API key, collects options through grouped prompts, activates a license, downloads a versioned template tarball, runs the generators, then installs dependencies and inits git. Every answer either flips a flag in @repo/config or wires up infrastructure.

The flow

Run npx generatesaas@latest init <your-license-key>. Add flags to pre-fill any answer (--preset serverless, --payment stripe, --database neon, ...), or --yes to accept defaults non-interactively. --preset serverless is Vercel + Neon + Upstash, --preset selfhost is Docker or Node + Postgres + Redis; an explicit --deploy/--database/--cache overrides its piece of the preset.

Verify access. The key resolves in order: --api-key, GENERATESAAS_API_KEY, saved ~/.generatesaas, then a prompt. It is checked against the version index and saved back.

Answer the prompts. Three groups plus an optional Credentials group. Incompatible answers are filtered before you see them, single-option prompts auto-select, and pre-filled flags are skipped.

Confirm the summary. Answer n to abort with nothing written. A non-empty target directory first asks Merge, Overwrite, or Cancel (--yes auto-merges).

Generators run. The license is activated, the tarball downloads, generators rewrite config/env/Docker, then pnpm install and git init finish the project.

Prompt groups

Credentials only appears when a chosen provider needs env vars.

GroupWhat it coversDefaults
ProjectProject name, app display name, locationname my-saas, location ./{name}
InfrastructureA preset first - Serverless (Vercel + Neon + Upstash), Self-host (Docker or Node + Postgres + Redis), or Customize - then deployment target, architecture (fullstack / separate), database provider, cache provider for the pieces the preset did not settleCustomize: node, fullstack, postgres, redis
FeaturesPayment provider + currency, email provider, observability, multi-tenancy, docs app, desktop app, mobile app, AI features, AI in the web app, mobile store purchases, credits, revenue sharingstripe + USD, smtp, no observability, credits on, web AI on, everything else off
CredentialsOptional env values for the providers you picked (database, cache, payment, email)all skipped

Credentials are always optional: press Enter to skip any and fill them into the generated .env later. Multi-tenancy, docs, the desktop app, AI features, and revenue sharing default off and hide the feature when disabled. Anything you do not pick is never generated - no adapter, no SDK, no bytes. The desktop app and the mobile app are offered on the Pro plan and up; on a lower plan the prompt is skipped.

The mobile app (apps/mobile, built with Expo) follows the same rule: off by default, Pro plan and up, and --mobile-purchases revenuecat adds RevenueCat store billing on top of your web payment provider rather than in place of it.

Incompatible combinations

The CLI never offers an answer it cannot build.

RuleEffect
Architecture x targetBlocked pairs are removed from the prompt; a conflicting --architecture + --deploy combination errors out.
Database / cache x targetVercel requires serverless providers: self-hosted postgres and redis are filtered off its prompts, a conflicting explicit flag (--deploy vercel --database postgres, --deploy vercel --cache redis) errors out, and if one provider remains it auto-selects. Node allows every provider - the rule is one-directional.
Edge runtimeUnavailable features (local file storage, SMTP, Content API git integration) are listed up front. Under --yes the edge-safe providers (neon, upstash, resend) auto-select and local Docker services are dropped.
Credits need moneyWith --payment none, currency defaults to USD and credits is forced off.
Web AI needs a home--no-web-ai requires --ai and an app to host it - --desktop or --mobile. The prompt appears only for an AI project with at least one app; a conflicting flag errors out.
Store purchases need an app and a provider--mobile-purchases revenuecat implies --mobile when the app is unstated, and errors out with --no-mobile or --payment none - store purchases sit on top of your web billing. --mobile-purchases none is always legal and always a no-op.

Desktop AI follows --ai - there is no separate desktop-AI flag. Every desktop project ships the app's local AI source, and --ai sets config.desktop.agents.enabled to unlock Chat, Automations, the AI settings screens, and the Terminal; --desktop --no-ai generates the same app as a client shell, and flipping that flag later turns the screens on.

Desktop-first: AI out of the web app

--desktop --ai --no-web-ai makes the desktop app the AI product and the website its storefront.

OffUnchanged
The web app's AI pages and nav: chat, automations, model and integration settings. Sign-in, account, billing and licensing stay.config.ai.enabled, the /api/ai/* routes, the desktop agents - exactly as --ai set them, so the app keeps its backend.
npx generatesaas@latest init --desktop --ai --no-web-ai --yes

One config value, config.ai.webUi - flip it in packages/config/src/index.ts, or set webAi in the manifest and re-run update.

Non-interactive use

npx generatesaas@latest init \
  --name my-saas \
  --deploy node \
  --database neon \
  --payment stripe --currency USD \
  --email resend \
  --observability sentry \
  --org \
  --ai \
  --desktop \
  --api-key "$GENERATESAAS_API_KEY" \
  --yes

--yes accepts defaults for every unspecified option and skips the confirmation prompt.

--base-url <url> has no prompt. Pass it to bake your production base URL into the generated canonical, og, and sitemap URLs; omit it to fall back to localhost and fill it in later.

Version integrity

init always scaffolds the latest template release and first checks that your installed CLI can shape it. If the CLI is too old it stops before touching anything - re-run through npx generatesaas@latest so npm delivers the current version instead of a stale cached install.

If your license's update window has ended, init offers the last release it covers and names the CLI generation to use for it (npx generatesaas@<version> init) - an older template must be scaffolded by the CLI that produced it.

Next steps

On this page