Angular 9 References/ CLI

ng generate

This is the documentation for Angular 9.
You can switch to the latest version Angular 10.
ng generate [schematic] [name] [--[option]=[value]]
ng g

Generates the specified schematic.

Also Angular CLI provides a mechanism to generate code from any package (schematic-package points to an npm package name):

ng generate [schematic-package]:[schematic-name] [name]


The list of the default generators you can find in the section Schematics.

Default values of generators options can be added to your angular.json file.

Links & Tutorials


The next options can be applied to any generator.


When true, disables interactive input prompts for options with a default.
Type boolean


Run through without making any changes.
Type boolean
Default false
Aliases -d


Forces overwriting of files.
Type boolean
Default false
Aliases -f


Shows a help message for this command in the console.
Values true|false|json|JSON
Default false


When false, disables interactive input prompts.
Type boolean