or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

build-system-integration.mdcli-commands.mdindex.mdpackage-management.mdprogrammatic-api.mdschematics-integration.mdworkspace-configuration.md
tile.json

cli-commands.mddocs/

CLI Commands

The Angular CLI provides 16 primary commands covering the entire Angular development lifecycle, from project creation through deployment. Each command supports extensive configuration options and can be used both interactively and in automated environments.

Capabilities

Project Creation and Management

Commands for creating new projects and managing existing workspaces.

New Project Command

Create a new Angular workspace and application.

ng new <name> [options]
ng n <name> [options]  # alias

Common Options:

  • --routing: Add routing module
  • --style=<format>: Stylesheet format (css, scss, sass, less)
  • --skip-git: Skip git repository initialization
  • --skip-install: Skip package installation
  • --package-manager=<manager>: Package manager to use

Usage Examples:

# Create basic Angular application
ng new my-app

# Create with routing and SCSS
ng new my-app --routing --style=scss

# Create without git and package installation
ng new my-app --skip-git --skip-install

# Create with specific package manager
ng new my-app --package-manager=pnpm

Add Package Command

Add packages to an Angular workspace with automatic configuration.

ng add <package> [options]

Usage Examples:

# Add Angular Material
ng add @angular/material

# Add PWA support
ng add @angular/pwa

# Add Angular Universal (SSR)
ng add @angular/ssr

Update Command

Update Angular packages and dependencies to newer versions.

ng update [packages...] [options]

Common Options:

  • --all: Update all packages
  • --force: Force update even with peer dependency warnings
  • --migrate-only: Run migrations without updating packages

Usage Examples:

# Check for updates
ng update

# Update Angular core packages
ng update @angular/core @angular/cli

# Update all packages
ng update --all

Code Generation

Commands for generating Angular code using schematics.

Generate Command

Generate code using Angular schematics.

ng generate <schematic> [options]
ng g <schematic> [options]  # alias

Available Schematics:

  • component (alias: c): Generate component
  • service (alias: s): Generate service
  • module (alias: m): Generate module
  • directive (alias: d): Generate directive
  • pipe (alias: p): Generate pipe
  • guard: Generate route guard
  • interface (alias: i): Generate interface
  • enum (alias: e): Generate enum
  • class (alias: cl): Generate class

Usage Examples:

# Generate component
ng generate component user-profile
ng g c user-profile --skip-tests

# Generate service
ng generate service user
ng g s user --skip-tests

# Generate module with routing
ng generate module feature --routing

# Generate directive
ng generate directive highlight
ng g d highlight

# Generate pipe
ng generate pipe capitalize
ng g p capitalize

Development Workflow

Commands for developing, building, and testing Angular applications.

Serve Command

Serve the application in development mode with live reload.

ng serve [options]
ng s [options]  # alias
ng dev [options]  # alias

Common Options:

  • --port=<number>: Port to listen on
  • --host=<host>: Host to bind to
  • --open (alias: -o): Open browser automatically
  • --configuration=<config>: Build configuration
  • --prod: Use production configuration
  • --ssl: Serve using HTTPS

Usage Examples:

# Basic development server
ng serve

# Serve on specific port with browser open
ng serve --port 4300 --open

# Serve with production configuration
ng serve --configuration production

# Serve with HTTPS
ng serve --ssl

Build Command

Build the application for production deployment.

ng build [options]  
ng b [options]  # alias

Common Options:

  • --configuration=<config>: Build configuration
  • --prod: Use production configuration
  • --output-path=<path>: Output directory
  • --base-href=<href>: Base href for the application
  • --source-map: Generate source maps

Usage Examples:

# Production build
ng build --configuration production

# Build with custom output path
ng build --output-path dist/my-app

# Build with source maps
ng build --source-map

# Build with custom base href
ng build --base-href /my-app/

Test Command

Run unit tests using the configured test runner.

ng test [options]
ng t [options]  # alias

Common Options:

  • --watch: Watch files for changes
  • --code-coverage: Generate code coverage report
  • --browsers=<browsers>: Browsers to run tests in
  • --karma-config=<config>: Karma configuration file

Usage Examples:

# Run tests in watch mode
ng test

# Run tests once with coverage
ng test --watch=false --code-coverage

# Run tests in headless browser
ng test --browsers ChromeHeadless

E2E Test Command

Run end-to-end tests.

ng e2e [options]
ng e [options]  # alias

Usage Examples:

# Run e2e tests
ng e2e

# Run e2e tests for specific project
ng e2e my-app-e2e

Lint Command

Run linting tools on the project.

ng lint [options]

Usage Examples:

# Lint all files
ng lint

# Lint with fix option
ng lint --fix

# Lint specific project
ng lint my-library

Utility Commands

Support commands for configuration, analytics, and tooling.

Version Command

Display version information for Angular CLI and installed packages.

ng version [options] 
ng v [options]  # alias

Usage Examples:

# Show version information
ng version

# Show abbreviated version
ng v

Configuration Command

Get and set Angular CLI configuration values.

ng config [json-path] [value] [options]

Usage Examples:

# Show all configuration
ng config

# Get specific configuration value
ng config cli.packageManager

# Set configuration value
ng config cli.packageManager pnpm

# Set global configuration
ng config --global cli.packageManager yarn

Analytics Command

Configure Angular CLI usage analytics.

ng analytics <setting> [options]

Settings:

  • on: Enable analytics
  • off: Disable analytics
  • info: Show analytics status
  • prompt: Show analytics prompt

Usage Examples:

# Enable analytics
ng analytics on

# Disable analytics
ng analytics off

# Check analytics status
ng analytics info

Completion Command

Set up command-line autocompletion for the Angular CLI.

ng completion [options]

Usage Examples:

# Set up bash completion
ng completion

# Generate completion script
ng completion script

Advanced Commands

Specialized commands for advanced use cases.

Cache Command

Manage the Angular CLI build cache.

ng cache [options]

Subcommands:

  • clean: Clean the cache
  • disable: Disable caching
  • enable: Enable caching
  • info: Show cache information

Usage Examples:

# Clean build cache
ng cache clean

# Show cache info
ng cache info

# Disable cache
ng cache disable

Deploy Command

Deploy the application using configured deployment builders.

ng deploy [options]

Usage Examples:

# Deploy using default configuration
ng deploy

# Deploy with specific configuration
ng deploy --configuration production

Extract I18n Command

Extract internationalization messages from the application.

ng extract-i18n [options]

Common Options:

  • --output-path=<path>: Output directory for extracted messages
  • --format=<format>: Output format (xlf, xlf2, xliff, xliff2, json)

Usage Examples:

# Extract i18n messages
ng extract-i18n

# Extract with custom output path
ng extract-i18n --output-path locale

# Extract in JSON format
ng extract-i18n --format json

Run Command

Execute custom architect targets defined in angular.json.

ng run <target> [options]

Usage Examples:

# Run custom build target
ng run my-app:build:production

# Run custom lint configuration
ng run my-app:lint:strict

MCP Command

Start Model Context Protocol server for AI integration.

ng mcp [options]

Usage Examples:

# Start MCP server
ng mcp

# Start MCP server on specific port
ng mcp --port 3000

Make This Awesome Command

Hidden motivational command that displays encouraging messages for developers.

ng make-this-awesome

Usage Examples:

# Display motivational message
ng make-this-awesome

Note: This is a hidden easter egg command that provides motivational phrases to developers. It performs no actual operations but can boost morale during development sessions.

Command Infrastructure

Command Options

All commands support common global options:

  • --help: Show help information
  • --version: Show version information
  • --verbose: Enable verbose logging
  • --quiet: Suppress non-error output

Exit Codes

Commands return standard exit codes:

  • 0: Success
  • 1: General error
  • 2: Invalid usage
  • 3: Environment error (Node.js version)

Environment Variables

Commands recognize these environment variables:

  • NG_DEBUG: Enable debug logging
  • NG_DISABLE_VERSION_CHECK: Skip version compatibility checks
  • NG_CLI_ANALYTICS: Override analytics setting
  • NG_FORCE_TTY: Force TTY mode