@systemlabs/foundation-cli
Scaffold production-ready full-stack projects in under 3 minutes.
npx @systemlabs/foundation-cli create my-app
Foundation CLI is a dependency-aware project assembler. You describe your intent — "I want a SaaS with Next.js, Express, PostgreSQL, and JWT auth" — and the engine resolves the full dependency graph, merges configurations without conflicts, injects integration code, and produces a working project.
It is NOT:
- A static template copier (like
create-next-app or degit)
- A code scaffolding tool (like Yeoman or Hygen)
- A deployment tool — it generates deployment config, not deploy artifacts
Quick start
npx @systemlabs/foundation-cli
npm install -g @systemlabs/foundation-cli
foundation create my-app
Example session
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
FOUNDATION CLI · Build your architecture in minutes
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
? Project name › my-saas-app
? What are you building?
❯ SaaS Application
AI Application
E-commerce
API Backend
Internal Tool
? Frontend framework › Next.js
? Backend › Express
? Database › PostgreSQL
? ORM › Prisma
? Auth › JWT
? UI system › Tailwind + ShadCN
? Deployment › Docker
✔ Files staged (47 files)
✔ npm packages installed
🎉 my-saas-app is ready. cd my-saas-app && npm run dev
Commands
Create
foundation create [project-name]
foundation new [project-name]
foundation create my-app --preset saas
Available presets: saas, ai-app, ecommerce, api-backend, internal-tool
Module management
foundation add orm-prisma
foundation add stripe
foundation add foundation-plugin-redis
foundation switch orm prisma
foundation switch backend nestjs
foundation switch database mongodb
foundation search <query>
Code generation
foundation generate model Post
foundation generate crud Post
foundation generate --list
Project inspection
foundation info
foundation doctor
foundation validate
Dev automation
foundation dev
foundation test
foundation db migrate
foundation db seed
foundation db reset
foundation db studio
foundation db push
Tooling
foundation eject [module-id]
foundation upgrade [--dry-run]
foundation create-plugin [name]
AI assistant (optional — requires API key)
foundation ai "create a blog with posts, comments, and JWT auth"
Requires ANTHROPIC_API_KEY or OPENAI_API_KEY in your environment. The CLI sends your prompt to the model with the full module catalogue, receives a structured plan, and runs foundation add + foundation generate automatically.
Available modules
Frontend
Next.js · React + Vite · Vue 3 · Svelte
Backend
Express · NestJS · FastAPI · Django
Database
PostgreSQL · MySQL · MongoDB · SQLite · Supabase
ORM
Prisma · TypeORM · Mongoose · SQLAlchemy
Auth
JWT · OAuth (Google + GitHub) · Session · Clerk · Auth0
UI
Tailwind CSS · ShadCN/UI · Material UI · Chakra UI · Bootstrap
State
Zustand · Redux Toolkit · TanStack Query
Deployment
Docker · Vercel · Render · AWS ECS
Official add-ons
Stripe · Redis · OpenAI
How it works
Every project generation runs through a four-stage pipeline:
- Module Registry — loads, validates, and indexes all built-in and plugin modules
- Dependency Resolver — builds a DAG of selected modules, detects conflicts, topologically sorts
- Composition Planner — merges file trees and config patches before touching disk
- Execution Pipeline — renders EJS templates, writes files atomically via
FileTransaction, runs 14 lifecycle hooks, installs packages
All file writes are staged to a temp directory and committed atomically. Any failure rolls back completely — no partial scaffolds.
Configuration files
After generation, your project contains:
.foundation/
├── project.lock ← exact module + CLI versions (read by upgrade, switch, info, doctor)
└── foundation.config.json ← user selections + installed plugins (read by add, switch, generate, eject)
Requirements
- Node.js ≥ 18
- npm, pnpm, or yarn
Part of the Foundation CLI ecosystem
License
MIT — see LICENSE