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
Crée un nouveau projet Angular
--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
Génère des fichiers Angular (composants, services, modules, etc.)
--defaults--dry-run⚠️-d--force⚠️--interactive
ng generate component
Génère un nouveau composant Angular
--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
Alias pour générer un composant
--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
Génère une nouvelle directive Angular
--dry-run⚠️-d--export--flat⚠️--module-m--prefix-p--project--selector--skip-import--skip-selector--skip-tests--standalone
ng g d
Alias pour générer une directive
--dry-run⚠️-d--export--flat⚠️--module-m--prefix-p--project--selector--skip-import--skip-selector--skip-tests--standalone
ng generate pipe
Génère un nouveau pipe Angular
--dry-run⚠️-d--export--flat⚠️--module-m--name--project--skip-import--skip-tests--standalone
ng g p
Alias pour générer un pipe
--dry-run⚠️-d--export--flat⚠️--module-m--name--project--skip-import--skip-tests--standalone
ng generate service
Génère un nouveau service Angular
--dry-run⚠️-d--flat⚠️--module-m--project--skip-tests
ng g s
Alias pour générer un service
--dry-run⚠️-d--flat⚠️--module-m--project--skip-tests
ng generate module
Génère un nouveau module Angular
--dry-run⚠️-d--flat⚠️--module-m--project--route⚠️--routing⚠️--routing-scope⚠️
ng g m
Alias pour générer un module
--dry-run⚠️-d--flat⚠️--module-m--project--route⚠️--routing⚠️--routing-scope⚠️
ng generate class
Génère une nouvelle classe TypeScript
--dry-run⚠️-d--project--skip-tests--type
ng g cl
Alias pour générer une classe
--dry-run⚠️-d--project--skip-tests--type
ng generate interface
Génère une nouvelle interface TypeScript
--dry-run⚠️-d--prefix--project--type
ng g i
Alias pour générer une interface
--dry-run⚠️-d--prefix--project--type
ng generate enum
Génère une nouvelle énumération TypeScript
--dry-run⚠️-d--project--type
ng g e
Alias pour générer une énumération
--dry-run⚠️-d--project--type
ng generate guard
Génère un nouveau guard de route Angular
--dry-run⚠️-d--flat⚠️--functional⚠️--implements--project--skip-tests
ng g g
Alias pour générer un guard
--dry-run⚠️-d--flat⚠️--functional⚠️--implements--project--skip-tests
ng generate interceptor
Génère un nouvel intercepteur HTTP
--dry-run⚠️-d--flat⚠️--functional⚠️--project--skip-tests
ng generate resolver
Génère un nouveau resolver de route
--dry-run⚠️-d--flat⚠️--functional⚠️--project--skip-tests
ng g r
Alias pour générer un resolver
--dry-run⚠️-d--flat⚠️--functional⚠️--project--skip-tests
ng generate web-worker
Génère un nouveau Web Worker
--dry-run⚠️-d--project
ng generate environments
Génère les fichiers d'environnement
--dry-run⚠️-d--project
ng generate library
Génère une nouvelle bibliothèque dans un workspace
--dry-run⚠️-d--entry-file⚠️--prefix-p--project-root⚠️--skip-install--skip-package-json--skip-tests--standalone
ng g lib
Alias pour générer une bibliothèque
--dry-run⚠️-d--entry-file⚠️--prefix-p--project-root⚠️--skip-install--skip-package-json--skip-tests--standalone
ng generate application
Génère une nouvelle application dans un workspace
--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
Alias pour générer une application
--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
Lance le serveur de développement Angular
--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
Compile l'application Angular pour la production
--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
Lance les tests unitaires avec Karma
--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
Lance les tests end-to-end
--base-url--configuration-c--dev-server-target--grep--host--invert-grep--port--project--protractor-config--specs--suite--webdriver-update
ng lint
Lance le linter sur le code Angular
--configuration-c--exclude--files⚠️--fix⚠️--force⚠️--format⚠️--help--project--quiet--silent
ng add
Ajoute un package Angular avec configuration automatique
--defaults--dry-run⚠️-d--package-manager--registry⚠️--skip-confirmation--verbose
ng update
Met à jour Angular et ses dépendances
--allow-dirty--create-commits--dry-run⚠️-d--force⚠️--from⚠️--help--migrate-only--name--next--package-manager--registry⚠️--to--verbose
ng deploy
Déploie l'application Angular
--configuration-c--dry-run⚠️-d--no-build--project
ng config
Récupère ou définit des valeurs de configuration Angular
--global--help--json-path
ng doc
Ouvre la documentation officielle Angular
--help--search--version
ng version
Affiche les versions d'Angular CLI et des dépendances
--help
ng analytics
Gère les paramètres d'analytics Angular CLI
--help
ng cache
Gère le cache de build Angular
cleandisableenableinfo
ng completion
Génère un script d'autocomplétion pour le shell
--help
ng extract-i18n
Extrait les messages i18n du code source
--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
Exécute une cible d'architecte personnalisée
--configuration-c--help--project--target
ng xi18n
Extrait les messages i18n (alias de extract-i18n)
--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