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

CommandDescription
cem devStart the dev server with live reload and a pretty terminal UI
cem buildMiddleware guard + architecture guard + compile TypeScript to dist/
cem startStart the production server with preflight checks and safety guards
cem checkType check, lint and format check in one go
cem list · cem lsList modules, middlewares, env vars and Swagger status

Add commands

CommandDescription
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

CommandDescription
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 --yes

Defaults 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 --header

Generated project scripts

npmyarn / pnpm / bunEquivalent to
npm run start:devyarn start:dev · pnpm start:dev · bun start:devcem dev
npm run buildyarn build · pnpm build · bun run buildcem build
npm run checkyarn check · pnpm check · bun run checkcem check
npm startyarn start · pnpm start · bun startcem start
npm run lintyarn lint · pnpm lint · bun run linteslint src
npm run lint:fixyarn lint:fix · pnpm lint:fix · bun run lint:fixeslint src --fix
npm run prettier:fixyarn prettier:fix · pnpm prettier:fix · bun run prettier:fixprettier --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