Angular 12 References/ CLI
🍀 Angular References

ng generate

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