Skip to content

Angular CLI

The Angular CLI (Command Line Interface) is like a magic wand. Instead of manually creating 15 files to make one component, you type one command and it does everything for you.

Terminal window
# Install Angular CLI globally (do this once on your machine)
npm install -g @angular/cli
# Verify installation
ng version
Terminal window
# Create a new project
ng new my-app
# Start the development server (with live reload)
ng serve
# Generate a new component
ng generate component user-list
# Shorthand:
ng g c user-list
# Generate a service
ng g s user
# Generate a module
ng g m users
# Build for production
ng build --configuration production
# Run tests
ng test
# Get help
ng help