create-sailor
v1.9.6
Published
Governed AI-native SaaS scaffolder for Nebutra Sailor. Bootstrap a production-ready Next.js + Hono + Prisma monorepo with multi-tenant foundations, region-aware defaults, and AI integrations.
Maintainers
Readme
create-sailor
Governed scaffolding for AI-native SaaS. Bootstrap the Nebutra Sailor platform baseline with multi-tenant foundations, region-aware defaults, and production-ready AI integrations.
Quick Start
# npx
npx create-sailor@latest
# npm
npm create sailor@latest
# pnpm
pnpm create sailor@latest
# bun
bunx create-sailor@latestWhat 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@latestInteractive flow:
- Where — new folder (name, default
my-app) or current directory (smart default if cwd is empty) - Region / Auth / AI topology
- Plan — compact summary; confirm or customize payment · email · storage · deploy
- 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 directoryThe 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 \
-yCLI 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 · mintlify · docusaurus · nextra · vitepress · 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 | false (@nebutra/audit is WIP) |
| --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 origincloudflare→ Cloudflare Pages frontends, Cloudflare Workers gateway, ECS Docker originrailway→ Railway for frontends, gateway, and originselfhost→ 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.tsstubs with the correct token-exchange endpoints (WeChat / QQ / DingTalk / WeCom / Feishu / Weibo) - Generates
apps/web/src/components/auth/SocialLoginButtons.tsxwith 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 devUseful follow-ups:
pnpm brand:init
pnpm brand:apply
pnpm generate:api-typesWhy 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 registry —
nebutra addwith 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
- Getting Started: docs.nebutra.com/getting-started/installation
- Customization Guide: docs.nebutra.com/customization/overview
- Licensing: nebutra.com/licensing
License
MIT. This package and the projects it scaffolds are MIT — commercial use is free, with no registration, licence key, or attribution requirement.
The upstream Nebutra-Sailor monorepo is FSL-1.1-ALv2. Optional paid support tiers do not gate the software. See nebutra.com/licensing.
Built by Nebutra for teams shipping AI-native products.
