angular
TLDR
Create a new Angular workspace and application
SYNOPSIS
ng command [options]
DESCRIPTION
ng is the command-line interface for Angular, a platform for building web applications. It provides tools for creating projects, generating code, building, testing, and deploying Angular applications.
The CLI automates common development tasks through schematics - templates that generate boilerplate code for components, services, modules, and other Angular constructs. The generate command supports creating components, directives, pipes, services, classes, guards, interfaces, enums, and modules.
Projects are configured through angular.json, which defines build targets, file paths, and environment-specific settings. The CLI supports multiple projects within a single workspace, enabling monorepo-style development.
The serve command provides a development server with hot module replacement, automatically rebuilding and refreshing the browser when source files change. Production builds use build --configuration production which enables optimizations like ahead-of-time compilation, tree shaking, and minification.
PARAMETERS
new (alias: n)
Create a new Angular workspace and initial applicationserve (alias: s, dev)
Build and serve the application with live reload on file changesgenerate (alias: g)
Generate components, services, modules, pipes, directives, and other schematicsbuild (alias: b)
Compile the application into the dist/ output directorytest (alias: t)
Run unit tests using the configured test runnere2e (alias: e)
Build, serve, and run end-to-end testslint
Run linting tools on the application codeadd
Add support for an external library (installs and configures packages)update
Update the workspace and its dependenciesdeploy
Invoke the deploy builder for the projectconfig
Get or set configuration values in angular.jsoncache
Configure and manage the persistent disk cacheversion (alias: v)
Display Angular CLI version information--help
Display help for any command--dry-run
Preview changes without writing files--verbose
Enable verbose logging output
CAVEATS
Requires Node.js and npm to be installed. Global installation via npm install -g @angular/cli provides the ng command system-wide, but projects can also use locally installed versions. Some commands like deploy require additional packages to be installed first using ng add.
HISTORY
Angular CLI was introduced alongside Angular 2 in September 2016 to simplify project setup and development workflows. It replaced the manual configuration required for TypeScript compilation, module bundling, and build optimization. The CLI has evolved significantly, with major updates accompanying each Angular version, introducing features like differential loading, Ivy compilation, and standalone components.
SEE ALSO
npm(1), node(1), webpack(1), react-scripts(1), vue(1)


