CLI

new

Command
ng new
ng n

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 Typestring

Options

collection
Aliasc

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

Value Typestring
commit

Configure the initial Git commit for the new repository.

Value TypebooleanDefaulttrue
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 TypebooleanDefaulttrue
defaults

Disable interactive input prompts for options with a default.

Value TypebooleanDefaultfalse
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 Typestring
dry-run
Aliasd

Run through and reports activity without writing out results.

Value TypebooleanDefaultfalse
experimental-zoneless

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

Value TypebooleanDefaultfalse
force

Force overwriting of existing files.

Value TypebooleanDefaultfalse
help

Shows a help message for this command in the console.

Value Typeboolean
inline-style
Aliass

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 Typeboolean
inline-template
Aliast

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 Typeboolean
interactive

Enable interactive input prompts.

Value TypebooleanDefaulttrue
minimal

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

Value TypebooleanDefaultfalse
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 TypestringDefaultprojects
package-manager

The package manager used to install dependencies.

Value Typestring
prefix
Aliasp

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 TypestringDefaultapp
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 Typeboolean
server-routing

Create a server application in the initial project using the Server Routing and App Engine APIs (Developer Preview).

Value Typeboolean
skip-git
Aliasg

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 TypebooleanDefaultfalse
skip-install

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

Value TypebooleanDefaultfalse
skip-tests
AliasS

Skip the generation of unit test files spec.ts.

Value TypebooleanDefaultfalse
ssr

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

Value Typeboolean
standalone

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

Value TypebooleanDefaulttrue
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 TypebooleanDefaulttrue
style

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

Value Typestring
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 Typestring
Jump to details