GenerateSaaS

generatesaas init

Scaffold a new SaaS project from the licensed boilerplate. Answer grouped prompts to choose your stack and features, or pass flags for non-interactive CI.

generatesaas init is the main entry point: it verifies your API key, collects options through grouped prompts, activates a license, downloads a versioned template tarball, runs the file generators, then installs dependencies and inits git. Every answer either flips a flag in @repo/config or wires up infrastructure, so the generated project ships with exactly the features you chose.

The flow

Run npx generatesaas@latest init <your-license-key> (the key from your purchase). Add flags to pre-fill any answer (e.g. --frontend, --payment stripe), or --yes to accept defaults non-interactively.

Verify access. Your API key is resolved in priority order - --api-key, then GENERATESAAS_API_KEY, then the saved ~/.generatesaas config, then a prompt - checked against the version index, then saved back to ~/.generatesaas. An invalid key (401) re-prompts, or aborts under --yes.

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

Confirm the summary. A grouped recap prints; answer n to abort with nothing written. If the target directory already exists and is non-empty, you first choose Merge, Overwrite, or Cancel (--yes auto-merges).

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

Prompt groups

Prompts are data-driven from CLI metadata and shown in labelled sections. Credentials only appears when a chosen provider needs env vars.

GroupWhat it coversDefaults
ProjectProject name, app display name, location, frontend frameworkname my-saas, location ./{name}
InfrastructureDeployment target, architecture (fullstack / separate), database provider, cache providernode, fullstack, postgres, redis
FeaturesPayment provider + currency, email provider, multi-tenancy + billing scope, blog, docs app, credits, social login providers, revenue sharingstripe + USD, smtp, multi-tenancy off (user scope), blog on, docs off, credits on, no social, revenue sharing off
ToolingDocker services to scaffold, AI coding tools to install skills forpostgres, redis, inngest; no AI tools
CredentialsOptional env values for the providers you picked (DB, cache, payment, email, social)all skipped

Credentials are always optional: press Enter to skip any and fill them into the generated .env later. Multi-tenancy, docs, social login, and revenue sharing default off and hide the feature when disabled; blog and credits default on. See Configuration for how each answer maps onto a @repo/config flag.

Incompatible combinations

The CLI never offers an answer that cannot be built:

  • Architecture × deployment target: blocked pairs (e.g. a separate-backend split that the target cannot host) are removed; a conflicting --architecture + --deploy flag combo errors out.
  • Database / cache × target: providers incompatible with the chosen target are filtered; if only one remains it auto-selects.
  • Edge runtime: when the target runs on edge, unavailable 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.
  • Dependent toggles: billing scope only appears with multi-tenancy on; currency is skipped (defaults USD) and credits are forced off when the payment provider is none.

Non-interactive use

For CI or scripted scaffolds, pass every answer as a flag plus --yes:

generatesaas init \
  --name my-saas \
  --frontend <framework> \
  --deploy node \
  --database neon \
  --payment stripe --currency USD \
  --email resend \
  --org --billing-scope organization \
  --api-key "$GENERATESAAS_API_KEY" \
  --yes

--yes accepts defaults for any unspecified option and skips the confirmation prompt. A --template-version <semver> flag pins a specific release instead of latest.

--base-url <url> has no prompt - it is a power-user flag with no interactive equivalent, so it is only set via the command line. Pass it to bake your production base URL (e.g. https://example.com) into the generated canonical, og, and sitemap URLs; omit it to fall back to localhost and fill it in later.

Next steps

On this page