Ever typed something like this and wished it just worked?
npx starter-structure-cli my-app react vite ts tailwind express prisma mysql
Well, now it does. I built starter-structure-cli an open source Node.js CLI that generates production-ready starter projects from stack tokens you type in plain English.
The Problem
Every time I started a new project, I'd spend hours:
- Setting up folder structure
- Wiring up the frontend to the backend
- Configuring ORMs, auth, styling
- Copy-pasting boilerplate from old projects
I wanted one command that just gives me a working project with my exact stack.
What It Does
npx starter-structure-cli my-app
That's it. You get an interactive prompt that walks you through picking your stack. Or skip the prompts entirely:
npx starter-structure-cli my-app react vite ts tailwind express prisma mysql
It ships with 30+ templates across 6 categories:
| Category | Example |
|---|---|
| Single App | react-vite-ts-tailwind |
| Frontend-only | react-admin-dashboard |
| Backend-only | express-prisma-mysql-jwt |
| Fullstack | react-vite-ts-tailwind-express-prisma-mysql |
| Monorepo (Client/Server) | nextjs-express-prisma |
| Monorepo (Turbo + pnpm) | nextjs-api-nestjs-prisma |
Stacks covered: React, Next.js, Vue, Vite, Tailwind CSS, shadcn/ui, Express, NestJS, Prisma, Mongoose, Sequelize, MongoDB, MySQL, PostgreSQL, JWT, NextAuth — and growing.
The Cool Parts
1. Natural Language Matching
You don't need to memorize template names. Just throw stack words at it:
npx starter-structure-cli my-app reactjs tailwind css nodejs prisma mysql
The CLI normalizes aliases automatically:
-
reactjs→react -
tailwindcss→tailwind -
typescript→ts -
next→nextjs
It even ignores filler words like with, project, app, and css.
2. Composable Template System
Templates aren't just static folders. They're built from composable layers:
template-sources/
bases/ → shared project skeletons
layers/ → stack-specific overlays
presets/ → final template definitions (JSON)
components/ → reusable snippets (package.json, README, styles)
A preset JSON file defines how layers compose:
{
"output": "templates/fullstack/react-vite-ts-tailwind-express-prisma-mysql",
"base": ["bases/fullstack/react-vite-ts-tailwind-express"],
"layers": ["layers/backend-only/prisma-mysql"],
"variables": { "DB": "mysql" }
}
This means adding a new database variant is just a new 5-line JSON preset — not a whole new template folder.
The system also supports {{ include: }} directives with cycle detection, so templates can reference shared snippets without infinite loops.
3. Interactive + Non-Interactive
Fully interactive with @clack/prompts:
npx starter-structure-cli my-app
# → Pick category → Pick stack options → Generate
Or fully automated for CI/scripts:
npx starter-structure-cli my-app \
--category fullstack \
--frontend react \
--backend express \
--orm prisma \
--database mysql \
-y
4. Smart Defaults
- If both JS and TS variants exist, TypeScript is preferred unless you pass
--language js -
__APP_NAME__placeholders are replaced in file names, folder names, and file contents - Auto-installs dependencies with
--install(supports npm, pnpm, yarn)
Generated Project Structures
Fullstack:
my-app/
client/ → React/Vue/Next.js frontend
server/ → Express/NestJS backend
Monorepo (Turbo):
my-app/
apps/
web/ → frontend
api/ → backend
Templates include starter structure for components, routes, hooks, services, controllers, and data modules — not just empty folders.
How I Built It
The entire CLI is built with:
- Pure Node.js (ES Modules, zero build step)
- @clack/prompts — beautiful terminal UI
- picocolors — lightweight terminal colors
- A custom template build pipeline that composes presets at publish time
The architecture is intentionally simple. No frameworks, no bundlers, no compilation. Just Node.js doing what it does best — file system operations and CLI parsing.
Try It
npx starter-structure-cli my-app
Or browse the templates:
npx starter-structure-cli --list
GitHub: github.com/mohosin2126/starter-structure-cli
npm: npmjs.com/package/starter-structure-cli
Star it if you find it useful ⭐ and feel free to open issues or contribute new templates!
Top comments (0)