What is Angular CLI, and what are its advantages?
The Angular CLI (ng) is the official command-line tool for creating, building, and managing Angular projects. Hides the complexity of webpack, TypeScript config, and tooling setup.
Scaffolding —
ng new,ng generate component/service/module; consistent file structure and naming.Build —
ng build; production bundles with optimization, tree shaking, AOT compilation.Dev server —
ng serve; hot reload, source maps, fast feedback.Testing —
ng test(Karma/Jasmine),ng e2e(Cypress/Playwright).Linting and formatting — ESLint integration, schematics for code quality.
Updates —
ng updatehandles framework upgrades with codemods.Schematics — reusable code generators; libraries (Angular Material, NgRx) ship their own.
Name ng new, ng generate, ng serve, ng build, ng test, plus ng add for schematics (ng add @ngrx/store = one-shot install + config) and ng update for framework upgrades.