Title: schematics-cli: `--dry-run=false`, `--debug=false` and other built-in boolean flags are treated as `true` · Issue #34199 · angular/angular-cli · GitHub
Open Graph Title: schematics-cli: `--dry-run=false`, `--debug=false` and other built-in boolean flags are treated as `true` · Issue #34199 · angular/angular-cli
X Title: schematics-cli: `--dry-run=false`, `--debug=false` and other built-in boolean flags are treated as `true` · Issue #34199 · angular/angular-cli
Description: Command other Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was No response Description When a built-in boolean CLI option gets an inline value (--dry...
Open Graph Description: Command other Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was No response Description When a built-in boolea...
X Description: Command other Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was No response Description When a built-in boolea...
Opengraph URL: https://github.com/angular/angular-cli/issues/34199
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"schematics-cli: `--dry-run=false`, `--debug=false` and other built-in boolean flags are treated as `true`","articleBody":"### Command\n\nother\n\n### Is this a regression?\n\n- [x] Yes, this behavior used to work in the previous version\n\n### The previous version in which this bug was not present was\n\n_No response_\n\n### Description\n\nWhen a built-in boolean CLI option gets an inline value (`--dry-run=false`, `--debug=false`, `--force=false`, `--interactive=false`, ...), the value is parsed as the string `'false'` not the boolean `false`.\n\nIn `packages/angular_devkit/schematics_cli/bin/schematics.ts`, `parseOptions` calls `parseArgs` with `strict: false`.\nIn non-strict mode, Node doesn't validate inline values for `type: 'boolean'` options. It returns them as raw strings:\n\n```js\nconst { parseArgs } = require('node:util');\nparseArgs({\n args: ['--dry-run=false', '--debug=true'],\n strict: false, allowPositionals: true, allowNegative: true,\n options: { 'dry-run': { type: 'boolean' }, debug: { type: 'boolean' } },\n}).values;\n// => { 'dry-run': 'false', debug: 'true' } \u003c-- strings, not booleans\n```\n\nThe token loop in `parseOptions` skips these options (`if (name in CLI_OPTION_DEFINITIONS) continue;`). That means the `'true'`/`'false'` conversion added in #32362 never runs for them, and `values` is returned unchanged as `cliOptions`. Then in `main`:\n\n```ts\nconst debug = cliOptions.debug ?? isLocalCollection; // 'false' -> truthy\nconst dryRun = cliOptions['dry-run'] ?? debug; // 'false' -> truthy\n```\n\n### Minimal Reproduction\n\n```json5\n// package.json\n{\n \"name\": \"repro\",\n \"dependencies\": {\n \"@angular-devkit/schematics-cli\": \"22.2.0\"\n }\n}\n```\n\n```json5\n// my-schematics/collection.json\n{\n \"schematics\": {\n \"hello\": {\n \"description\": \"x\", \"factory\": \"./index.js#hello\"\n }\n }\n}\n```\n```javascript\n// my-schematics/index.js\nexports.hello = () => (tree) => {\n tree.create('hello.txt', 'hi');\n return tree;\n};\n```\n\n```bash\nnpx schematics ./my-schematics/collection.json:hello --dry-run=false\n```\n\n```output\nDebug mode enabled by default for local collections.\nCREATE hello.txt (2 bytes)\nDry run enabled. No files written to disk.\n```\n\n### Exception or Error\n\n```text\n`Dry run enabled. No files written to disk.`\n```\n\n### Your Environment\n\n```text\n@angular-devkit/schematics-cli: 22.2.0\nNode: v22.22.3\nOS: macOS\n```\n\n### Anything else relevant?\n\n_No response_","author":{"url":"https://github.com/rsreimer","@type":"Person","name":"rsreimer"},"datePublished":"2026-09-29T11:28:37Z","url":"https://github.com/angular/angular-cli/issues/34199"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d2048e1f-34e9-7b63-48ea-6e741d2b849e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D27C:34CAB:188550E:1F4830B:6B01483D |
| html-safe-nonce | de131453d7bcfbac2d36349f213cd1726873f270c38cb56dbb2114cd0b3db8b8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMjdDOjM0Q0FCOjE4ODU1MEU6MUY0ODMwQjo2QjAxNDgzRCIsInZpc2l0b3JfaWQiOiI0OTcyMjExMzM0NjAwMDE3OTgxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 5b2c94729f2212bca105dbc5709f05943230f5b89b530b757a5b691d77c969d3 |
| hovercard-subject-tag | issue:5629787413 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/34199/issue_layout |
| twitter:image | https://opengraph.githubassets.com/744c64ad02d96b592f6aab29754cace67391392adbc9551ee2e4affb6962f175/angular/angular-cli/issues/34199 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/744c64ad02d96b592f6aab29754cace67391392adbc9551ee2e4affb6962f175/angular/angular-cli/issues/34199 |
| og:image:alt | Command other Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was No response Description When a built-in boolea... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rsreimer |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width