W3cubDocs

/Angular

new

ng new [name] [options]
ng n [name] [options]

Creates and initializes a new Angular application that is the default project for a new workspace.

Provides interactive prompts for optional configuration, such as adding routing support. All prompts can safely be allowed to default.

  • The new workspace folder is given the specified project name, and contains configuration files at the top level.

  • By default, the files for a new initial application (with the same name as the workspace) are placed in the src/ subfolder.

  • The new application's configuration appears in the projects section of the angular.json workspace configuration file, under its project name.

  • Subsequent applications that you generate in the workspace reside in the projects/ subfolder.

If you plan to have multiple applications in the workspace, you can create an empty workspace by using the --no-create-application option. You can then use ng generate application to create an initial application. This allows a workspace name different from the initial app name, and ensures that all applications reside in the /projects subfolder, matching the structure of the configuration file.

Arguments

name

The name for the new workspace and the initial project. This name will be used for the root directory and various identifiers throughout the project.

Value Type

string

Options

ai-config

Specifies which AI tools to generate configuration files for. These file are used to improve the outputs of AI tools by following the best practices.

Value Type

array

Allowed Values

agents, claude, copilot, cursor, gemini, jetbrains, none, windsurf

collection

A collection of schematics to use in generating the initial application.

Value Type

string

commit

Configure the initial Git commit for the new repository.

Value Type

boolean

Default

true

create-application

Create a new initial application project in the new workspace. When false, creates an empty workspace with no initial application. You can then use the ng generate application command to create applications in the projects directory.

Value Type

boolean

Default

true

defaults

Disable interactive input prompts for options with a default.

Value Type

boolean

Default

false

directory

The directory where the new workspace and project should be created. If not specified, the workspace will be created in the current directory.

Value Type

string

dry-run

Run through and reports activity without writing out results.

Value Type

boolean

Default

false

file-name-style-guide

The file naming convention to use for generated files. The '2025' style guide (default) uses a concise format (e.g., app.ts for the root component), while the '2016' style guide includes the type in the file name (e.g., app.component.ts). For more information, see the Angular Style Guide (https://angular.dev/style-guide).

Value Type

string

Allowed Values

2016, 2025

Default

2025

force

Force overwriting of existing files.

Value Type

boolean

Default

false

help

Shows a help message for this command in the console.

Value Type

boolean

inline-style

Include the styles for the initial application's root component directly within the app.component.ts file. By default, a separate stylesheet file (e.g., app.component.css) is created.

Value Type

boolean

inline-template

Include the HTML template for the initial application's root component directly within the app.component.ts file. By default, a separate template file (e.g., app.component.html) is created.

Value Type

boolean

interactive

Enable interactive input prompts.

Value Type

boolean

Default

true

minimal

Generate a minimal Angular workspace without any testing frameworks. This is intended for learning purposes and simple experimentation, not for production applications.

Value Type

boolean

Default

false

new-project-root

The path where new projects will be created within the workspace, relative to the workspace root. By default, new projects are created in the projects directory.

Value Type

string

Default

projects

package-manager

The package manager used to install dependencies.

Value Type

string

Allowed Values

bun, npm, pnpm, yarn

prefix

The prefix to apply to generated selectors for the initial project. For example, if the prefix is my-app and you generate a component named my-component, the selector will be my-app-my-component.

Value Type

string

Default

app

routing

Enable routing in the initial application project. This sets up the necessary files and modules for managing navigation between different views in your application.

Value Type

boolean

skip-git

Do not initialize a Git repository in the new workspace. By default, a Git repository is initialized to help you track changes to your project.

Value Type

boolean

Default

false

skip-install

Skip the automatic installation of packages. You will need to manually install the dependencies later.

Value Type

boolean

Default

false

skip-tests

Skip the generation of unit test files spec.ts.

Value Type

boolean

Default

false

ssr

Configure the initial application for Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering).

Value Type

boolean

standalone

Creates an application based upon the standalone API, without NgModules.

Value Type

boolean

Default

true

strict

Enable stricter type checking and stricter bundle budgets settings. This setting helps improve maintainability and catch bugs ahead of time. For more information, see https://angular.dev/tools/cli/template-typecheck#strict-mode

Value Type

boolean

Default

true

style

The type of stylesheet files to be created for components in the initial project.

Value Type

string

Allowed Values

css, less, sass, scss, tailwind

test-runner

The unit testing runner to use.

Value Type

string

Allowed Values

karma, vitest

Default

vitest

view-encapsulation

Sets the view encapsulation mode for components in the initial project. This determines how component styles are scoped and applied. Options include: Emulated (default, styles are scoped to the component), None (styles are global), and ShadowDom (styles are encapsulated using Shadow DOM).

Value Type

string

Allowed Values

Emulated, None, ShadowDom

zoneless

Create an initial application that does not utilize zone.js.

Value Type

boolean

Super-powered by Google ©2010–2025.
Code licensed under an MIT-style License. Documentation licensed under CC BY 4.0.
https://angular.dev/cli/new