Command-line interface tool for initializing, developing, and maintaining NestJS applications
—
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Pending
The risk profile of this skill
Start NestJS applications in development mode with hot reloading, debugging support, and comprehensive configuration options. The development server provides an efficient workflow for rapid application development and testing.
Launches your NestJS application with development-focused features and extensive customization options.
# Start application
nest start [app] [options]
# Options:
-c, --config [path] # Path to nest-cli configuration file
-p, --path [path] # Path to tsconfig file
-w, --watch # Run in watch mode (live-reload)
-b, --builder [name] # Builder to be used (tsc, webpack, swc)
--watchAssets # Watch non-ts (e.g., .graphql) files mode
-d, --debug [hostport] # Run in debug mode (with --inspect flag)
--webpack # Use webpack for compilation (deprecated, use --builder)
--webpackPath [path] # Path to webpack configuration
--type-check # Enable type checking (when SWC is used)
--tsc # Use typescript compiler for compilation
--sourceRoot [sourceRoot] # Points at the root of the source code
--entryFile [entryFile] # Path to the entry file
-e, --exec [binary] # Binary to run (default: "node")
--preserveWatchOutput # Use "preserveWatchOutput" option when using tsc watch mode
--shell # Spawn child processes within a shell (default: true)
--no-shell # Do not spawn child processes within a shell
--env-file [path] # Path to an env file (.env) to be loadedUsage Examples:
# Basic development server
nest start
# Start with watch mode (hot reload)
nest start --watch
# Start specific app in monorepo
nest start api-gateway
# Start with debug mode
nest start --debug
nest start --debug 0.0.0.0:9229
# Start with asset watching
nest start --watch --watchAssets
# Start with specific builder
nest start --builder webpack
nest start --builder swc --type-check
# Start with environment file
nest start --env-file .env.development
# Start with custom entry point
nest start --entryFile src/main.ts
# Start with custom binary
nest start --exec "node --max-old-space-size=4096"Automatically restart the application when files change:
# Enable hot reloading
nest start --watch
# Watch with asset monitoring
nest start --watch --watchAssetsWatched File Types:
Enable Node.js debugging with Inspector protocol:
# Debug on default port (9229)
nest start --debug
# Debug on specific host:port
nest start --debug 0.0.0.0:9229
nest start --debug localhost:9229
# Debug with watch mode
nest start --debug --watchDebug Configuration:
--inspect flag automaticallyLoad environment variables from files:
# Single environment file
nest start --env-file .env.development
# Multiple environment files
nest start --env-file .env --env-file .env.local# Use TypeScript compiler
nest start --builder tsc --watch
# With preserved watch output
nest start --builder tsc --watch --preserveWatchOutput# Use Webpack with HMR
nest start --builder webpack --watch
# Custom webpack configuration
nest start --builder webpack --webpackPath webpack.dev.js# Use SWC for fast development builds
nest start --builder swc --watch
# SWC with type checking
nest start --builder swc --type-check --watchControl how child processes are spawned:
# Use shell (default)
nest start --shell
# No shell spawning
nest start --no-shellSpecify the runtime binary and options:
# Default Node.js
nest start --exec node
# Node with memory optimization
nest start --exec "node --max-old-space-size=4096"
# Node with experimental features
nest start --exec "node --experimental-modules"# Start specific application
nest start api-gateway
nest start user-service
nest start payment-service
# Start with project-specific config
nest start api-gateway --config apps/api-gateway/nest-cli.json# Custom entry file
nest start --entryFile src/main.ts
nest start --entryFile apps/api/src/main.ts
# Custom source root
nest start --sourceRoot src
nest start --sourceRoot apps/api/src{
"collection": "@nestjs/schematics",
"sourceRoot": "src",
"compilerOptions": {
"builder": "webpack",
"typeCheck": true,
"assets": ["**/*.proto", "**/*.graphql"],
"watchAssets": true
},
"generateOptions": {
"spec": false
}
}Supported environment file formats:
# .env files
.env
.env.local
.env.development
.env.development.localEnvironment file example:
NODE_ENV=development
PORT=3000
DATABASE_URL=postgresql://localhost:5432/nestjs_dev
LOG_LEVEL=debug# Fastest startup with SWC
nest start --builder swc --watch
# Balance speed and features with Webpack
nest start --builder webpack --watch
# Full type safety with TypeScript
nest start --builder tsc --watch --preserveWatchOutput# Increase Node.js memory limit
nest start --exec "node --max-old-space-size=8192"
# Enable garbage collection optimization
nest start --exec "node --optimize-for-size"# Standard development workflow
nest start --watch --debug
# Full-featured development with assets
nest start --watch --watchAssets --debug --env-file .env.development
# Fast iteration development
nest start --builder swc --watch --type-checkThe development server works seamlessly with:
# Invalid builder name
nest start --builder invalid
# Error: Invalid builder option: invalid. Available builders: tsc, webpack, swcThe CLI properly handles process termination and cleanup:
In watch mode, the CLI recovers from compilation errors: