nest
CLI for NestJS, a progressive Node
TLDR
Create new project
SYNOPSIS
nest [new] [generate] [start] [build] [options] [args]
DESCRIPTION
nest is the CLI for NestJS, a progressive Node.js framework for building server-side applications. It generates projects and components following NestJS conventions.
New projects include TypeScript configuration, testing setup, and the NestJS module structure. The generator creates controllers, services, modules, and other components.
The resource generator creates complete CRUD functionality including controller, service, DTOs, and entities. It can generate REST, GraphQL, or WebSocket resources.
Development server includes hot reload. Code changes trigger automatic restart. Production builds optimize for deployment.
The modular architecture separates concerns into modules, each containing related controllers, services, and providers. The CLI maintains this structure.
NestJS supports Express or Fastify as underlying HTTP servers, with decorators providing routing and dependency injection.
PARAMETERS
new NAME
Create new project.generate, g TYPE NAME
Generate component.start
Start application.build
Build application.info
Display project info.add LIBRARY
Add NestJS library.--watch, -w
Watch mode for development.--prod
Build for production.--flat
Don't create directory for generated file.--spec
Generate spec file (default true).--no-spec
Skip spec file generation.--dry-run, -d
Report actions without writing.--skip-git
Skip git initialization.
CAVEATS
Requires Node.js 16+. Generated code uses TypeScript. Some features need additional packages. Learning curve for decorators and dependency injection.
HISTORY
NestJS was created by Kamil MyĆliwiec in 2017, inspired by Angular's architecture. It brought Angular-style dependency injection and decorators to Node.js backend development. The CLI provides Rails-like code generation.
SEE ALSO
node(1), npm(1), express(1), typescript(1)
