Skip to content

Repository files navigation

create-sailor

Public mirror for create-sailor from Nebutra/Nebutra-Sailor.

This repository is generated from the Nebutra Sailor monorepo. Package releases are cut from the monorepo and mirrored here for discovery, standalone cloning, and contribution intake.

  • Canonical source: packages/ops/create-sailor in Nebutra/Nebutra-Sailor
  • Package registry: npm and GitHub Packages
  • Contributions: open issues or PRs here; maintainers port accepted changes back into the monorepo source package

Governed scaffolding for AI-native SaaS. Bootstrap the Nebutra Sailor platform baseline with multi-tenant foundations, region-aware defaults, and production-ready AI integrations.

npm version License: AGPL-3.0 Commercial License

Quick Start

# npx
npx create-sailor@latest

# npm
npm create sailor@latest

# pnpm
pnpm create sailor@latest

# bun
bunx create-sailor@latest

What You Get

  • Governed platform baseline — web app, marketing site, API gateway, docs, Storybook, studio, and supporting infra packages scaffolded as one coherent monorepo
  • Verified scaffolding path — region-aware defaults, template checks, and reproducible project bootstrap instead of hand-assembling a starter stack
  • AI runtime foundation — provider registry, Vercel AI SDK v5, OpenAI-compatible endpoints, and agent-ready packages wired into the platform baseline
  • Global + China delivery surface — email, storage, monitoring, analytics, SMS, payments, and CN social login options selected through one scaffolding flow
  • Brand, tenant, and compliance primitives — white-label branding, multi-tenant foundations, and China-market compliance scaffolding already wired in

Usage

Interactive (recommended)

npx create-sailor@latest

Interactive flow:

  1. Where — new folder (name, default my-app) or current directory (smart default if cwd is empty)
  2. Region / Auth / AI topology
  3. Plan — compact summary; confirm or customize payment · email · storage · deploy
  4. Done — short golden path (cd → env → migrate → dev)

Everything else uses region-aware smart defaults (--yes skips prompts).

npx create-sailor@latest my-app   # new folder
npx create-sailor@latest .        # current directory

The AI prompt is topology-first:

  • gateway — Multi-provider AI Gateway / router, the recommended default. The scaffold seeds a small provider registry for local development, but runtime provider enablement stays a governance/routing concern.
  • direct — Direct SDK/provider adapters for teams that intentionally want concrete providers wired at create time.
  • custom — OpenAI-compatible endpoint for proxy, local, or enterprise gateway deployments.
  • none — Skip AI scaffolding.

Non-interactive (expert mode)

npm create sailor@latest my-app \
  --region=cn \
  --auth=clerk \
  --social-login=wechat,dingtalk,feishu \
  --ai=deepseek,qwen,siliconflow \
  --email=aliyun-dm \
  --storage=aliyun-oss \
  --monitoring=sentry \
  --analytics=baidu \
  --sms=aliyun-sms \
  --payment=wechat \
  --deploy=selfhost \
  -y

CLI Flags

Flag Values Default
--region global · cn · hybrid global
--auth clerk · betterauth · nextauth · supabase · none clerk
--social-login wechat,qq,dingtalk,workweixin,feishu,weibo (comma-sep) none
--payment stripe · lemon · wechat · alipay · none region-based
--ai expert/non-interactive provider seed, comma-separated ids; omit it to use the governed gateway topology gateway seed
--email resend · postmark · ses · aliyun-dm · tencent-ses · netease · none region-based
--storage r2 · s3 · supabase-storage · aliyun-oss · tencent-cos · qiniu · none region-based
--monitoring sentry · datadog · aliyun-arms · tingyun · none region-based
--analytics posthog · plausible · umami · baidu · sensors · none region-based
--sms twilio · aliyun-sms · tencent-sms · yunpian · none region-based
--deploy vercel · railway · cloudflare · selfhost vercel
--docs fumadocs · none fumadocs
--orm prisma · drizzle · none prisma
--db postgres · mysql · sqlite · none postgresql
--queue qstash · bullmq · upstash · sqs · none region-based
--search meilisearch · typesense · algolia · pgvector · none region-based
--cache upstash-redis · vercel-kv · redis · dragonfly · none region-based
--notifications novu · knock · custom · none none
--webhooks svix · custom · none none
--cms sanity · contentful · strapi · none none
--feature-flags vercel-flags · growthbook · configcat · none none
--captcha turnstile · hcaptcha · aliyun-slide · none region-based
--mcp on · off on
--metering auto · on · off auto
--billing-mode usage · seat · credits usage
--idp clerk · oauth-server clerk
--access-gate none · invite none
--cron-jobs true · false — scaffold scheduled cron handlers true
--audit-log true · false — enable /settings/audit-log + arch test true
--api-keys true · false — enable /settings/api-keys page true
--command-palette true · false — enable ⌘K command palette true
--cookie-consent true · false — enable GDPR/CCPA cookie banner true
--legal-pages true · false — enable dynamic /legal/[slug] route true
--china-compliance true · false — enable @nebutra/china-compliance + ICP footer true when --region=cn, otherwise false
--i18n / --no-i18n boolean true
-y, --yes accept all defaults (non-interactive)
--dry-run preview actions without writing
--json machine-readable output

--deploy remains a bootstrap shortcut. The generated project also writes a provider-switchable deployTargets map into nebutra.config.json and appends matching DEPLOY_TARGET_* values to .env.example:

  • vercel → Vercel frontends, Cloudflare Workers gateway, ECS Docker origin
  • cloudflare → Cloudflare Pages frontends, Cloudflare Workers gateway, ECS Docker origin
  • railway → Railway for frontends, gateway, and origin
  • selfhost → standalone frontends, ECS/Docker-style gateway and origin

Region Presets

Region Email Storage Analytics Monitoring SMS Payment
global Resend R2 PostHog Sentry Twilio Stripe
cn Alibaba Cloud DirectMail Alibaba Cloud OSS Baidu Analytics Sentry Alibaba Cloud SMS WeChat Pay
hybrid Resend Alibaba Cloud OSS PostHog Sentry Alibaba Cloud SMS Stripe

Social login (CN)

Adding --social-login=wechat,dingtalk extends your primary auth provider (Clerk or Better Auth) with China-region OAuth:

  • Generates apps/web/src/app/api/auth/callback/<id>/route.ts stubs with the correct token-exchange endpoints (WeChat / QQ / DingTalk / WeCom / Feishu / Weibo)
  • Generates apps/web/src/components/auth/SocialLoginButtons.tsx with one button per selected provider
  • Appends all required env vars to .env.example

The primary auth provider still owns user/session lifecycle — the generated callbacks exchange code for provider access tokens and leave a intentional SAMPLE marker for primary-auth upsert for the user to wire up.

After Scaffolding

cd my-app
pnpm install
# create .env.local and add your provider credentials
pnpm db:migrate
pnpm db:seed
pnpm dev

Useful follow-ups:

pnpm brand:init
pnpm brand:apply
pnpm generate:api-types

Why Sailor?

Sailor is not a thin starter with a long feature checklist. It is the governed platform baseline Nebutra uses for AI-native SaaS: auth, billing, branding, docs, tenant-aware app structure, and AI integration are scaffolded into a single monorepo you can extend instead of re-assembling from scratch.

Roadmap

  • Verified scaffolding — immutable template delivery, scaffold smoke validation, and safer bootstrap defaults
  • Remote feature registrynebutra add with compatibility checks, provider awareness, and controlled file application
  • Harness runtime — stronger MCP, agent, and automation primitives for AI-native SaaS workflows
  • Upgrade path — version-aware migrations, diagnostics, and guided adoption of new platform capabilities

Documentation

License

AGPL-3.0 with a commercial license exception. See LICENSE-COMMERCIAL.md for details. Commercial and individual licensing details: get-license.


Built by Nebutra for teams shipping AI-native products.

About

Governed AI-native SaaS scaffolder — bootstrap a production monorepo with multi-tenant defaults.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages