Interactive Usage
Full walkthrough of the better-ts-stack CLI prompt flow
How the CLI Works
better-ts-stack is entirely interactive. There are no subcommands or flags - just run the command and answer the prompts. The CLI generates a complete, configured project based on your choices.
Run npx better-ts-stack and follow the prompts. That is the only interface.
Prompt Flow
Welcome screen
You will see an animated banner with the product name and a brief welcome message.
Project name
? Project name:
my-awesome-projectRules:
- Must be a valid directory name
- Cannot be empty, cannot contain spaces, cannot start with a dot
- Use hyphens or underscores for multi-word names
Valid examples: my-api, cool-app-v2, customer_portal
Application type
? Application type:
(*) Backend API
( ) Full-stack| Option | What it generates |
|---|---|
| Backend API | Express.js server (prompts for framework next) |
| Full-stack | Next.js 16 or TanStack Start (prompts for framework) |
Full-stack generates a single project at the root of your chosen
directory, not a separate backend/ + frontend/ monorepo.
Backend framework (Backend API only)
? Select a backend framework:
(*) Express
( ) NestJS (coming soon)Available now: Express.js
Coming soon: NestJS - selecting it shows a warning and re-prompts.
This prompt does not appear for Full-stack projects.
Frontend framework (Full-stack only)
? Select a frontend framework:
(*) Next.js 16 (App Router)
( ) TanStack Start (React) (Release Candidate)| Option | What it generates |
|---|---|
| Next.js 16 | App Router, next dev/next build, standalone server |
| TanStack Start | File-based routing, vite dev, served by srvx |
Database type
? Select a database:
(*) none
( ) postgresql
( ) mongodb| Choice | Availability |
|---|---|
| none | Backend and Full-stack |
| PostgreSQL | Backend and Full-stack |
| MongoDB | Backend and full-stack (Mongoose) |
ORM / ODM (shown only when a database is selected)
For PostgreSQL:
? Select an ORM for postgresql:
(*) prisma
( ) drizzle| ORM | Available in |
|---|---|
| Prisma | Backend (Express) and Full-stack (Next.js and TanStack Start) |
| Drizzle | Backend (Express) and Full-stack (Next.js and TanStack Start) |
For MongoDB:
? Select an ORM for mongodb:
(*) prisma
( ) mongoose| ODM | Notes |
|---|---|
| Mongoose | Express, Next.js, and TanStack |
If you select none for database type, this prompt is skipped entirely.
Package manager
? Select a package manager:
(*) npm
( ) pnpm
( ) bunThe generated dev script and install commands are tailored to your choice. With bun, the dev script uses bun --watch instead of tsx watch.
Docker
? Use Docker?
( ) yes (*) noIf yes, three files are added: Dockerfile, docker-compose.yml, and .dockerignore.
Authentication
? Add authentication?
( ) Yes (*) NoExpress backend - JWT-based auth with jsonwebtoken and bcrypt. Always prompted regardless of database selection.
Next.js / TanStack full-stack - Better Auth with a database adapter. This prompt only appears if you selected a database. If you chose none for database, auth is skipped automatically.
Git initialization
? Init git?
(*) yes ( ) noIf yes, the CLI runs git init and creates an initial commit after generating the project files.
Install dependencies
? Install dependencies now?
( ) yes (*) noIf yes, the CLI runs your chosen package manager's install command after generating the project.
Confirmation summary
Before generating, the CLI displays a summary box:
Project Name: my-awesome-api
Target Dir: ./my-awesome-api
App Type: Backend API
Framework: express
Database: postgresql-prisma
Auth: Yes
Docker: No
Package Mgr: npm
Git Init: Yes
Install Deps: No
? Looks good? Ready to build?
(*) Yes ( ) NoSelect Yes to start generation, or No to cancel without making changes.
Generation and next steps
The CLI generates your project based on your selections, then optionally installs dependencies and initializes git.
On success you will see output similar to:
cd my-awesome-api
npm install # if you skipped dependency install
npm run devAfter Generation
Scripts - Backend (Express)
npm run dev # tsx watch src/index.ts (hot reload)
npm run build # tsc (compile TypeScript to dist/)
npm run start # node dist/index.js
npm run lint # eslint src
npm run format # prettier --write "src/**/*.ts"
npm run type:check # tsc --noEmitWith database (Prisma):
npm run prisma:generate
npm run prisma:migrate
npm run prisma:studioWith database (Mongoose): no additional scripts - connection is handled in src/lib/db.ts.
With Docker:
npm run docker:build
npm run docker:up
npm run docker:down
npm run docker:logsScripts - Full-stack (Next.js)
npm run dev # next dev
npm run build # next build
npm run start # next start
npm run lint # eslintScripts - Full-stack (TanStack Start)
npm run dev # vite dev
npm run build # vite build (dist/server/server.js + dist/client)
npm run start # srvx --prod -s ../client dist/server/server.js
npm run type:check # tsc --noEmit
npm run lint # eslint srcWith database (Prisma):
npm run prisma:generate
npm run prisma:migrate
npm run prisma:studioWith database (Drizzle):
npm run db:generate
npm run db:migrate
npm run db:studioTips
- Use descriptive project names - they become folder names and
package.jsonnames - Start with defaults - PostgreSQL + Prisma + Express is the most tested combination
- Add Docker from the start - easier than retrofitting it later
- Check
.env.example- copy it to.envand fill in values before starting the server - Review the generated code - all files are plain TypeScript; edit them freely
The CLI generates production-ready code as a starting point. Always review and test before deploying.