@gobuildlabs/saas-init
v3.0.4
Published
CLI tool to scaffold new SaaS projects with the starter kit
Maintainers
Readme
SaaS Init CLI
CLI tool to quickly scaffold new SaaS projects using the SaaS Starter Kit.
Installation
# Global installation
npm install -g @gobuildlabs/saas-init
# Or use directly with npx (recommended)
npx @gobuildlabs/saas-init my-saasUsage
Interactive Mode
npx @gobuildlabs/saas-initThe CLI will prompt you for:
- Project name
- Description
- Author details
- Support email
- Authentication providers (Email, Google, GitHub, Twitter)
- Features to enable (Billing, Analytics, etc.)
- Package manager (pnpm, npm, yarn)
With Project Name
npx @gobuildlabs/saas-init my-saas-appCommand Options
npx @gobuildlabs/saas-init [project-name] [options]
Options:
-t, --template <template> Template to use (default: saas-template)
--skip-git Skip git initialization
--skip-install Skip dependency installation
--use-npm Use npm instead of pnpm
--use-yarn Use yarn instead of pnpm
-h, --help Display help
-V, --version Display versionExamples
Create with npm and skip git
npx @gobuildlabs/saas-init my-app --use-npm --skip-gitCreate without installing dependencies
npx @gobuildlabs/saas-init my-app --skip-installWhat It Does
- ✅ Creates new project directory
- ✅ Clones the template repository
- ✅ Prompts for configuration (name, email, features)
- ✅ Updates
package.jsonwith your details - ✅ Updates
config/saas.config.tswith your settings - ✅ Creates
.env.localfrom.env.example - ✅ Installs dependencies (unless skipped)
- ✅ Initializes git repository (unless skipped)
- ✅ Shows next steps
After Running
The CLI creates a project with this structure:
my-saas-app/
├── app/ # Next.js pages (empty, ready for your code)
├── components/ # React components
├── config/
│ ├── saas.config.ts # ✅ Configured with your details
│ └── stripe.config.ts # ⚠️ Add Stripe Price IDs
├── lib/
│ ├── stripe-config.ts # Uses @gobuildlabs/saas-starter-kit
│ ├── supabase.ts # Supabase server client
│ ├── seo.ts # SEO helpers
│ └── utils.ts # Utilities
├── .env.local # ✅ Created (add your API keys)
├── .env.example # Template for environment variables
└── package.json # ✅ Configured with your nameNext Steps
After the CLI completes, follow these steps:
Navigate to your project
cd my-saas-appSet up Supabase
- Create project at supabase.com
- Copy URL and keys to
.env.local
Set up Stripe
- Create products in Stripe Dashboard
- Copy Price IDs to
config/stripe.config.ts - Add API keys to
.env.local
Run development server
pnpm dev # or npm/yarn devStart building! 🚀
Environment Variables
The CLI creates a .env.local file. You need to fill in:
# Supabase
NEXT_PUBLIC_SUPABASE_URL=your-project-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
# Stripe
STRIPE_SECRET_KEY=sk_test_...
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
# Database
DATABASE_URL=postgresql://...Troubleshooting
"Command not found: npx"
Make sure you have Node.js 18+ installed:
node --version # Should be v18.0.0 or higher"Template not found"
The CLI looks for templates in:
- Local:
packages/saas-template(for development) - GitHub:
gobuildlabs/saas-template(for production)
Make sure the template repository exists.
Permission errors on installation
Try with sudo (macOS/Linux):
sudo npm install -g @gobuildlabs/saas-initOr use npx instead (recommended):
npx @gobuildlabs/saas-init my-appDevelopment
To work on the CLI locally:
cd packages/cli
# Install dependencies
pnpm install
# Build
pnpm build
# Test locally
node bin/cli.js my-test-appContributing
Issues and pull requests are welcome!
License
MIT
