Reference
CLI Reference
The complete command surface — project management, add/remove operations, quick-mode flags, generated scripts, and what happens when you mistype.
Project management
| Command | Description |
|---|---|
| cem dev | Start the dev server with live reload and a pretty terminal UI |
| cem build | Middleware guard + architecture guard + compile TypeScript to dist/ |
| cem start | Start the production server with preflight checks and safety guards |
| cem check | Type check, lint and format check in one go |
| cem list · cem ls | List modules, middlewares, env vars and Swagger status |
Add commands
| Command | Description |
|---|---|
| cem add module <Name...> | Scaffold one or more complete feature modules |
| cem add env <KEY...> | Add env vars to .env, .env.example and config/index.ts |
| cem add middleware <name...> | Create one or more middlewares in src/app/middlewares/ |
Remove commands
| Command | Description |
|---|---|
| cem remove module <Name...> | Delete module folder(s) and unwire from routes/index.ts |
| cem remove middleware <name...> | Delete custom middleware file(s) |
| cem remove env <KEY...> | Remove env var(s) from all three config locations |
cem rm is an alias for cem remove and works with every subcommand.
Quick mode (-y / --yes)
Skip every prompt and scaffold with the recommended stack:
bash
cem my-api -y
# or
npx create-express-modular my-api --yesDefaults applied: Mongoose · Zod · JWT auth · HTTP-only cookies · Docker · Swagger.
Overriding flags
bash
# Prisma + PostgreSQL instead of Mongoose
cem my-api -y --db prisma
# Skip Docker
cem my-api -y --no-docker
# Drizzle, Joi and header-based auth
cem my-api -y --db drizzle --validator joi --headerGenerated project scripts
| npm | yarn / pnpm / bun | Equivalent to |
|---|---|---|
| npm run start:dev | yarn start:dev · pnpm start:dev · bun start:dev | cem dev |
| npm run build | yarn build · pnpm build · bun run build | cem build |
| npm run check | yarn check · pnpm check · bun run check | cem check |
| npm start | yarn start · pnpm start · bun start | cem start |
| npm run lint | yarn lint · pnpm lint · bun run lint | eslint src |
| npm run lint:fix | yarn lint:fix · pnpm lint:fix · bun run lint:fix | eslint src --fix |
| npm run prettier:fix | yarn prettier:fix · pnpm prettier:fix · bun run prettier:fix | prettier --write src |
Unknown commands
Pass an unknown flag and the CLI prints the full command list instead of a stack trace:
✖ Unknown flag: "--fix"
⚠ Available commands:
cem [project-name] — scaffold a new project
cem dev — start dev server with hot reload
cem build — compile TypeScript to dist/
cem start — start the production server
cem check — run type-check, lint, and format check
cem list — list modules, middlewares, and env vars
cem add module <name...> — generate one or more feature modules
cem add middleware <name...> — generate one or more custom middlewares
cem add env <KEY...> — add one or more env variables
cem remove module <name...> — delete module(s) and unwire routes
cem remove middleware <name...> — delete middleware file(s)
cem remove env <KEY...> — remove env var(s) from all config files
cem --version — print the installed version
cem --help — show this help message