ng
Angular CLI
TLDR
SYNOPSIS
ng command [arguments] [options]
DESCRIPTION
ng is the Angular CLI. It creates, develops, builds, tests and maintains Angular applications and libraries.Workspace configuration lives in angular.json. Most commands run builders (Architect targets) or schematics defined there; new projects use the esbuild-based application builder with a Vite dev server.A project-local CLI in node_modules takes precedence over a globally installed one, so each workspace uses its own CLI version.
COMMANDS
new [name] (alias n)
Create a new Angular workspace.serve [project] (aliases dev, s)
Build and serve the application, rebuilding on file changes.build [project] (alias b)
Compile an application or library into an output directory (dist/ by default).generate schematic (alias g)
Generate or modify files (component, service, directive, pipe, guard, etc.).test [project] (alias t)
Run unit tests.e2e [project] (alias e)
Build, serve and run end-to-end tests (requires an e2e package to be added).add package
Install a library and run its setup schematic.update [packages]
Update the workspace and its dependencies, running migrations.lint [project]
Run linting (requires a linter such as angular-eslint).deploy [project]
Invoke the deploy builder.extract-i18n [project]
Extract i18n messages from source code.run target
Run an Architect target, e.g. project:target[:configuration].config [json-path] [value]
Get or set values in angular.json.cache
Configure the persistent disk cache and show statistics.analytics
Configure usage analytics.completion
Set up shell autocompletion.version (alias v)
Show Angular CLI and package versions.--help
Display help for any command.
CAVEATS
Requires a supported Node.js version (checked at startup). Most commands only work inside an Angular workspace. ng lint, ng e2e and ng deploy do nothing until a corresponding package is added (e.g. ng add @angular-eslint/schematics).
HISTORY
Angular CLI was created by Google and first released in 2016 alongside Angular 2, originally based on ember-cli. It has followed Angular's major version numbering since version 6 (2018).
SEE ALSO
ng-new(1), ng-serve(1), ng-build(1), ng-generate(1), ng-add(1), ng-update(1), npm(1), node(1), nx(1)
