nest-cli

Scaffolds, builds, and serves NestJS applications through schematics-driven code generation and pluggable compiler backends.

Tool
npm
v12.0.0
2,196stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
93/100Excellent
Development Activity96
Maintenance96
Community80
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
75/100Good
Architecture85
Code Quality85
Innovation78
Learning Curve50

@nestjs/cli is the official command-line tool for the NestJS framework, handling everything from project scaffolding to production builds. It wraps Angular DevKit’s schematics engine to generate controllers, modules, services, and other building blocks through the nest generate command, while nest new bootstraps a complete project structure with your choice of package manager.

Under the hood, the CLI supports interchangeable compiler backends — tsc, Webpack, and the newer SWC/rspack pipeline — selectable per project via nest-cli.json, along with a watch mode for incremental rebuilds during development. Additional commands cover monorepo project management, third-party library installation (nest add), guided major-version upgrades (nest upgrade), and deployment to NestJS Mau through an on-demand companion binary.

What You Get

  • Project scaffolding via nest new with interactive package-manager and configuration prompts
  • Schematics-driven code generation (nest generate) for modules, controllers, services, and more, backed by @nestjs/schematics with support for custom collections
  • Pluggable compiler backends (tsc, Webpack, and SWC/rspack) selectable per project, with a watch mode for incremental development builds
  • Monorepo support for managing multiple apps and libraries from one nest-cli.json configuration
  • nest add for installing and wiring up NestJS ecosystem libraries in one step
  • nest upgrade for guided, schematics-driven migration to new major NestJS versions
  • One-command deployment to NestJS Mau via an on-demand companion binary

Common Use Cases

  • Bootstrapping a new NestJS project with a chosen package manager and TypeScript configuration
  • Generating boilerplate for a new REST resource (module + controller + service + DTOs) in one command
  • Switching a project’s build pipeline from Webpack to SWC for faster incremental compiles
  • Managing a monorepo with multiple NestJS apps and shared libraries under one CLI
  • Running guided upgrades when migrating an existing app to a new major NestJS release

Under The Hood

Architecture The CLI is organized as a thin bin/nest.ts entrypoint that boots a Commander.js program and hands off to commands/command.loader.ts, which registers one Command/Action pair per verb (NewCommand/NewAction, BuildCommand/BuildAction, GenerateCommand/GenerateAction, and so on) — a clean command-pattern separation where each commands/*.command.ts only parses CLI options into a typed context object and each actions/*.action.ts extends AbstractAction to perform the actual work. Cross-cutting concerns live in dedicated lib/ subsystems: lib/configuration loads and merges nest-cli.json, lib/schematics wraps Angular DevKit’s schematics engine behind an AbstractCollection/CollectionFactory so nest generate, nest add, and nest upgrade all share one schematic-execution path, lib/compiler swaps between Webpack, rspack, and a plain tsc-based compiler behind a common interface selected via nest-cli.json’s builder field, and lib/runners normalizes package-manager invocations behind an AbstractRunner/RunnerFactory pair. This layering means a new package manager or compiler backend can be added by implementing one interface rather than touching the command layer, and the deploy action’s lazy install-on-first-use pattern for the companion Mau binary shows the same swap-in-a-dependency philosophy applied to an entire external command.

Tech Stack Built as an ESM-only TypeScript codebase with strict mode enabled, the CLI layers Commander.js for argument parsing, Inquirer for interactive prompts, and lightweight terminal-UI helpers for colors, spinners, and tables. Code generation delegates to Angular DevKit’s schematics packages and the official NestJS schematics collection rather than reimplementing a template engine. Build backends span multiple toolchains simultaneously — Webpack, rspack, and SWC — all declared as optional peer dependencies so a project only installs the one it actually uses, with path-alias resolution plugins wired in for each. A file-watching library powers incremental rebuilds, a glob-matching library handles the asset manager’s copy rules, and the package ships its own compiled output through a dedicated build step plus Git-hook-driven linting and formatting on commit.

Code Quality The test suite is extensive, with unit specs mirroring the actions/, commands/, and lib/ source tree closely, plus a separate end-to-end suite that exercises real command invocations rather than only mocking collaborators. Strict TypeScript is enabled across the whole source tree, error handling favors typed catch guards that check error instanceof Error over swallowing exceptions, and naming is consistent throughout (matching Command/Action pairs, shared abstract base classes). Continuous integration runs install, build, and test on every push, a linter and formatter enforce style, and pre-commit hooks gate what reaches the repository — together a well-tested, typed, and CI-enforced codebase.

API Design The CLI’s public surface is a small, memorable verb set — new, generate, build, start, add, upgrade, deploy, info — with consistent flag conventions across commands, and getting started requires a single scaffolding command with no manual configuration authoring beforehand. Ergonomics lean on existing ecosystem conventions rather than inventing new ones: schematics for code generation matching Angular’s model, Commander for argument parsing, and interactive prompts as a fallback when required flags are omitted. The main friction point is the peer-dependency surface for build backends — a project must know which compiler package to install depending on its chosen builder — but this is a deliberate flexibility tradeoff made explicit through optional peer-dependency metadata rather than a hidden requirement.

Used by 18 apps in this directory

TypeScript
72%
AGPL 3.0

APITable

Low Code Platforms · Databases

15,588

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
74
Repo Health
77
Technical
60
Dependency
Built with
TypeScript72%
Java22%
Updated yesterday
TypeScript
96%
Other

Amplication

Developer Tools · AI Code Assistants · Automation

16,011

Create production-ready backend services with your organization's standards baked in — generating NestJS, Prisma, and GraphQL code that you own and control.

View details
60
Repo Health
84
Technical
60
Dependency
Built with
TypeScript96%
Updated 2 months ago
TypeScript
97%
AGPL 3.0

Bigcapital

Invoicing Finance

3,884

Self-hostable double-entry accounting platform with invoicing, inventory, multi-currency, and real-time financial reporting for small and medium businesses.

View details
91
Repo Health
77
Technical
61
Dependency
Built with
TypeScript97%
Updated yesterday
TypeScript
96%
Other

Cal.diy

Scheduling

48,218

The 100% MIT-licensed, community-driven scheduling platform — self-host your own booking infrastructure with no enterprise strings attached.

View details
95
Repo Health
86
Technical
65
Dependency
Built with
TypeScript96%
Updated yesterday
TypeScript
95%
AGPL 3.0

Docmost

Productivity · Note Taking · Collaboration

21,600

Self-hosted collaborative wiki and knowledge base with real-time editing, diagrams, AI assistance, and enterprise access controls — a modern alternative to Confluence and Notion.

View details
89
Repo Health
70
Technical
70
Dependency
Built with
TypeScript95%
Updated yesterday
TypeScript
98%
Other

Hexabot

AI Development · Automation

1,213

Build and run agentic workflows across channels with YAML, tools, and RAG

View details
77
Repo Health
76
Technical
65
Dependency
Built with
TypeScript98%
Updated 2 weeks ago
TypeScript
95%
AGPL 3.0

HeyForm

Forms Surveys · No Code Platforms

8,965

Open-source conversational form builder with AI generation, conditional logic, and 30+ integrations — self-host with full data ownership.

View details
85
Repo Health
67
Technical
67
Dependency
Built with
TypeScript95%
Updated 1 weeks ago
TypeScript
71%
Other

highlight.io

Developer Tools · Analytics · Monitoring

9,372

Open-source full-stack monitoring that unifies session replay, error tracking, logging, and distributed tracing so you can stop context-switching between tools.

View details
69
Repo Health
78
Technical
65
Dependency
Built with
TypeScript71%
Go16%
Updated 2 weeks ago
TypeScript
67%
MIT

Hoppscotch

Developer Tools

80,226

A lightweight, offline-capable API development ecosystem for testing HTTP, GraphQL, WebSocket, MQTT, and SSE endpoints across web, desktop, and CLI.

View details
92
Repo Health
83
Technical
66
Dependency
Built with
TypeScript67%
Vue25%
Updated yesterday

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search