Catalogue des Commandes 01/04/2026 15:00:00 angularforall.com

- Angular CLI : guide complet des options ng

Angular-Cli Ng Commandes Framework-Frontend Typescript Composants Modules Services Routing Testing Deploiement Angular Schematics Standalone-Components

Guide complet des commandes Angular CLI : utilisez les options ng pour créer des projets, générer composants, services, tester et déployer vos apps.

ng new
Description :

Crée un nouveau projet Angular

Options :
  • --collection
  • -c
  • --commit
  • --create-application
  • --defaults
  • --directory
  • --dry-run ⚠️
  • -d
  • --force ⚠️
  • --inline-style
  • --inline-template
  • --interactive
  • --minimal
  • --new-project-root ⚠️
  • --package-manager
  • --prefix
  • -p
  • --routing ⚠️
  • --skip-git
  • --skip-install
  • --skip-tests
  • --standalone
  • --strict
  • --style
  • --view-encapsulation
ng generate
Description :

Génère des fichiers Angular (composants, services, modules, etc.)

Options :
  • --defaults
  • --dry-run ⚠️
  • -d
  • --force ⚠️
  • --interactive
ng generate component
Description :

Génère un nouveau composant Angular

Options :
  • --change-detection
  • --display-block
  • --dry-run ⚠️
  • -d
  • --export
  • --flat ⚠️
  • --inline-style
  • -s
  • --inline-template
  • -t
  • --module
  • -m
  • --prefix
  • -p
  • --project
  • --selector
  • --skip-import
  • --skip-selector
  • --skip-tests
  • --standalone
  • --style
  • --type
  • --view-encapsulation
ng g c
Description :

Alias pour générer un composant

Options :
  • --change-detection
  • --display-block
  • --dry-run ⚠️
  • -d
  • --export
  • --flat ⚠️
  • --inline-style
  • -s
  • --inline-template
  • -t
  • --module
  • -m
  • --prefix
  • -p
  • --project
  • --selector
  • --skip-import
  • --skip-selector
  • --skip-tests
  • --standalone
  • --style
  • --type
  • --view-encapsulation
ng generate directive
Description :

Génère une nouvelle directive Angular

Options :
  • --dry-run ⚠️
  • -d
  • --export
  • --flat ⚠️
  • --module
  • -m
  • --prefix
  • -p
  • --project
  • --selector
  • --skip-import
  • --skip-selector
  • --skip-tests
  • --standalone
ng g d
Description :

Alias pour générer une directive

Options :
  • --dry-run ⚠️
  • -d
  • --export
  • --flat ⚠️
  • --module
  • -m
  • --prefix
  • -p
  • --project
  • --selector
  • --skip-import
  • --skip-selector
  • --skip-tests
  • --standalone
ng generate pipe
Description :

Génère un nouveau pipe Angular

Options :
  • --dry-run ⚠️
  • -d
  • --export
  • --flat ⚠️
  • --module
  • -m
  • --name
  • --project
  • --skip-import
  • --skip-tests
  • --standalone
ng g p
Description :

Alias pour générer un pipe

Options :
  • --dry-run ⚠️
  • -d
  • --export
  • --flat ⚠️
  • --module
  • -m
  • --name
  • --project
  • --skip-import
  • --skip-tests
  • --standalone
ng generate service
Description :

Génère un nouveau service Angular

Options :
  • --dry-run ⚠️
  • -d
  • --flat ⚠️
  • --module
  • -m
  • --project
  • --skip-tests
ng g s
Description :

Alias pour générer un service

Options :
  • --dry-run ⚠️
  • -d
  • --flat ⚠️
  • --module
  • -m
  • --project
  • --skip-tests
ng generate module
Description :

Génère un nouveau module Angular

Options :
  • --dry-run ⚠️
  • -d
  • --flat ⚠️
  • --module
  • -m
  • --project
  • --route ⚠️
  • --routing ⚠️
  • --routing-scope ⚠️
ng g m
Description :

Alias pour générer un module

Options :
  • --dry-run ⚠️
  • -d
  • --flat ⚠️
  • --module
  • -m
  • --project
  • --route ⚠️
  • --routing ⚠️
  • --routing-scope ⚠️
ng generate class
Description :

Génère une nouvelle classe TypeScript

Options :
  • --dry-run ⚠️
  • -d
  • --project
  • --skip-tests
  • --type
ng g cl
Description :

Alias pour générer une classe

Options :
  • --dry-run ⚠️
  • -d
  • --project
  • --skip-tests
  • --type
ng generate interface
Description :

Génère une nouvelle interface TypeScript

Options :
  • --dry-run ⚠️
  • -d
  • --prefix
  • --project
  • --type
ng g i
Description :

Alias pour générer une interface

Options :
  • --dry-run ⚠️
  • -d
  • --prefix
  • --project
  • --type
ng generate enum
Description :

Génère une nouvelle énumération TypeScript

Options :
  • --dry-run ⚠️
  • -d
  • --project
  • --type
ng g e
Description :

Alias pour générer une énumération

Options :
  • --dry-run ⚠️
  • -d
  • --project
  • --type
ng generate guard
Description :

Génère un nouveau guard de route Angular

Options :
  • --dry-run ⚠️
  • -d
  • --flat ⚠️
  • --functional ⚠️
  • --implements
  • --project
  • --skip-tests
ng g g
Description :

Alias pour générer un guard

Options :
  • --dry-run ⚠️
  • -d
  • --flat ⚠️
  • --functional ⚠️
  • --implements
  • --project
  • --skip-tests
ng generate interceptor
Description :

Génère un nouvel intercepteur HTTP

Options :
  • --dry-run ⚠️
  • -d
  • --flat ⚠️
  • --functional ⚠️
  • --project
  • --skip-tests
ng generate resolver
Description :

Génère un nouveau resolver de route

Options :
  • --dry-run ⚠️
  • -d
  • --flat ⚠️
  • --functional ⚠️
  • --project
  • --skip-tests
ng g r
Description :

Alias pour générer un resolver

Options :
  • --dry-run ⚠️
  • -d
  • --flat ⚠️
  • --functional ⚠️
  • --project
  • --skip-tests
ng generate web-worker
Description :

Génère un nouveau Web Worker

Options :
  • --dry-run ⚠️
  • -d
  • --project
ng generate environments
Description :

Génère les fichiers d'environnement

Options :
  • --dry-run ⚠️
  • -d
  • --project
ng generate library
Description :

Génère une nouvelle bibliothèque dans un workspace

Options :
  • --dry-run ⚠️
  • -d
  • --entry-file ⚠️
  • --prefix
  • -p
  • --project-root ⚠️
  • --skip-install
  • --skip-package-json
  • --skip-tests
  • --standalone
ng g lib
Description :

Alias pour générer une bibliothèque

Options :
  • --dry-run ⚠️
  • -d
  • --entry-file ⚠️
  • --prefix
  • -p
  • --project-root ⚠️
  • --skip-install
  • --skip-package-json
  • --skip-tests
  • --standalone
ng generate application
Description :

Génère une nouvelle application dans un workspace

Options :
  • --dry-run ⚠️
  • -d
  • --inline-style
  • --inline-template
  • --minimal
  • --prefix
  • -p
  • --project-root ⚠️
  • --routing ⚠️
  • --skip-install
  • --skip-package-json
  • --skip-tests
  • --standalone
  • --strict
  • --style
ng g app
Description :

Alias pour générer une application

Options :
  • --dry-run ⚠️
  • -d
  • --inline-style
  • --inline-template
  • --minimal
  • --prefix
  • -p
  • --project-root ⚠️
  • --routing ⚠️
  • --skip-install
  • --skip-package-json
  • --skip-tests
  • --standalone
  • --strict
  • --style
ng serve
Description :

Lance le serveur de développement Angular

Options :
  • --allowed-hosts
  • --aot
  • --base-href
  • --browser-target
  • --build-event-log
  • --common-chunk
  • --configuration
  • -c
  • --deploy-url
  • --disable-host-check
  • --force-esbuild ⚠️
  • --help
  • --hmr
  • --host
  • --live-reload ⚠️
  • --open
  • -o
  • --optimization
  • --poll
  • --port
  • --prebundle
  • --project
  • --proxy-config
  • --public-host
  • --serve-path
  • --ssl
  • --ssl-cert
  • --ssl-key
  • --verbose
  • --vendor-chunk
  • --watch
ng build
Description :

Compile l'application Angular pour la production

Options :
  • --allowed-common-js-dependencies
  • --aot
  • --base-href
  • --budgets
  • --build-optimizer
  • --common-chunk
  • --configuration
  • -c
  • --cross-origin
  • --delete-output-path
  • --deploy-url
  • --extract-licenses
  • --file-replacements ⚠️
  • --i18n-missing-translation
  • --index
  • --inline-style-language
  • --localize
  • --main
  • --named-chunks
  • --ngsw-config-path
  • --optimization
  • --output-hashing
  • --output-path
  • --poll
  • --polyfills
  • --preserve-symlinks
  • --progress
  • --project
  • --prerender
  • --resources-output-path ⚠️
  • --scripts
  • --service-worker
  • --source-map
  • --stats-json
  • --style
  • --subresource-integrity
  • --ts-config
  • --vendor-chunk
  • --verbose
  • --watch
  • --web-worker-tsconfig
ng test
Description :

Lance les tests unitaires avec Karma

Options :
  • --browsers
  • --code-coverage
  • --code-coverage-exclude
  • --configuration
  • -c
  • --exclude
  • --help
  • --include
  • --karma-config
  • --main
  • --poll
  • --polyfills
  • --preserve-symlinks
  • --progress
  • --project
  • --reporters ⚠️
  • --source-map
  • --ts-config
  • --watch
  • --web-worker-tsconfig
ng e2e
Description :

Lance les tests end-to-end

Options :
  • --base-url
  • --configuration
  • -c
  • --dev-server-target
  • --grep
  • --host
  • --invert-grep
  • --port
  • --project
  • --protractor-config
  • --specs
  • --suite
  • --webdriver-update
ng lint
Description :

Lance le linter sur le code Angular

Options :
  • --configuration
  • -c
  • --exclude
  • --files ⚠️
  • --fix ⚠️
  • --force ⚠️
  • --format ⚠️
  • --help
  • --project
  • --quiet
  • --silent
ng add
Description :

Ajoute un package Angular avec configuration automatique

Options :
  • --defaults
  • --dry-run ⚠️
  • -d
  • --package-manager
  • --registry ⚠️
  • --skip-confirmation
  • --verbose
ng update
Description :

Met à jour Angular et ses dépendances

Options :
  • --allow-dirty
  • --create-commits
  • --dry-run ⚠️
  • -d
  • --force ⚠️
  • --from ⚠️
  • --help
  • --migrate-only
  • --name
  • --next
  • --package-manager
  • --registry ⚠️
  • --to
  • --verbose
ng deploy
Description :

Déploie l'application Angular

Options :
  • --configuration
  • -c
  • --dry-run ⚠️
  • -d
  • --no-build
  • --project
ng config
Description :

Récupère ou définit des valeurs de configuration Angular

Options :
  • --global
  • --help
  • --json-path
ng doc
Description :

Ouvre la documentation officielle Angular

Options :
  • --help
  • --search
  • --version
ng version
Description :

Affiche les versions d'Angular CLI et des dépendances

Options :
  • --help
ng analytics
Description :

Gère les paramètres d'analytics Angular CLI

Options :
  • --help
ng cache
Description :

Gère le cache de build Angular

Options :
  • clean
  • disable
  • enable
  • info
ng completion
Description :

Génère un script d'autocomplétion pour le shell

Options :
  • --help
ng extract-i18n
Description :

Extrait les messages i18n du code source

Options :
  • --browser-target
  • --build-optimizer
  • --configuration
  • -c
  • --cross-origin
  • --delete-output-path
  • --deploy-url
  • --extract-licenses
  • --file-replacements ⚠️
  • --format ⚠️
  • --i18n-locale
  • --index
  • --main
  • --named-chunks
  • --optimization
  • --output-hashing
  • --output-path
  • --preserve-symlinks
  • --progress
  • --project
  • --resources-output-path ⚠️
  • --scripts
  • --source-map
  • --stats-json
  • --style
  • --subresource-integrity
  • --ts-config
  • --vendor-chunk
  • --verbose
  • --watch
  • --web-worker-tsconfig
ng run
Description :

Exécute une cible d'architecte personnalisée

Options :
  • --configuration
  • -c
  • --help
  • --project
  • --target
ng xi18n
Description :

Extrait les messages i18n (alias de extract-i18n)

Options :
  • --browser-target
  • --build-optimizer
  • --configuration
  • -c
  • --cross-origin
  • --delete-output-path
  • --deploy-url
  • --extract-licenses
  • --file-replacements ⚠️
  • --format ⚠️
  • --i18n-locale
  • --index
  • --main
  • --named-chunks
  • --optimization
  • --output-hashing
  • --output-path
  • --preserve-symlinks
  • --progress
  • --project
  • --resources-output-path ⚠️
  • --scripts
  • --source-map
  • --stats-json
  • --style
  • --subresource-integrity
  • --ts-config
  • --vendor-chunk
  • --verbose
  • --watch
  • --web-worker-tsconfig

Partager