create-sailor

Interactive scaffolding wizard β€” bootstrap a production-ready Nebutra-Sailor project in seconds.

create-sailor is a one-time scaffolding tool that clones the Nebutra-Sailor template, walks you through configuration questions, and writes your .env.local β€” so you can start coding in under a minute.

Published npm package: [email protected] (use npx create-sailor@latest to pick up the current release).

Scaffold defaults prefer fast setup (--auth clerk, --deploy vercel). First-party nebutra.com production uses Better Auth on auth.nebutra.com (ECS) with app/API on ECS β€” pick --auth betterauth and --deploy selfhost (or wire ECS yourself) when matching that topology.

Usage

npx create-sailor [dir]
# pin a release: npx [email protected] my-app

If you omit [dir], the wizard prompts you for a directory name.

What it does

Prompts for a target directory (default: ./my-saas-app).

Four interactive questions: region, auth provider, and AI topology (plus directory). Everything else is resolved from flags or region-aware defaults.

Generates random AUTH_SECRET / JWT_SECRET and writes .env.local with provider-specific stub keys you fill in later.

Clones the Nebutra-Sailor monorepo, sets the project name in package.json, writes nebutra.config.json, prunes unused template features, and injects your env vars.

Outputs exactly what to run next: cd my-saas-app && pnpm install && pnpm dev.

Interactive prompts

The wizard asks only four questions; every other setting is resolved from flags or region defaults:

  1. Project directory β€” defaults to ./my-saas-app
  2. Region β€” global | cn | hybrid
  3. Auth provider β€” clerk | betterauth | nextauth | none
  4. AI topology β€” gateway (recommended) | direct | custom | none. Choosing direct triggers a follow-up multi-select for provider adapters; choosing custom triggers prompts for endpoint name, base URL, and API-key env var.

Everything else (ORM, database, payment, email, storage, etc.) is flag-only.

Core flags

FlagValuesDefault
--regionglobal, cn, hybridglobal
--ormprisma, drizzleprisma (dual-ORM when drizzle β€” adds db-drizzle alongside Prisma)
--dbpostgres, mysql, sqlite, nonepostgresql
--db-hostlocal, supabase, neon, vercel-postgres, planetscale, railway, aliyun-rds, tencent-cdb, noneregion-aware (supabase global, local cn)
--authclerk, betterauth, nextauth, noneclerk
--paymentstripe, lemon, wechat, alipay, nonestripe global / wechat cn
--aitopology shorthand (gateway, direct, custom, none) or comma-separated provider IDsgateway
--deployvercel, railway, cloudflare, selfhost, nonevercel
--docsfumadocs, none (others fall back to fumadocs in v1.x)fumadocs
-y, --yes(flag) β€” accept all defaults; non-interactiveoff
--dry-run(flag) β€” print plan, write nothingoff
--json(flag) β€” machine-readable event streamoff

--db-host=planetscale targets PlanetScale Postgres. The Vitess/MySQL product needs a separate Prisma schema and migration strategy before it can be treated as a production Sailor runtime.

For the full per-feature flag set (--email, --storage, --monitoring, --analytics, --sms, --queue, --search, --cache, --notifications, --webhooks, --cms, --feature-flags, --captcha, --mcp, --metering, --billing-mode, --idp, etc.) run npx create-sailor --help.

Advanced flags

Scaffold extras

FlagEffect
--with-workflowsAdds workflows/{inngest,n8n,pusher}/ starter directories so you can pick a provider later via nebutra workflow init.
--with-python-backendAdds a backends/python/ FastAPI stub. Only enable this when the TS-by-Default ADR exception applies β€” batch/queued work, ML/scientific compute, or specialized libraries with no TS port. The README produced asks you to cite which justification fits.
--no-installSkip pnpm install after scaffolding.
--no-gitSkip git init and the initial commit.
--no-colorDisable ANSI color in stdout (CI-friendly).

Compliance / wave-3 toggles

All accept true / false. Defaults are true except --china-compliance which auto-flips to true when --region=cn.

--cron-jobs, --audit-log, --api-keys, --command-palette, --cookie-consent, --legal-pages, --china-compliance.

Wave-2 governance

FlagValuesDefault
--billing-modeusage, seat, creditsusage
--idpclerk, oauth-serverclerk
--social-logincomma-separated CN providers (wechat,qq,dingtalk,workweixin,feishu,weibo)none

Package versioning

Scaffolded projects depend on @nebutra/* packages using npm caret ranges (e.g. "@nebutra/ui": "^0.1.0"), not workspace:*. This is what allows a create-sailor-generated repo to install and run standalone, outside of the Nebutra-Sailor monorepo. The version pins are read from the published-versions registry at scaffold time.

Example session

  create-sailor

βœ” Where should we create your project? … ./my-saas
βœ” Target region? β€Ί global β€” ζ΅·ε€–δΌ˜ε…ˆ
βœ” Auth provider? β€Ί Clerk
βœ” AI topology? β€Ί Multi-provider AI Gateway / router

  β–Έ Region            global
  β–Έ Auth              clerk
  β–Έ ORM               prisma
  β–Έ Database          postgresql
  β–Έ Payment           stripe
  β–Έ AI topology       gateway
  β–Έ Email             resend
  β–Έ Storage           r2
  β–Έ Deploy Target     vercel
  β–Έ Docs Framework    fumadocs

β ‹ Cloning Nebutra-Sailor template into ./my-saas...
βœ” Project my-saas successfully initialized!

  Next steps:
  cd ./my-saas
  pnpm install
  pnpm dev

After scaffolding

cd my-saas
pnpm install          # Install all dependencies
pnpm infra:lite       # Start PostgreSQL (Docker)
pnpm db:generate      # Generate Prisma client
pnpm db:migrate       # Run initial migrations
pnpm dev:dashboard    # Start web app + API gateway

create-sailor is a one-time tool. For day-to-day tasks (adding components, managing infra, running migrations), use the nebutra CLI after the project is created.

How is this guide?

Edit on GitHub

Last updated on

On this page