angular-cli
AGENTS.md27k starsChanged 2 years agoMITView on GitHub
This is the source code for the Angular CLI and related build tooling. This guide outlines standard practices for AI agents working in this repository. - NEVER use or fallback to os.tmpdir(). Bazel executes tests in hermetic sandboxes and sets TEST_TMPDIR to an isolated, sandboxed directory. Using os.tmpdir() can cause sandboxing failures, permission errors, or file leakage outside the Bazel sandbox. - Unit & Integration Tests: - Run all unit and integration tests: pnpm bazel test //packages/... - Run a…
- Reads credentials
We split this AGENTS.md into the rules it gives an agent
16 rules. About 0 are common, 1 is distinctive, and 15 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
15
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 9
Use pnpm for package management.
- Very specific: line 10
Use pnpm bazel test //target to run tests.
- Very specific: line 28
Always use the node: protocol for Node.js built-in imports (e.g., node:fs, node:path, node:assert).
- Very specific: line 29
Prefer named imports (e.g., import { mkdtemp } from 'node:fs') or default imports (import fs from 'node:fs') instead of namespace imports …
- Very specific: line 30
Use type-only imports (import type { ...
- Very specific: line 32
Prefer ECMAScript private fields (#field) over TypeScript private keywords for encapsulated state.
- Very specific: line 53
NEVER: use or fallback to os.tmpdir().
- Very specific: line 55
Run all unit and integration tests: pnpm bazel test //packages/...
- Very specific: line 56
Run a specific unit test target (e.g., pnpm bazel test //packages/angular/build:test).
- Very specific: line 57
Run a specific builder integration test target (e.g., pnpm bazel test //packages/angular/build:library_integration_tests or pnpm bazel test …
- Very specific: line 61
Run tests without sharding when isolating or debugging: use --config=no-sharding with a specific test target (e.g., pnpm bazel test …
- Very specific: line 64
Do not use this flag when running broad test suites (such as //packages/...), as executing tests without sharding takes significantly …
- Very specific: line 66
Run subset of E2E tests: pnpm bazel test //tests:e2e_node22 --config=e2e --test_filter="<filter>"
- Very specific: line 70
Use the gh CLI (GitHub CLI) for creating and managing pull requests.
- Very specific: line 72
When addressing review feedback, ALWAYS use fixup commits (git commit --fixup <commit>) instead of amending existing commits.
- Distinctive: line 73
Only use fixup commits for changes that directly belong to the target commit.
≈ “Common” is an estimate: at least 1 in 5 of the 36,368 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
This is the source code for the Angular CLI and related build tooling. This guide outlines standard practices for AI agents working in this repository.
Environment
- Use
pnpmfor package management. - Use
pnpm bazel test //targetto run tests.
Key Documentation
- Developer Guide: definitive guide for building, debugging, and running test targets.
- Contributing Guide: general contribution workflows and guidelines.
- Commit Guidelines: format for commit messages and PR titles.
Building
- Make a local build of all packages:
pnpm build --local
Coding Practices
- Imports:
- Always use the
node:protocol for Node.js built-in imports (e.g.,node:fs,node:path,node:assert). - Prefer named imports (e.g.,
import { mkdtemp } from 'node:fs') or default imports (import fs from 'node:fs') instead of namespace imports (import * as fs). - Use type-only imports (
import type { ... }) when importing types to avoid runtime side-effects.
- Always use the
- Classes:
- Prefer ECMAScript private fields (
#field) over TypeScriptprivatekeywords for encapsulated state.
- Prefer ECMAScript private fields (
Testing
- Temporary Directories (
TEST_TMPDIR):- Tests in this repository only run in Bazel. ALWAYS use
process.env['TEST_TMPDIR']and assert that it is set:import assert from 'node:assert'; import { mkdtemp } from 'node:fs/promises'; import { join } from 'node:path'; describe('...', () => { let tempRoot: string; beforeAll(async () => { const baseTmpDir = process.env['TEST_TMPDIR']; assert(baseTmpDir, 'TEST_TMPDIR is not set'); tempRoot = await mkdtemp(join(baseTmpDir, 'angular-cli-test-')); }); }); - NEVER use or fallback to
os.tmpdir(). Bazel executes tests in hermetic sandboxes and setsTEST_TMPDIRto an isolated, sandboxed directory. Usingos.tmpdir()can cause sandboxing failures, permission errors, or file leakage outside the Bazel sandbox.
- Tests in this repository only run in Bazel. ALWAYS use
- Unit & Integration Tests:
- Run all unit and integration tests:
pnpm bazel test //packages/... - Run a specific unit test target (e.g.,
pnpm bazel test //packages/angular/build:test). Note that package:testtargets may exclude builder integration tests (such as specs under**/builders/**/tests/**). - Run a specific builder integration test target (e.g.,
pnpm bazel test //packages/angular/build:library_integration_testsorpnpm bazel test //packages/angular/build:application_integration_tests). - Query all test targets:
pnpm bazel query "tests(//packages/...)" - Find the exact test target for a specific spec file (using its workspace-relative path, which Bazel resolves as a source file target):
pnpm bazel query "kind(jasmine_test, rdeps(//packages/..., <relative/path/to/file_spec.ts>))" - Focus specific tests when debugging: use
fdescribe()andfit(). NEVER commit focused tests to the repository. - Run tests without sharding when isolating or debugging: use
--config=no-shardingwith a specific test target (e.g.,pnpm bazel test //packages/angular/build:library_integration_tests --config=no-sharding). This disables test sharding (--test_sharding_strategy=disabled) and flaky test retries (--flaky_test_attempts=1). This is especially useful when isolating test runs or debugging with focused tests (fit/fdescribe) to avoid empty shard failures and unnecessary re-runs. Do not use this flag when running broad test suites (such as//packages/...), as executing tests without sharding takes significantly longer.
- Run all unit and integration tests:
- End-to-End Tests:
- Run subset of E2E tests:
pnpm bazel test //tests:e2e_node22 --config=e2e --test_filter="<filter>"
- Run subset of E2E tests:
Pull Requests
- Use the
ghCLI (GitHub CLI) for creating and managing pull requests. - Fixup Commits:
- When addressing review feedback, ALWAYS use fixup commits (
git commit --fixup <commit>) instead of amending existing commits. This preserves commit history during review and allows reviewers to easily see incremental changes. - Only use fixup commits for changes that directly belong to the target commit. Unrelated changes must be made in a separate commit with their own commit message, not as a fixup commit.
- Fixup commits are automatically squashed when merging with
pnpm ng-dev pr mergeor optionally when rebasing withpnpm ng-dev pr rebase <pr>.
- When addressing review feedback, ALWAYS use fixup commits (
- Use
pnpm ng-dev prcommands:pnpm ng-dev pr rebase <pr>: Rebase a PR branch on its target branch and optionally squash fixup commits.pnpm ng-dev pr merge <pr>: Merge an approved PR into its targeted branches.
Trending
Quiet since September.about the whole repository
Who's talking about angular/angular-cli
- Academind“Angular Tutorial for Beginners”YouTube · Apr 3, 2017 · 458k views
- Fireship“Angular CLI - The Basics”YouTube · May 14, 2018 · 67k views
- kudvenkat“Angular cli ng serve options”YouTube · Nov 22, 2017 · 35k views
- Academind“SETUP & CLI - Angular 2.0 Final - Getting Started”YouTube · Oct 10, 2016 · 26k views
- WPCasts“Introduction to the Angular CLI - Tutorial for Beginners”YouTube · Jan 11, 2017 · 16k views
The biggest 5 of 74 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 74
Talked about on Stack Overflow, YouTube, GitHub and Hacker News (74 times).
On Stack Overflow · 30
- Aug 9, 2017Angular tests failing with Failed to execute 'send' on 'XMLHttpRequest'355 votes
- Apr 13, 2018Error: Local workspace file ('angular.json') could not be found336 votes
- May 25, 2020Module not found: Error: Can't resolve 'fs' error241 votes
- Sep 26, 2016How to add bootstrap to an angular-cli project207 votes
- Mar 28, 2017How to run my Angular site on mobile device that is running localhost on my windows desktop205 votes
25 more on Stack Overflow
- Jun 26, 2019Repository is not clean. Please commit or stash any changes before updating In Angular 8186 votes · 10 answers
- Dec 6, 2015AngularJS vs Angular170 votes
- Nov 12, 2019Error: EACCES: permission denied, access '/usr/local/lib/node_modules'161 votes
- Jul 5, 2018What's the difference between --base-href and --deploy-url parameters of angular-cli tool154 votes · 5 answers
- Jul 5, 2018What's the difference between --base-href and --deploy-url parameters of angular-cli tool138 votes
- Oct 19, 2016Where does `ng serve` output files to?134 votes
- Aug 24, 2016You have to be inside an angular-cli project in order to use the build command after reinstall of angular-cli130 votes · 20 answers
- Oct 19, 2017How do I debug a "[object ErrorEvent] thrown" error in my Karma/Jasmine tests?126 votes
- May 4, 2018Where is the file angular-cli.json in the new @angular/cli version?120 votes
- Sep 19, 2016How do you deploy Angular apps?116 votes
- Sep 19, 2016Angular cli - how to disable auto reload when ng serve115 votes · 5 answers
- May 24, 2018Angular 6+ How to change default port 4200113 votes
- Jun 7, 2023Workspace extension with invalid name (defaultProject) found108 votes
- Apr 12, 2017How to decrease prod bundle size?102 votes
- Jun 25, 2019error TS2554: Expected 2 arguments, but got 1 with @ViewChild87 votes
- Aug 9, 2016Angular Cli Webpack, How to add or bundle external js files?87 votes · 5 answers
- Aug 23, 2016How to test an app created with Angular CLI ng serve from another device?86 votes
- May 21, 2018ng serve not detecting file changes automatically84 votes
- Jan 29, 2021Angular 7: Uncaught ReferenceError: global is not defined when adding package82 votes
- Nov 26, 2019Errors: Data path ".builders['app-shell']" should have required property 'class'82 votes
- Dec 20, 2019Angular: 7.2.1 ES6 class ReferenceError : Cannot access 'X' before initialization81 votes
- Apr 24, 2015Available yeoman generator for Angular 280 votes
- Oct 9, 2018AngularCli: disable minification76 votes
- Jun 28, 2020Unable to use assets in url() in scss after upgrading to Angular 1072 votes
- May 25, 2017Angular 2 with CLI - build for production72 votes
On YouTube · 23
- Apr 3, 2017Angular Tutorial for Beginners — Academind458k views · 597 comments
- May 14, 2018Angular CLI - The Basics — Fireship67k views · 75 comments
- Nov 22, 2017Angular cli ng serve options — kudvenkat35k views · 13 comments
- Oct 10, 2016SETUP & CLI - Angular 2.0 Final - Getting Started — Academind26k views · 73 comments
- Jan 11, 2017Introduction to the Angular CLI - Tutorial for Beginners — WPCasts16k views · 21 comments
18 more on YouTube
- Aug 14, 2025Angular 20.2: generate AI configurations automatically #angular #angular20 — Igor Sedov16k views · 11 comments
- Dec 4, 2025New in Angular 21: 2016 File Naming Option #angular #angular21 — Igor Sedov9.5k views · 22 comments
- Sep 13, 2016Angular 2 (Angular 4) - Introduction and the CLI — Lyrad Digital8.7k views · 9 comments
- Nov 26, 2017Use Angular5 Http Client with angular CLI Backend Proxy — KG IT Systems Consulting6.5k views · 12 comments
- Jan 14, 2018Episode 1 | Running an Angular application using Angular CLI — Saikat's Tutorial5.9k views · 5 comments
- Feb 9, 2017Install Node and Angular cli on windows — Lars Juul Langgaard4.5k views · 1 comment
- Nov 14, 2025New in Angular 21 CLI: ng version Gets a Modern Look — Igor Sedov4.4k views · 13 comments
- Jul 21, 2017Angular 5, Angular Universal, Angular CLI & Angular + CMS — The WP Crowd3.8k views · 5 comments
- Feb 9, 2017First Angular2 Application on Mac using angular-cli — Lars Juul Langgaard2.9k views · 1 comment
- Nov 26, 2017How To Add TailwindCSS To An Angular CLI Project — Tom Gobich2k views · 4 comments
- Feb 17, 2017Installing angular flexlayout — Lars Juul Langgaard1.7k views · 4 comments
- Apr 12, 2017MEAN STACK with Angular4 part 3 - Install Angular CLI — Lars Juul Langgaard1.3k views
- Jan 29, 2018Angular5 [ep7] Déploiement sur Github pages avec Travis — NinJavascript997 views · 4 comments
- Apr 17, 2017MEAN STACK with Angular4 part 7 - Typescript intro and ng build cli command — Lars Juul Langgaard985 views · 1 comment
- May 7, 2023Installing Angular Material in your Angular Project. Address Book Project - Part 1. — DK Programming910 views · 4 comments
- Feb 13, 2017install Angular2 Material Design Module — Lars Juul Langgaard870 views · 3 comments
- Mar 1, 2017Angular with Firebase part 4 of 70 - Starting project and add to your own github repo — Lars Juul Langgaard735 views · 3 comments
- Sep 27, 2026Angular 22 TS Config Linting Error? Here’s the Quick Fix! — Computer Science For Everyone153 views · 6 comments
On GitHub · 16
- Sep 19, 2017Add new Angular CLI-based template — aspnet/JavaScriptServices110 reactions · 148 comments
- Apr 30, 2021Support for rxjs 7 — angular/angular85 reactions · 17 comments
- Jun 11, 2020Rename files support — angular/angular77 reactions · 3 comments
- Jun 24, 2022'noEslintrc' option has been declared with a 'no' prefix in the schema — angular-eslint/angular-eslint73 reactions · 11 comments
- Jan 7, 2020feat: enhance asset pattern — ng-packagr/ng-packagr51 reactions · 23 comments
11 more on GitHub
- Apr 4, 2025feat(core): Move zoneless change detection to dev preview — angular/angular46 reactions · 8 comments
- Mar 20, 2023feat(core): support usage of non-experimental decorators with TypeScript 5.0 — angular/angular23 reactions · 6 comments
- Dec 4, 2019fix: add `assets` option to schema — ng-packagr/ng-packagr21 reactions · 8 comments
- Mar 3, 2026feat: support Vitest as configured by Angular 21 — help-me-mom/ng-mocks13 reactions · 8 comments
- Mar 28, 2017Add Test Coverage — ionic-team/ionic-unit-testing-example11 reactions · 4 comments
- May 18, 2018feat: add support for incremental builds — ng-packagr/ng-packagr9 reactions · 20 comments
- Apr 5, 2025docs: expand Angular's browser policy by adopting the "widely available" Baseline — angular/angular8 reactions · 6 comments
- Jul 24, 2024Fix bug on create component — aspnetboilerplate/module-zero-core-template7 reactions · 2 comments
- Jul 5, 2024feat: setup wizard — nuxt/cli6 reactions · 2 comments
- Feb 15, 2023refactor: Remove ngcc from extension — angular/vscode-ng-language-service6 reactions · 1 comment
- Oct 30, 2020feat: inline critical css — angular/universal6 reactions · 1 comment
On Hacker News · 5
- May 29, 2019Angular v8.0274 points · 201 comments
- Aug 3, 2017Angular is unable to build large applications4 points · 1 comment
- Oct 1, 2017Show HN: Idea for Angular CLI Blueprint to Generate Material Table from Protobuf1 point
- Mar 24, 2017Angular-cli hits v1.0.01 point
- Oct 26, 2016CLI for Angular 2 applications based on the ember-cli project1 point
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 28,693 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

