Back to technologies

/nest

NestJS command reference

Common NestJS CLI commands for bootstrapping and code generation.

12 matches

Project Setup

4 commands

nest new project-name

Create a new NestJS project.

nest build

Compile the application for production.

nest start --watch

Run the app in watch mode for development.

nest info

Display CLI and environment information.

Generate Resources

4 commands

nest g module users

Generate a new NestJS module.

nest g service users

Generate a service class for business logic.

nest g controller users

Generate a controller for HTTP routes.

nest g resource auth

Generate a full CRUD resource scaffold.

Note: Useful when starting REST endpoints quickly.

Testing & Debugging

4 commands

pnpm test

Run the unit test suite.

pnpm test:e2e

Run end-to-end tests.

pnpm lint

Check the project for lint issues.

node --inspect-brk dist/main.js

Launch the built app with the Node debugger attached.