LinuxCommandLibrary

ng-config

Retrieves or sets Angular CLI configuration values

TLDR

Get a configuration value

$ ng config [jsonPath]
copy
Set a configuration value
$ ng config [jsonPath] [value]
copy
Get the default collection (schematic)
$ ng config cli.defaultCollection
copy
Set the default package manager
$ ng config cli.packageManager [npm|yarn|pnpm]
copy
Get global configuration value
$ ng config --global [jsonPath]
copy
Show all project configuration
$ ng config
copy

SYNOPSIS

ng config [jsonPath] [value] [options]

DESCRIPTION

ng config reads and writes values in the Angular workspace configuration file (angular.json). Configuration values are accessed using JSON path dot notation. When only a path is provided, the current value is displayed. When a value is also provided, the configuration is updated.
This command is useful for scripting Angular workspace setup and for inspecting or modifying build configurations, default schematics, and CLI behavior.

PARAMETERS

jsonPath

JSON path to the configuration value using dot notation (e.g., projects.myApp.architect.build).
value
New value to set at the specified JSON path. If omitted, the current value is printed.
--global, -g
Access the global CLI configuration (~/.angular-cli.json) instead of the project-level angular.json.
--help
Display help information.

CAVEATS

Part of Angular CLI. The configuration file must be valid JSON. Invalid JSON paths will produce errors. Changes to angular.json affect all developers working on the project.

HISTORY

ng config was introduced with Angular CLI 6 in 2018 as part of the workspace configuration overhaul that replaced .angular-cli.json with angular.json.

SEE ALSO

ng(1), ng-new(1), ng-build(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community