The CLI scaffolds the project, generates each kind of file with the right decorators, and drives the build. --strict turns on TypeScript's strict flags from the start, which makes DI type errors appear at compile time instead of at boot.
$ npx @nestjs/cli@12.0.3 new bookshelf-nest --package-manager npm --skip-git --strict ✨ We will scaffold your app in a few seconds.. CREATE bookshelf-nest/nest-cli.json, package.json, tsconfig.json, oxlint.json, .prettierrc CREATE bookshelf-nest/vitest.config.ts, vitest.config.e2e.ts, src/app.module.ts, main.ts 🚀 Successfully created project bookshelf-nest [15 files]
Three things there are newer than most Nest tutorials. package.json sets "type": "module" and tsconfig.json sets "module": "nodenext", so a Nest 12 project is ESM and its own imports carry .js extensions — import { AppModule } from './app.module.js' even though the file on disk is .ts. The test runner is Vitest 102,989 , not Jest 62,362 ; the linter is oxlint, not ESLint 39,810 . And emitDecoratorMetadata is what lets Nest read a constructor's parameter types at runtime.
npx nest generate resource books --no-spec then emits a controller, module, service and two DTOs — its last line, UPDATE src/app.module.ts, registers the new module for you.
src/ main.ts bootstrap.ts (pipes, versioning, OpenAPI) app.module.ts config/env.ts
books/ books.module books.controller books.service books.service.spec
dto/ create-book update-book list-books
auth/ auth.module auth.controller auth.service data/ store.ts data.module.ts
common/ guards.ts decorators.ts logging.interceptor.ts http-exception.filter.ts