What is Angular CLI?
Why Interviewers Ask This
This question tests conceptual clarity. Interviewers want to hear a precise, confident definition before moving to more complex Angular topics. It also reveals how well you can explain technical ideas to non-experts.
Answer
The Angular CLI (Command Line Interface) is an official command-line tool that streamlines development workflows: project creation, code generation, building, testing, and serving. Install: npm install -g @angular/cli. Key commands: ng new project-name — create a new Angular application with routing and CSS/SCSS choice; ng serve — start dev server with HMR (hot module replacement) on localhost:4200; ng build — compile for production (output to dist/); ng build --configuration production — production build with optimizations (tree shaking, minification, AOT); ng test — run unit tests via Karma; ng e2e — run end-to-end tests; ng lint — run ESLint. Code generation (ng generate / ng g): ng g component user-profile, ng g service auth, ng g module features/admin --routing, ng g directive highlight, ng g pipe currency-format, ng g guard auth, ng g interceptor logging, ng g class user.model, ng g interface user, ng g enum user-role. Schematics: CLI uses schematics for code generation — Angular Material adds its own schematics (ng add @angular/material configures the entire library). ng update — update Angular and dependencies. ng add — add libraries with configuration. ng deploy — deploy to platforms (Firebase, GitHub Pages, etc.).
Pro Tip
If you're unsure about a detail, say so honestly and explain your reasoning. Interviewers respect candidates who can think through uncertainty rather than bluffing.