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
Create new NestJS applications with comprehensive customization options including language selection, package manager choice, and project structure configuration.
Creates a new NestJS application with the specified name and configuration options.
# Create new application
nest new [name] [options]
nest n [name] [options]
# Options:
--directory [directory] # Specify the destination directory
-d, --dry-run # Report actions without writing results (default: false)
-g, --skip-git # Skip git repository initialization (default: false)
-s, --skip-install # Skip package installation (default: false)
-p, --package-manager [manager] # Specify package manager (npm, yarn, pnpm)
-l, --language [language] # Programming language (TypeScript, JavaScript, ts, js)
-c, --collection [collectionName] # Schematics collection to use (default: @nestjs/schematics)
--strict # Enable strict mode in TypeScript (default: false)Usage Examples:
# Create a new app with default settings
nest new my-app
# Create app with custom directory
nest new my-app --directory ./projects
# Create JavaScript project with yarn
nest new my-app --language javascript --package-manager yarn
# Create project without git initialization
nest new my-app --skip-git
# Create project and skip package installation
nest new my-app --skip-install
# Create project with strict TypeScript mode
nest new my-app --strict
# Dry run to see what would be created
nest new my-app --dry-runSpecify the programming language for your new project.
# TypeScript (default)
-l typescript
-l ts
# JavaScript
-l javascript
-l jsChoose your preferred package manager for dependency management.
# NPM (default)
-p npm
# Yarn
-p yarn
# PNPM
-p pnpmWhen creating a new project, the CLI generates the following structure:
my-app/
├── src/
│ ├── app.controller.spec.ts
│ ├── app.controller.ts
│ ├── app.module.ts
│ ├── app.service.ts
│ └── main.ts
├── test/
│ ├── app.e2e-spec.ts
│ └── jest-e2e.json
├── nest-cli.json
├── package.json
├── README.md
├── tsconfig.build.json
└── tsconfig.jsonSpecify which schematics collection to use for project generation.
# Default NestJS schematics
-c @nestjs/schematics
# Custom schematics collection
-c my-custom-schematicsProject configuration file defining build settings and project structure:
{
"collection": "@nestjs/schematics",
"sourceRoot": "src"
}The generated package.json includes common development scripts:
{
"scripts": {
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json"
}
}The command validates language options and will throw an error for invalid languages:
# This will fail
nest new my-app --language python
# Error: Invalid language "python" selected. Available languages are "typescript" or "javascript"