chore(repo): add valid-command-object lint rule (#27777)

This commit is contained in:
James Henry 2024-09-05 13:14:04 +04:00 committed by GitHub
parent ccda7f9f00
commit ddec7ad4b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
66 changed files with 985 additions and 728 deletions

View File

@ -61,7 +61,8 @@
}
]
}
]
],
"@nx/workspace/valid-command-object": "error"
}
}
]

View File

@ -38,9 +38,9 @@ Install version `17.0.0` of the `@nx/react` package and run its `@nx/react:init`
## Options
| Option | Type | Description |
| ------------------------ | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--help` | boolean | Show help |
| `--packageSpecifier` | string | The package name and optional version (e.g. `@nx/react` or `@nx/react@latest`) to install and initialize. If the version is not specified it will install the same version as the `nx` package for Nx core plugins or the latest version for other packages |
| `--updatePackageScripts` | boolean | Update `package.json` scripts with inferred targets. Defaults to `true` when the package is a core Nx plugin |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces) |
| `--version` | boolean | Show version number |
| ------------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `--help` | boolean | Show help. |
| `--packageSpecifier` | string | The package name and optional version (e.g. `@nx/react` or `@nx/react@latest`) to install and initialize. If the version is not specified it will install the same version as the `nx` package for Nx core plugins or the latest version for other packages. |
| `--updatePackageScripts` | boolean | Update `package.json` scripts with inferred targets. Defaults to `true` when the package is a core Nx plugin. |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
| `--version` | boolean | Show version number. |

View File

@ -1,11 +1,11 @@
---
title: 'affected - CLI command'
description: 'Run target for affected projects'
description: 'Run target for affected projects.'
---
# affected
Run target for affected projects
Run target for affected projects.
## Usage
@ -91,23 +91,23 @@ Print the task graph to the console:
|
| `--base` | string | Base of the current branch (usually main) |
| `--batch` | boolean | Run task(s) in batches for executors which support batches (Default: `false`) |
| `--configuration` | string | This is the configuration to use when performing tasks on projects |
| `--exclude` | string | Exclude certain projects from being processed |
| `--excludeTaskDependencies` | boolean | Skips running dependent tasks first (Default: `false`) |
| `--files` | string | Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces |
| `--base` | string | Base of the current branch (usually main). |
| `--batch` | boolean | Run task(s) in batches for executors which support batches. (Default: `false`) |
| `--configuration` | string | This is the configuration to use when performing tasks on projects. |
| `--exclude` | string | Exclude certain projects from being processed. |
| `--excludeTaskDependencies` | boolean | Skips running dependent tasks first. (Default: `false`) |
| `--files` | string | Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces. |
| `--graph` | string | Show the task graph of the command. Pass a file path to save the graph data instead of viewing it in the browser. Pass "stdout" to print the results to the terminal. |
| `--head` | string | Latest commit of the current branch (usually HEAD) |
| `--help` | boolean | Show help |
| `--nxBail` | boolean | Stop command execution after the first failed task (Default: `false`) |
| `--nxIgnoreCycles` | boolean | Ignore cycles in the task graph (Default: `false`) |
| `--head` | string | Latest commit of the current branch (usually HEAD). |
| `--help` | boolean | Show help. |
| `--nxBail` | boolean | Stop command execution after the first failed task. (Default: `false`) |
| `--nxIgnoreCycles` | boolean | Ignore cycles in the task graph. (Default: `false`) |
| `--output-style` | `dynamic`, `static`, `stream`, `stream-without-prefixes` | Defines how Nx emits outputs tasks logs. **dynamic**: use dynamic output life cycle, previous content is overwritten or modified as new outputs are added, display minimal logs by default, always show errors. This output format is recommended on your local development environments. **static**: uses static output life cycle, no previous content is rewritten or modified as new outputs are added. This output format is recommened for CI environments. **stream**: nx by default logs output to an internal output stream, enable this option to stream logs to stdout / stderr. **stream-without-prefixes**: nx prefixes the project name the target is running on, use this option remove the project name prefix from output. |
| `--parallel` | string | Max number of parallel processes [default is 3] |
| `--runner` | string | This is the name of the tasks runner configured in nx.json |
| `--skipNxCache` | boolean | Rerun the tasks even when the results are available in the cache (Default: `false`) |
| `--targets` | string | Tasks to run for affected projects |
| `--uncommitted` | boolean | Uncommitted changes |
| `--untracked` | boolean | Untracked changes |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces) |
| `--version` | boolean | Show version number |
| `--parallel` | string | Max number of parallel processes [default is 3]. |
| `--runner` | string | This is the name of the tasks runner configured in nx.json. |
| `--skipNxCache` | boolean | Rerun the tasks even when the results are available in the cache. (Default: `false`) |
| `--targets` | string | Tasks to run for affected projects. |
| `--uncommitted` | boolean | Uncommitted changes. |
| `--untracked` | boolean | Untracked changes. |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
| `--version` | boolean | Show version number. |

View File

@ -1,11 +1,11 @@
---
title: 'connect - CLI command'
description: 'Connect workspace to Nx Cloud'
description: 'Connect workspace to Nx Cloud.'
---
# connect
Connect workspace to Nx Cloud
Connect workspace to Nx Cloud.
## Usage
@ -18,8 +18,8 @@ Install `nx` globally to invoke the command directly using `nx`, or use `npx nx`
## Options
| Option | Type | Description |
| ----------------- | ------- | ---------------------------------------------------------------------------------------- |
| `--generateToken` | boolean | Explicitly asks for a token to be created, do not override existing tokens from Nx Cloud |
| `--help` | boolean | Show help |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces) |
| `--version` | boolean | Show version number |
| ----------------- | ------- | ----------------------------------------------------------------------------------------- |
| `--generateToken` | boolean | Explicitly asks for a token to be created, do not override existing tokens from Nx Cloud. |
| `--help` | boolean | Show help. |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
| `--version` | boolean | Show version number. |

View File

@ -18,34 +18,34 @@ Install `create-nx-workspace` globally to invoke the command directly, or use `n
## Options
| Option | Type | Description |
| ------------------ | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--allPrompts` | boolean | Show all prompts (Default: `false`) |
| `--appName` | string | The name of the app when using a monorepo with certain stacks |
| `--bundler` | string | Bundler to be used to build the app |
| `--commit.email` | string | E-mail of the committer |
| `--commit.message` | string | Commit message (Default: `Initial commit`) |
| `--commit.name` | string | Name of the committer |
| `--defaultBase` | string | Default base to use for new projects (Default: `main`) |
| `--docker` | boolean | Generate a Dockerfile for the Node API |
| ------------------ | ----------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--allPrompts` | boolean | Show all prompts. (Default: `false`) |
| `--appName` | string | The name of the app when using a monorepo with certain stacks. |
| `--bundler` | string | Bundler to be used to build the app. |
| `--commit.email` | string | E-mail of the committer. |
| `--commit.message` | string | Commit message. (Default: `Initial commit`) |
| `--commit.name` | string | Name of the committer. |
| `--defaultBase` | string | Default base to use for new projects. (Default: `main`) |
| `--docker` | boolean | Generate a Dockerfile for the Node API. |
| `--e2eTestRunner` | `playwright`, `cypress`, `none` | Test runner to use for end to end (E2E) tests. |
| `--framework` | string | Framework option to be used with certain stacks |
| `--help` | boolean | Show help |
| `--interactive` | boolean | Enable interactive mode with presets (Default: `true`) |
| `--name` | string | Workspace name (e.g. org name) |
| `--nextAppDir` | boolean | Enable the App Router for Next.js |
| `--nextSrcDir` | boolean | Generate a 'src/' directory for Next.js |
| `--framework` | string | Framework option to be used with certain stacks. |
| `--help` | boolean | Show help. |
| `--interactive` | boolean | Enable interactive mode with presets. (Default: `true`) |
| `--name` | string | Workspace name (e.g. org name). |
| `--nextAppDir` | boolean | Enable the App Router for Next.js. |
| `--nextSrcDir` | boolean | Generate a 'src/' directory for Next.js. |
| `--nxCloud` | `github`, `gitlab`, `azure`, `bitbucket-pipelines`, `circleci`, `skip`, `yes` | Which CI provider would you like to use? |
| `--packageManager` | `bun`, `npm`, `pnpm`, `yarn` | Package manager to use (Default: `npm`) |
| `--packageManager` | `bun`, `npm`, `pnpm`, `yarn` | Package manager to use. (Default: `npm`) |
| `--prefix` | string | Prefix to use for Angular component and directive selectors. |
| `--preset` | string | Customizes the initial content of your workspace. Default presets include: ["apps", "npm", "ts", "web-components", "angular-monorepo", "angular-standalone", "react-monorepo", "react-standalone", "vue-monorepo", "vue-standalone", "nuxt", "nuxt-standalone", "next", "nextjs-standalone", "remix-monorepo", "remix-standalone", "react-native", "expo", "nest", "express", "react", "vue", "angular", "node-standalone", "node-monorepo", "ts-standalone"]. To build your own see https://nx.dev/extending-nx/recipes/create-preset |
| `--routing` | boolean | Add a routing setup for an Angular app (Default: `true`) |
| `--skipGit` | boolean | Skip initializing a git repository (Default: `false`) |
| `--ssr` | boolean | Enable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering) for the Angular application |
| `--standaloneApi` | boolean | Use Standalone Components if generating an Angular app (Default: `true`) |
| `--style` | string | Stylesheet type to be used with certain stacks |
| `--preset` | string | Customizes the initial content of your workspace. Default presets include: ["apps", "npm", "ts", "web-components", "angular-monorepo", "angular-standalone", "react-monorepo", "react-standalone", "vue-monorepo", "vue-standalone", "nuxt", "nuxt-standalone", "next", "nextjs-standalone", "remix-monorepo", "remix-standalone", "react-native", "expo", "nest", "express", "react", "vue", "angular", "node-standalone", "node-monorepo", "ts-standalone"]. To build your own see https://nx.dev/extending-nx/recipes/create-preset. |
| `--routing` | boolean | Add a routing setup for an Angular app. (Default: `true`) |
| `--skipGit` | boolean | Skip initializing a git repository. (Default: `false`) |
| `--ssr` | boolean | Enable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering) for the Angular application. |
| `--standaloneApi` | boolean | Use Standalone Components if generating an Angular app. (Default: `true`) |
| `--style` | string | Stylesheet type to be used with certain stacks. |
| `--useGitHub` | boolean | Will you be using GitHub as your git hosting provider? (Default: `false`) |
| `--version` | boolean | Show version number |
| `--workspaceType` | `integrated`, `package-based`, `standalone` | The type of workspace to create |
| `--version` | boolean | Show version number. |
| `--workspaceType` | `integrated`, `package-based`, `standalone` | The type of workspace to create. |
## Presets

View File

@ -1,11 +1,11 @@
---
title: 'daemon - CLI command'
description: 'Prints information about the Nx Daemon process or starts a daemon process'
description: 'Prints information about the Nx Daemon process or starts a daemon process.'
---
# daemon
Prints information about the Nx Daemon process or starts a daemon process
Prints information about the Nx Daemon process or starts a daemon process.
## Usage
@ -18,8 +18,8 @@ Install `nx` globally to invoke the command directly using `nx`, or use `npx nx`
## Options
| Option | Type | Description |
| ----------- | ------- | ------------------- |
| `--help` | boolean | Show help |
| ----------- | ------- | -------------------- |
| `--help` | boolean | Show help. |
| `--start` | boolean | (Default: `false`) |
| `--stop` | boolean | (Default: `false`) |
| `--version` | boolean | Show version number |
| `--version` | boolean | Show version number. |

View File

@ -1,11 +1,11 @@
---
title: 'format:check - CLI command'
description: 'Check for un-formatted files'
description: 'Check for un-formatted files.'
---
# format:check
Check for un-formatted files
Check for un-formatted files.
## Usage
@ -18,15 +18,15 @@ Install `nx` globally to invoke the command directly using `nx`, or use `npx nx`
## Options
| Option | Type | Description |
| ----------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `--all` | boolean | Format all projects |
| `--base` | string | Base of the current branch (usually main) |
| `--exclude` | string | Exclude certain projects from being processed |
| `--files` | string | Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces |
| `--head` | string | Latest commit of the current branch (usually HEAD) |
| `--help` | boolean | Show help |
| ----------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `--all` | boolean | Format all projects. |
| `--base` | string | Base of the current branch (usually main). |
| `--exclude` | string | Exclude certain projects from being processed. |
| `--files` | string | Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces. |
| `--head` | string | Latest commit of the current branch (usually HEAD). |
| `--help` | boolean | Show help. |
| `--libs-and-apps` | boolean | Format only libraries and applications files. |
| `--projects` | string | Projects to format (comma/space delimited) |
| `--uncommitted` | boolean | Uncommitted changes |
| `--untracked` | boolean | Untracked changes |
| `--version` | boolean | Show version number |
| `--projects` | string | Projects to format (comma/space delimited). |
| `--uncommitted` | boolean | Uncommitted changes. |
| `--untracked` | boolean | Untracked changes. |
| `--version` | boolean | Show version number. |

View File

@ -1,11 +1,11 @@
---
title: 'format:write - CLI command'
description: 'Overwrite un-formatted files'
description: 'Overwrite un-formatted files.'
---
# format:write
Overwrite un-formatted files
Overwrite un-formatted files.
## Usage
@ -18,15 +18,15 @@ Install `nx` globally to invoke the command directly using `nx`, or use `npx nx`
## Options
| Option | Type | Description |
| ----------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `--all` | boolean | Format all projects |
| `--base` | string | Base of the current branch (usually main) |
| `--exclude` | string | Exclude certain projects from being processed |
| `--files` | string | Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces |
| `--head` | string | Latest commit of the current branch (usually HEAD) |
| `--help` | boolean | Show help |
| ----------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `--all` | boolean | Format all projects. |
| `--base` | string | Base of the current branch (usually main). |
| `--exclude` | string | Exclude certain projects from being processed. |
| `--files` | string | Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces. |
| `--head` | string | Latest commit of the current branch (usually HEAD). |
| `--help` | boolean | Show help. |
| `--libs-and-apps` | boolean | Format only libraries and applications files. |
| `--projects` | string | Projects to format (comma/space delimited) |
| `--uncommitted` | boolean | Uncommitted changes |
| `--untracked` | boolean | Untracked changes |
| `--version` | boolean | Show version number |
| `--projects` | string | Projects to format (comma/space delimited). |
| `--uncommitted` | boolean | Uncommitted changes. |
| `--untracked` | boolean | Untracked changes. |
| `--version` | boolean | Show version number. |

View File

@ -1,11 +1,11 @@
---
title: 'graph - CLI command'
description: 'Graph dependencies within workspace'
description: 'Graph dependencies within workspace.'
---
# graph
Graph dependencies within workspace
Graph dependencies within workspace.
## Usage
@ -74,24 +74,24 @@ Watch for changes to project graph and update in-browser:
## Options
| Option | Type | Description |
| ----------------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `--affected` | boolean | Highlight affected projects |
| `--base` | string | Base of the current branch (usually main) |
| `--exclude` | string | Exclude certain projects from being processed |
| ----------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `--affected` | boolean | Highlight affected projects. |
| `--base` | string | Base of the current branch (usually main). |
| `--exclude` | string | Exclude certain projects from being processed. |
| `--file` | string | Output file (e.g. --file=output.json or --file=dep-graph.html). |
| `--files` | string | Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces |
| `--files` | string | Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces. |
| `--focus` | string | Use to show the project graph for a particular project and every node that is either an ancestor or a descendant. |
| `--groupByFolder` | boolean | Group projects by folder in the project graph |
| `--head` | string | Latest commit of the current branch (usually HEAD) |
| `--help` | boolean | Show help |
| `--groupByFolder` | boolean | Group projects by folder in the project graph. |
| `--head` | string | Latest commit of the current branch (usually HEAD). |
| `--help` | boolean | Show help. |
| `--host` | string | Bind the project graph server to a specific ip address. |
| `--open` | boolean | Open the project graph in the browser. (Default: `true`) |
| `--port` | number | Bind the project graph server to a specific port. |
| `--print` | boolean | Print the project graph to stdout in the terminal. |
| `--targets` | string | The target to show tasks for in the task graph |
| `--uncommitted` | boolean | Uncommitted changes |
| `--untracked` | boolean | Untracked changes |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces) |
| `--version` | boolean | Show version number |
| `--view` | `projects`, `tasks` | Choose whether to view the projects or task graph (Default: `projects`) |
| `--watch` | boolean | Watch for changes to project graph and update in-browser (Default: `true`) |
| `--targets` | string | The target to show tasks for in the task graph. |
| `--uncommitted` | boolean | Uncommitted changes. |
| `--untracked` | boolean | Untracked changes. |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
| `--version` | boolean | Show version number. |
| `--view` | `projects`, `tasks` | Choose whether to view the projects or task graph. (Default: `projects`) |
| `--watch` | boolean | Watch for changes to project graph and update in-browser. (Default: `true`) |

View File

@ -19,8 +19,8 @@ Install `nx` globally to invoke the command directly using `nx`, or use `npx nx`
| Option | Type | Description |
| ------------------------ | ------- | --------------------------------------------------------------------------------------------------- |
| `--help` | boolean | Show help |
| `--help` | boolean | Show help. |
| `--interactive` | boolean | When false disables interactive input prompts for options. (Default: `true`) |
| `--nxCloud` | boolean | Set up distributed caching with Nx Cloud. |
| `--useDotNxInstallation` | boolean | Initialize an Nx workspace setup in the .nx directory of the current repository. (Default: `false`) |
| `--version` | boolean | Show version number |
| `--version` | boolean | Show version number. |

View File

@ -32,7 +32,7 @@ List the generators and executors available in the `@nx/web` plugin if it is ins
## Options
| Option | Type | Description |
| ----------- | ------- | ---------------------------------------- |
| `--help` | boolean | Show help |
| `--plugin` | string | The name of an installed plugin to query |
| `--version` | boolean | Show version number |
| ----------- | ------- | ----------------------------------------- |
| `--help` | boolean | Show help. |
| `--plugin` | string | The name of an installed plugin to query. |
| `--version` | boolean | Show version number. |

View File

@ -80,16 +80,16 @@ Create a dedicated commit for each successfully completed migration. You can cus
## Options
| Option | Type | Description |
| ---------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `--commitPrefix` | string | Commit prefix to apply to the commit for each migration, when --create-commits is enabled (Default: `chore: [nx migration] `) |
| `--createCommits` | boolean | Automatically create a git commit after each migration runs (Default: `false`) |
| `--excludeAppliedMigrations` | boolean | Exclude migrations that should have been applied on previous updates. To be used with --from (Default: `false`) |
| `--from` | string | Use the provided versions for packages instead of the ones installed in node_modules (e.g., --from="@nx/react@16.0.0,@nx/js@16.0.0") |
| `--help` | boolean | Show help |
| `--ifExists` | boolean | Run migrations only if the migrations file exists, if not continues successfully (Default: `false`) |
| `--interactive` | boolean | Enable prompts to confirm whether to collect optional package updates and migrations (Default: `false`) |
| `--packageAndVersion` | string | The target package and version (e.g, @nx/workspace@16.0.0) |
| `--runMigrations` | string | Execute migrations from a file (when the file isn't provided, execute migrations from migrations.json) |
| `--to` | string | Use the provided versions for packages instead of the ones calculated by the migrator (e.g., --to="@nx/react@16.0.0,@nx/js@16.0.0") |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces) |
| `--version` | boolean | Show version number |
| ---------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `--commitPrefix` | string | Commit prefix to apply to the commit for each migration, when --create-commits is enabled. (Default: `chore: [nx migration] `) |
| `--createCommits` | boolean | Automatically create a git commit after each migration runs. (Default: `false`) |
| `--excludeAppliedMigrations` | boolean | Exclude migrations that should have been applied on previous updates. To be used with --from. (Default: `false`) |
| `--from` | string | Use the provided versions for packages instead of the ones installed in node_modules (e.g., --from="@nx/react@16.0.0,@nx/js@16.0.0"). |
| `--help` | boolean | Show help. |
| `--ifExists` | boolean | Run migrations only if the migrations file exists, if not continues successfully. (Default: `false`) |
| `--interactive` | boolean | Enable prompts to confirm whether to collect optional package updates and migrations. (Default: `false`) |
| `--packageAndVersion` | string | The target package and version (e.g, @nx/workspace@16.0.0). |
| `--runMigrations` | string | Execute migrations from a file (when the file isn't provided, execute migrations from migrations.json). |
| `--to` | string | Use the provided versions for packages instead of the ones calculated by the migrator (e.g., --to="@nx/react@16.0.0,@nx/js@16.0.0"). |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
| `--version` | boolean | Show version number. |

View File

@ -1,11 +1,11 @@
---
title: 'release - CLI command'
description: 'Orchestrate versioning and publishing of applications and libraries'
description: 'Orchestrate versioning and publishing of applications and libraries.'
---
# release
Orchestrate versioning and publishing of applications and libraries
Orchestrate versioning and publishing of applications and libraries.
## Usage
@ -18,20 +18,20 @@ Install `nx` globally to invoke the command directly using `nx`, or use `npx nx`
## Options
| Shared Option | Type | Description |
| --------------- | ------- | ---------------------------------------------------------------------------------------------------- |
| `--dry-run` | boolean | Preview the changes without updating files/creating releases (Default: `false`) |
| --------------- | ------- | ----------------------------------------------------------------------------------------------------- |
| `--dry-run` | boolean | Preview the changes without updating files/creating releases. (Default: `false`) |
| `--groups` | string | One or more release groups to target with the current command. |
| `--help` | boolean | Show help |
| `--printConfig` | string | Print the resolved nx release configuration that would be used for the current command and then exit |
| `--projects` | string | Projects to run. (comma/space delimited project names and/or patterns) |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces) |
| `--version` | boolean | Show version number |
| `--help` | boolean | Show help. |
| `--printConfig` | string | Print the resolved nx release configuration that would be used for the current command and then exit. |
| `--projects` | string | Projects to run. (comma/space delimited project names and/or patterns). |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
| `--version` | boolean | Show version number. |
## Subcommands
### Base Command Options
Create a version and release for the workspace, generate a changelog, and optionally publish the packages
Create a version and release for the workspace, generate a changelog, and optionally publish the packages.
```shell
nx release [specifier]
@ -42,15 +42,15 @@ nx release [specifier]
| Option | Type | Description |
| ----------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--first-release` | boolean | Indicates that this is the first release for the selected release group. If the current version cannot be determined as usual, the version on disk will be used as a fallback. This is useful when using git or the registry to determine the current version of packages, since those sources are only available after the first release. Also indicates that changelog generation should not assume a previous git tag exists and that publishing should not check for the existence of the package before running. |
| `--help` | boolean | Show help |
| `--skip-publish` | boolean | Skip publishing by automatically answering no to the confirmation prompt for publishing |
| `--help` | boolean | Show help. |
| `--skip-publish` | boolean | Skip publishing by automatically answering no to the confirmation prompt for publishing. |
| `--specifier` | string | Exact version or semver keyword to apply to the selected release group. |
| `--version` | boolean | Show version number |
| `--yes` | boolean | Automatically answer yes to the confirmation prompt for publishing |
| `--version` | boolean | Show version number. |
| `--yes` | boolean | Automatically answer yes to the confirmation prompt for publishing. |
### version
Create a version and release for one or more applications and libraries
Create a version and release for one or more applications and libraries.
```shell
nx release version [specifier]
@ -61,21 +61,21 @@ nx release version [specifier]
| Option | Type | Description |
| ---------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--first-release` | boolean | Indicates that this is the first release for the selected release group. If the current version cannot be determined as usual, the version on disk will be used as a fallback. This is useful when using git or the registry to determine the current version of packages, since those sources are only available after the first release. Also indicates that changelog generation should not assume a previous git tag exists and that publishing should not check for the existence of the package before running. |
| `--git-commit` | boolean | Whether or not to automatically commit the changes made by this command |
| `--git-commit-args` | string | Additional arguments (added after the --message argument, which may or may not be customized with --git-commit-message) to pass to the `git commit` command invoked behind the scenes |
| `--git-commit` | boolean | Whether or not to automatically commit the changes made by this command. |
| `--git-commit-args` | string | Additional arguments (added after the --message argument, which may or may not be customized with --git-commit-message) to pass to the `git commit` command invoked behind the scenes. |
| `--git-commit-message` | string | Custom git commit message to use when committing the changes made by this command. {version} will be dynamically interpolated when performing fixed releases, interpolated tags will be appended to the commit body when performing independent releases. |
| `--git-tag` | boolean | Whether or not to automatically tag the changes made by this command |
| `--git-tag-args` | string | Additional arguments to pass to the `git tag` command invoked behind the scenes |
| `--git-tag` | boolean | Whether or not to automatically tag the changes made by this command. |
| `--git-tag-args` | string | Additional arguments to pass to the `git tag` command invoked behind the scenes. |
| `--git-tag-message` | string | Custom git tag message to use when tagging the changes made by this command. This defaults to be the same value as the tag itself. |
| `--help` | boolean | Show help |
| `--preid` | string | The optional prerelease identifier to apply to the version. This will only be applied in the case that the specifier argument has been set to `prerelease` OR when conventional commits are enabled, in which case it will modify the resolved specifier from conventional commits to be its prerelease equivalent. E.g. minor -> preminor (Default: ``) |
| `--help` | boolean | Show help. |
| `--preid` | string | The optional prerelease identifier to apply to the version. This will only be applied in the case that the specifier argument has been set to `prerelease` OR when conventional commits are enabled, in which case it will modify the resolved specifier from conventional commits to be its prerelease equivalent. E.g. minor -> preminor. (Default: ``) |
| `--specifier` | string | Exact version or semver keyword to apply to the selected release group. |
| `--stage-changes` | boolean | Whether or not to stage the changes made by this command. Always treated as true if git-commit is true. |
| `--version` | boolean | Show version number |
| `--version` | boolean | Show version number. |
### changelog
Generate a changelog for one or more projects, and optionally push to Github
Generate a changelog for one or more projects, and optionally push to Github.
```shell
nx release changelog [version]
@ -86,23 +86,23 @@ nx release changelog [version]
| Option | Type | Description |
| ---------------------- | ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--first-release` | boolean | Indicates that this is the first release for the selected release group. If the current version cannot be determined as usual, the version on disk will be used as a fallback. This is useful when using git or the registry to determine the current version of packages, since those sources are only available after the first release. Also indicates that changelog generation should not assume a previous git tag exists and that publishing should not check for the existence of the package before running. |
| `--from` | string | The git reference to use as the start of the changelog. If not set it will attempt to resolve the latest tag and use that |
| `--git-commit` | boolean | Whether or not to automatically commit the changes made by this command |
| `--git-commit-args` | string | Additional arguments (added after the --message argument, which may or may not be customized with --git-commit-message) to pass to the `git commit` command invoked behind the scenes |
| `--from` | string | The git reference to use as the start of the changelog. If not set it will attempt to resolve the latest tag and use that. |
| `--git-commit` | boolean | Whether or not to automatically commit the changes made by this command. |
| `--git-commit-args` | string | Additional arguments (added after the --message argument, which may or may not be customized with --git-commit-message) to pass to the `git commit` command invoked behind the scenes. |
| `--git-commit-message` | string | Custom git commit message to use when committing the changes made by this command. {version} will be dynamically interpolated when performing fixed releases, interpolated tags will be appended to the commit body when performing independent releases. |
| `--git-remote` | string | Alternate git remote in the form {user}/{repo} on which to create the Github release (useful for testing) (Default: `origin`) |
| `--git-tag` | boolean | Whether or not to automatically tag the changes made by this command |
| `--git-tag-args` | string | Additional arguments to pass to the `git tag` command invoked behind the scenes |
| `--git-remote` | string | Alternate git remote in the form {user}/{repo} on which to create the Github release (useful for testing). (Default: `origin`) |
| `--git-tag` | boolean | Whether or not to automatically tag the changes made by this command. |
| `--git-tag-args` | string | Additional arguments to pass to the `git tag` command invoked behind the scenes. |
| `--git-tag-message` | string | Custom git tag message to use when tagging the changes made by this command. This defaults to be the same value as the tag itself. |
| `--help` | boolean | Show help |
| `--interactive` | `all`, `workspace`, `projects` | Interactively modify changelog markdown contents in your code editor before applying the changes. You can set it to be interactive for all changelogs, or only the workspace level, or only the project level |
| `--help` | boolean | Show help. |
| `--interactive` | `all`, `workspace`, `projects` | Interactively modify changelog markdown contents in your code editor before applying the changes. You can set it to be interactive for all changelogs, or only the workspace level, or only the project level. |
| `--stage-changes` | boolean | Whether or not to stage the changes made by this command. Always treated as true if git-commit is true. |
| `--to` | string | The git reference to use as the end of the changelog (Default: `HEAD`) |
| `--version` | string | The version to create a Github release and changelog for |
| `--to` | string | The git reference to use as the end of the changelog. (Default: `HEAD`) |
| `--version` | string | The version to create a Github release and changelog for. |
### publish
Publish a versioned project to a registry
Publish a versioned project to a registry.
```shell
nx release publish
@ -114,27 +114,27 @@ nx release publish
| --------------------------- | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--access` | `public`, `restricted` | Overrides the access level of the published package. Unscoped packages cannot be set to restricted. See the npm publish documentation for more information. |
| `--all` | boolean | [deprecated] `run-many` runs all targets on all projects in the workspace if no projects are provided. This option is no longer required. (Default: `true`) |
| `--exclude` | string | Exclude certain projects from being processed |
| `--excludeTaskDependencies` | boolean | Skips running dependent tasks first (Default: `false`) |
| `--exclude` | string | Exclude certain projects from being processed. |
| `--excludeTaskDependencies` | boolean | Skips running dependent tasks first. (Default: `false`) |
| `--first-release` | boolean | Indicates that this is the first release for the selected release group. If the current version cannot be determined as usual, the version on disk will be used as a fallback. This is useful when using git or the registry to determine the current version of packages, since those sources are only available after the first release. Also indicates that changelog generation should not assume a previous git tag exists and that publishing should not check for the existence of the package before running. |
| `--graph` | string | Show the task graph of the command. Pass a file path to save the graph data instead of viewing it in the browser. Pass "stdout" to print the results to the terminal. |
| `--help` | boolean | Show help |
| `--nxBail` | boolean | Stop command execution after the first failed task (Default: `false`) |
| `--nxIgnoreCycles` | boolean | Ignore cycles in the task graph (Default: `false`) |
| `--otp` | number | A one-time password for publishing to a registry that requires 2FA |
| `--help` | boolean | Show help. |
| `--nxBail` | boolean | Stop command execution after the first failed task. (Default: `false`) |
| `--nxIgnoreCycles` | boolean | Ignore cycles in the task graph. (Default: `false`) |
| `--otp` | number | A one-time password for publishing to a registry that requires 2FA. |
| `--output-style` | `dynamic`, `static`, `stream`, `stream-without-prefixes` | Defines how Nx emits outputs tasks logs. **dynamic**: use dynamic output life cycle, previous content is overwritten or modified as new outputs are added, display minimal logs by default, always show errors. This output format is recommended on your local development environments. **static**: uses static output life cycle, no previous content is rewritten or modified as new outputs are added. This output format is recommened for CI environments. **stream**: nx by default logs output to an internal output stream, enable this option to stream logs to stdout / stderr. **stream-without-prefixes**: nx prefixes the project name the target is running on, use this option remove the project name prefix from output. |
| `--parallel` | string | Max number of parallel processes [default is 3] |
| `--projects` | string | Projects to run. (comma/space delimited project names and/or patterns) |
| `--registry` | string | The registry to publish to |
| `--runner` | string | This is the name of the tasks runner configured in nx.json |
| `--skipNxCache` | boolean | Rerun the tasks even when the results are available in the cache (Default: `false`) |
| `--tag` | string | The distribution tag to apply to the published package |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces) |
| `--version` | boolean | Show version number |
| `--parallel` | string | Max number of parallel processes [default is 3]. |
| `--projects` | string | Projects to run. (comma/space delimited project names and/or patterns). |
| `--registry` | string | The registry to publish to. |
| `--runner` | string | This is the name of the tasks runner configured in nx.json. |
| `--skipNxCache` | boolean | Rerun the tasks even when the results are available in the cache. (Default: `false`) |
| `--tag` | string | The distribution tag to apply to the published package. |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
| `--version` | boolean | Show version number. |
### plan
Create a version plan file to specify the desired semver bump for one or more projects or groups, as well as the relevant changelog entry
Create a version plan file to specify the desired semver bump for one or more projects or groups, as well as the relevant changelog entry.
```shell
nx release plan [bump]
@ -143,22 +143,22 @@ nx release plan [bump]
## Options
| Option | Type | Description |
| --------------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `--base` | string | Base of the current branch (usually main) |
| --------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `--base` | string | Base of the current branch (usually main). |
| `--bump` | `major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, `prerelease` | Semver keyword to use for the selected release group. |
| `--exclude` | string | Exclude certain projects from being processed |
| `--files` | string | Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces |
| `--head` | string | Latest commit of the current branch (usually HEAD) |
| `--help` | boolean | Show help |
| `--message` | string | Custom message to use for the changelog entry |
| `--onlyTouched` | boolean | Only include projects that have been affected by the current changes (Default: `true`) |
| `--uncommitted` | boolean | Uncommitted changes |
| `--untracked` | boolean | Untracked changes |
| `--version` | boolean | Show version number |
| `--exclude` | string | Exclude certain projects from being processed. |
| `--files` | string | Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces. |
| `--head` | string | Latest commit of the current branch (usually HEAD). |
| `--help` | boolean | Show help. |
| `--message` | string | Custom message to use for the changelog entry. |
| `--onlyTouched` | boolean | Only include projects that have been affected by the current changes. (Default: `true`) |
| `--uncommitted` | boolean | Uncommitted changes. |
| `--untracked` | boolean | Untracked changes. |
| `--version` | boolean | Show version number. |
### plan:check
Ensure that all touched projects have an applicable version plan created for them
Ensure that all touched projects have an applicable version plan created for them.
```shell
nx release plan:check
@ -167,12 +167,12 @@ nx release plan:check
## Options
| Option | Type | Description |
| --------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `--base` | string | Base of the current branch (usually main) |
| `--exclude` | string | Exclude certain projects from being processed |
| `--files` | string | Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces |
| `--head` | string | Latest commit of the current branch (usually HEAD) |
| `--help` | boolean | Show help |
| `--uncommitted` | boolean | Uncommitted changes |
| `--untracked` | boolean | Untracked changes |
| `--version` | boolean | Show version number |
| --------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `--base` | string | Base of the current branch (usually main). |
| `--exclude` | string | Exclude certain projects from being processed. |
| `--files` | string | Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces. |
| `--head` | string | Latest commit of the current branch (usually HEAD). |
| `--help` | boolean | Show help. |
| `--uncommitted` | boolean | Uncommitted changes. |
| `--untracked` | boolean | Untracked changes. |
| `--version` | boolean | Show version number. |

View File

@ -35,7 +35,7 @@ Install `nx` globally to invoke the command directly using `nx`, or use `npx nx`
## Options
| Option | Type | Description |
| ----------- | ------- | --------------------------------------------------------------------- |
| `--help` | boolean | Show help |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces) |
| `--version` | boolean | Show version number |
| ----------- | ------- | ---------------------------------------------------------------------- |
| `--help` | boolean | Show help. |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
| `--version` | boolean | Show version number. |

View File

@ -1,11 +1,11 @@
---
title: 'report - CLI command'
description: 'Reports useful version numbers to copy into the Nx issue template'
description: 'Reports useful version numbers to copy into the Nx issue template.'
---
# report
Reports useful version numbers to copy into the Nx issue template
Reports useful version numbers to copy into the Nx issue template.
## Usage

View File

@ -44,10 +44,10 @@ Clears the workspace data directory. Used by Nx to store cached data about the c
## Options
| Option | Type | Description |
| --------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `--help` | boolean | Show help |
| --------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `--help` | boolean | Show help. |
| `--onlyCache` | boolean | Clears the Nx cache directory. This will remove all local cache entries for tasks, but will not affect the remote cache. |
| `--onlyCloud` | boolean | Resets the Nx Cloud client. NOTE: Does not clear the remote cache. |
| `--onlyDaemon` | boolean | Stops the Nx Daemon, it will be restarted fresh when the next Nx command is run. |
| `--onlyWorkspaceData` | boolean | Clears the workspace data directory. Used by Nx to store cached data about the current workspace (e.g. partial results, incremental data, etc) |
| `--version` | boolean | Show version number |
| `--onlyWorkspaceData` | boolean | Clears the workspace data directory. Used by Nx to store cached data about the current workspace (e.g. partial results, incremental data, etc). |
| `--version` | boolean | Show version number. |

View File

@ -1,11 +1,11 @@
---
title: 'run-many - CLI command'
description: 'Run target for multiple listed projects'
description: 'Run target for multiple listed projects.'
---
# run-many
Run target for multiple listed projects
Run target for multiple listed projects.
## Usage
@ -94,19 +94,19 @@ Print the task graph to the console:
| Option | Type | Description |
| --------------------------- | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--all` | boolean | [deprecated] `run-many` runs all targets on all projects in the workspace if no projects are provided. This option is no longer required. (Default: `true`) |
| `--batch` | boolean | Run task(s) in batches for executors which support batches (Default: `false`) |
| `--configuration` | string | This is the configuration to use when performing tasks on projects |
| `--exclude` | string | Exclude certain projects from being processed |
| `--excludeTaskDependencies` | boolean | Skips running dependent tasks first (Default: `false`) |
| `--batch` | boolean | Run task(s) in batches for executors which support batches. (Default: `false`) |
| `--configuration` | string | This is the configuration to use when performing tasks on projects. |
| `--exclude` | string | Exclude certain projects from being processed. |
| `--excludeTaskDependencies` | boolean | Skips running dependent tasks first. (Default: `false`) |
| `--graph` | string | Show the task graph of the command. Pass a file path to save the graph data instead of viewing it in the browser. Pass "stdout" to print the results to the terminal. |
| `--help` | boolean | Show help |
| `--nxBail` | boolean | Stop command execution after the first failed task (Default: `false`) |
| `--nxIgnoreCycles` | boolean | Ignore cycles in the task graph (Default: `false`) |
| `--help` | boolean | Show help. |
| `--nxBail` | boolean | Stop command execution after the first failed task. (Default: `false`) |
| `--nxIgnoreCycles` | boolean | Ignore cycles in the task graph. (Default: `false`) |
| `--output-style` | `dynamic`, `static`, `stream`, `stream-without-prefixes` | Defines how Nx emits outputs tasks logs. **dynamic**: use dynamic output life cycle, previous content is overwritten or modified as new outputs are added, display minimal logs by default, always show errors. This output format is recommended on your local development environments. **static**: uses static output life cycle, no previous content is rewritten or modified as new outputs are added. This output format is recommened for CI environments. **stream**: nx by default logs output to an internal output stream, enable this option to stream logs to stdout / stderr. **stream-without-prefixes**: nx prefixes the project name the target is running on, use this option remove the project name prefix from output. |
| `--parallel` | string | Max number of parallel processes [default is 3] |
| `--projects` | string | Projects to run. (comma/space delimited project names and/or patterns) |
| `--runner` | string | This is the name of the tasks runner configured in nx.json |
| `--skipNxCache` | boolean | Rerun the tasks even when the results are available in the cache (Default: `false`) |
| `--targets` | string | Tasks to run for affected projects |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces) |
| `--version` | boolean | Show version number |
| `--parallel` | string | Max number of parallel processes [default is 3]. |
| `--projects` | string | Projects to run. (comma/space delimited project names and/or patterns). |
| `--runner` | string | This is the name of the tasks runner configured in nx.json. |
| `--skipNxCache` | boolean | Rerun the tasks even when the results are available in the cache. (Default: `false`) |
| `--targets` | string | Tasks to run for affected projects. |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
| `--version` | boolean | Show version number. |

View File

@ -69,17 +69,17 @@ Run's a target named build:test for the myapp project. Note the quotes around th
| Option | Type | Description |
| --------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--batch` | boolean | Run task(s) in batches for executors which support batches (Default: `false`) |
| `--configuration` | string | This is the configuration to use when performing tasks on projects |
| `--exclude` | string | Exclude certain projects from being processed |
| `--excludeTaskDependencies` | boolean | Skips running dependent tasks first (Default: `false`) |
| `--batch` | boolean | Run task(s) in batches for executors which support batches. (Default: `false`) |
| `--configuration` | string | This is the configuration to use when performing tasks on projects. |
| `--exclude` | string | Exclude certain projects from being processed. |
| `--excludeTaskDependencies` | boolean | Skips running dependent tasks first. (Default: `false`) |
| `--graph` | string | Show the task graph of the command. Pass a file path to save the graph data instead of viewing it in the browser. Pass "stdout" to print the results to the terminal. |
| `--nxBail` | boolean | Stop command execution after the first failed task (Default: `false`) |
| `--nxIgnoreCycles` | boolean | Ignore cycles in the task graph (Default: `false`) |
| `--nxBail` | boolean | Stop command execution after the first failed task. (Default: `false`) |
| `--nxIgnoreCycles` | boolean | Ignore cycles in the task graph. (Default: `false`) |
| `--output-style` | `dynamic`, `static`, `stream`, `stream-without-prefixes`, `compact` | Defines how Nx emits outputs tasks logs. **dynamic**: use dynamic output life cycle, previous content is overwritten or modified as new outputs are added, display minimal logs by default, always show errors. This output format is recommended on your local development environments. **static**: uses static output life cycle, no previous content is rewritten or modified as new outputs are added. This output format is recommened for CI environments. **stream**: nx by default logs output to an internal output stream, enable this option to stream logs to stdout / stderr. **stream-without-prefixes**: nx prefixes the project name the target is running on, use this option remove the project name prefix from output. |
| `--parallel` | string | Max number of parallel processes [default is 3] |
| `--project` | string | Target project |
| `--runner` | string | This is the name of the tasks runner configured in nx.json |
| `--skipNxCache` | boolean | Rerun the tasks even when the results are available in the cache (Default: `false`) |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces) |
| `--version` | boolean | Show version number |
| `--parallel` | string | Max number of parallel processes [default is 3]. |
| `--project` | string | Target project. |
| `--runner` | string | This is the name of the tasks runner configured in nx.json. |
| `--skipNxCache` | boolean | Rerun the tasks even when the results are available in the cache. (Default: `false`) |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
| `--version` | boolean | Show version number. |

View File

@ -1,11 +1,11 @@
---
title: 'show - CLI command'
description: 'Show information about the workspace (e.g., list of projects)'
description: 'Show information about the workspace (e.g., list of projects).'
---
# show
Show information about the workspace (e.g., list of projects)
Show information about the workspace (e.g., list of projects).
## Usage
@ -86,16 +86,16 @@ Opens a web browser to explore the configuration of "my-app":
## Options
| Shared Option | Type | Description |
| ------------- | ------- | ------------------- |
| `--help` | boolean | Show help |
| `--json` | boolean | Output JSON |
| `--version` | boolean | Show version number |
| ------------- | ------- | -------------------- |
| `--help` | boolean | Show help. |
| `--json` | boolean | Output JSON. |
| `--version` | boolean | Show version number. |
## Subcommands
### projects
Show a list of projects in the workspace
Show a list of projects in the workspace.
```shell
nx show projects
@ -104,21 +104,21 @@ nx show projects
## Options
| Option | Type | Description |
| --------------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `--affected` | boolean | Show only affected projects |
| `--base` | string | Base of the current branch (usually main) |
| `--exclude` | string | Exclude certain projects from being processed |
| `--files` | string | Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces |
| `--head` | string | Latest commit of the current branch (usually HEAD) |
| `--help` | boolean | Show help |
| --------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `--affected` | boolean | Show only affected projects. |
| `--base` | string | Base of the current branch (usually main). |
| `--exclude` | string | Exclude certain projects from being processed. |
| `--files` | string | Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces. |
| `--head` | string | Latest commit of the current branch (usually HEAD). |
| `--help` | boolean | Show help. |
| `--projects` | string | Show only projects that match a given pattern. |
| `--sep` | string | Outputs projects with the specified seperator |
| `--type` | `app`, `lib`, `e2e` | Select only projects of the given type |
| `--uncommitted` | boolean | Uncommitted changes |
| `--untracked` | boolean | Untracked changes |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces) |
| `--version` | boolean | Show version number |
| `--withTarget` | string | Show only projects that have a specific target |
| `--sep` | string | Outputs projects with the specified seperator. |
| `--type` | `app`, `lib`, `e2e` | Select only projects of the given type. |
| `--uncommitted` | boolean | Uncommitted changes. |
| `--untracked` | boolean | Untracked changes. |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
| `--version` | boolean | Show version number. |
| `--withTarget` | string | Show only projects that have a specific target. |
### project
@ -131,10 +131,10 @@ nx show project <projectName>
## Options
| Option | Type | Description |
| --------------- | ------- | --------------------------------------------------------------------- |
| `--help` | boolean | Show help |
| `--open` | boolean | Set to false to prevent the browser from opening when using --web |
| `--projectName` | string | Which project should be viewed? |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces) |
| `--version` | boolean | Show version number |
| `--web` | boolean | Show project details in the browser. (default when interactive) |
| --------------- | ------- | ---------------------------------------------------------------------- |
| `--help` | boolean | Show help. |
| `--open` | boolean | Set to false to prevent the browser from opening when using --web. |
| `--projectName` | string | Which project should be viewed?. |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
| `--version` | boolean | Show version number. |
| `--web` | boolean | Show project details in the browser. (default when interactive). |

View File

@ -1,11 +1,11 @@
---
title: 'watch - CLI command'
description: 'Watch for changes within projects, and execute commands'
description: 'Watch for changes within projects, and execute commands.'
---
# watch
Watch for changes within projects, and execute commands
Watch for changes within projects, and execute commands.
## Usage
@ -40,8 +40,8 @@ Watch all projects (including newly created projects) in the workspace:
| Option | Type | Description |
| ---------------------------- | ------- | --------------------------------------------------------------------------- |
| `--all` | boolean | Watch all projects. |
| `--help` | boolean | Show help |
| `--help` | boolean | Show help. |
| `--includeDependentProjects` | boolean | When watching selected projects, include dependent projects as well. |
| `--projects` | string | Projects to watch (comma/space delimited). |
| `--verbose` | boolean | Run watch mode in verbose mode, where commands are logged before execution. |
| `--version` | boolean | Show version number |
| `--version` | boolean | Show version number. |

View File

@ -38,9 +38,9 @@ Install version `17.0.0` of the `@nx/react` package and run its `@nx/react:init`
## Options
| Option | Type | Description |
| ------------------------ | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--help` | boolean | Show help |
| `--packageSpecifier` | string | The package name and optional version (e.g. `@nx/react` or `@nx/react@latest`) to install and initialize. If the version is not specified it will install the same version as the `nx` package for Nx core plugins or the latest version for other packages |
| `--updatePackageScripts` | boolean | Update `package.json` scripts with inferred targets. Defaults to `true` when the package is a core Nx plugin |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces) |
| `--version` | boolean | Show version number |
| ------------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `--help` | boolean | Show help. |
| `--packageSpecifier` | string | The package name and optional version (e.g. `@nx/react` or `@nx/react@latest`) to install and initialize. If the version is not specified it will install the same version as the `nx` package for Nx core plugins or the latest version for other packages. |
| `--updatePackageScripts` | boolean | Update `package.json` scripts with inferred targets. Defaults to `true` when the package is a core Nx plugin. |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
| `--version` | boolean | Show version number. |

View File

@ -1,11 +1,11 @@
---
title: 'affected - CLI command'
description: 'Run target for affected projects'
description: 'Run target for affected projects.'
---
# affected
Run target for affected projects
Run target for affected projects.
## Usage
@ -91,23 +91,23 @@ Print the task graph to the console:
|
| `--base` | string | Base of the current branch (usually main) |
| `--batch` | boolean | Run task(s) in batches for executors which support batches (Default: `false`) |
| `--configuration` | string | This is the configuration to use when performing tasks on projects |
| `--exclude` | string | Exclude certain projects from being processed |
| `--excludeTaskDependencies` | boolean | Skips running dependent tasks first (Default: `false`) |
| `--files` | string | Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces |
| `--base` | string | Base of the current branch (usually main). |
| `--batch` | boolean | Run task(s) in batches for executors which support batches. (Default: `false`) |
| `--configuration` | string | This is the configuration to use when performing tasks on projects. |
| `--exclude` | string | Exclude certain projects from being processed. |
| `--excludeTaskDependencies` | boolean | Skips running dependent tasks first. (Default: `false`) |
| `--files` | string | Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces. |
| `--graph` | string | Show the task graph of the command. Pass a file path to save the graph data instead of viewing it in the browser. Pass "stdout" to print the results to the terminal. |
| `--head` | string | Latest commit of the current branch (usually HEAD) |
| `--help` | boolean | Show help |
| `--nxBail` | boolean | Stop command execution after the first failed task (Default: `false`) |
| `--nxIgnoreCycles` | boolean | Ignore cycles in the task graph (Default: `false`) |
| `--head` | string | Latest commit of the current branch (usually HEAD). |
| `--help` | boolean | Show help. |
| `--nxBail` | boolean | Stop command execution after the first failed task. (Default: `false`) |
| `--nxIgnoreCycles` | boolean | Ignore cycles in the task graph. (Default: `false`) |
| `--output-style` | `dynamic`, `static`, `stream`, `stream-without-prefixes` | Defines how Nx emits outputs tasks logs. **dynamic**: use dynamic output life cycle, previous content is overwritten or modified as new outputs are added, display minimal logs by default, always show errors. This output format is recommended on your local development environments. **static**: uses static output life cycle, no previous content is rewritten or modified as new outputs are added. This output format is recommened for CI environments. **stream**: nx by default logs output to an internal output stream, enable this option to stream logs to stdout / stderr. **stream-without-prefixes**: nx prefixes the project name the target is running on, use this option remove the project name prefix from output. |
| `--parallel` | string | Max number of parallel processes [default is 3] |
| `--runner` | string | This is the name of the tasks runner configured in nx.json |
| `--skipNxCache` | boolean | Rerun the tasks even when the results are available in the cache (Default: `false`) |
| `--targets` | string | Tasks to run for affected projects |
| `--uncommitted` | boolean | Uncommitted changes |
| `--untracked` | boolean | Untracked changes |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces) |
| `--version` | boolean | Show version number |
| `--parallel` | string | Max number of parallel processes [default is 3]. |
| `--runner` | string | This is the name of the tasks runner configured in nx.json. |
| `--skipNxCache` | boolean | Rerun the tasks even when the results are available in the cache. (Default: `false`) |
| `--targets` | string | Tasks to run for affected projects. |
| `--uncommitted` | boolean | Uncommitted changes. |
| `--untracked` | boolean | Untracked changes. |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
| `--version` | boolean | Show version number. |

View File

@ -1,11 +1,11 @@
---
title: 'connect - CLI command'
description: 'Connect workspace to Nx Cloud'
description: 'Connect workspace to Nx Cloud.'
---
# connect
Connect workspace to Nx Cloud
Connect workspace to Nx Cloud.
## Usage
@ -18,8 +18,8 @@ Install `nx` globally to invoke the command directly using `nx`, or use `npx nx`
## Options
| Option | Type | Description |
| ----------------- | ------- | ---------------------------------------------------------------------------------------- |
| `--generateToken` | boolean | Explicitly asks for a token to be created, do not override existing tokens from Nx Cloud |
| `--help` | boolean | Show help |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces) |
| `--version` | boolean | Show version number |
| ----------------- | ------- | ----------------------------------------------------------------------------------------- |
| `--generateToken` | boolean | Explicitly asks for a token to be created, do not override existing tokens from Nx Cloud. |
| `--help` | boolean | Show help. |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
| `--version` | boolean | Show version number. |

View File

@ -18,34 +18,34 @@ Install `create-nx-workspace` globally to invoke the command directly, or use `n
## Options
| Option | Type | Description |
| ------------------ | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--allPrompts` | boolean | Show all prompts (Default: `false`) |
| `--appName` | string | The name of the app when using a monorepo with certain stacks |
| `--bundler` | string | Bundler to be used to build the app |
| `--commit.email` | string | E-mail of the committer |
| `--commit.message` | string | Commit message (Default: `Initial commit`) |
| `--commit.name` | string | Name of the committer |
| `--defaultBase` | string | Default base to use for new projects (Default: `main`) |
| `--docker` | boolean | Generate a Dockerfile for the Node API |
| ------------------ | ----------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--allPrompts` | boolean | Show all prompts. (Default: `false`) |
| `--appName` | string | The name of the app when using a monorepo with certain stacks. |
| `--bundler` | string | Bundler to be used to build the app. |
| `--commit.email` | string | E-mail of the committer. |
| `--commit.message` | string | Commit message. (Default: `Initial commit`) |
| `--commit.name` | string | Name of the committer. |
| `--defaultBase` | string | Default base to use for new projects. (Default: `main`) |
| `--docker` | boolean | Generate a Dockerfile for the Node API. |
| `--e2eTestRunner` | `playwright`, `cypress`, `none` | Test runner to use for end to end (E2E) tests. |
| `--framework` | string | Framework option to be used with certain stacks |
| `--help` | boolean | Show help |
| `--interactive` | boolean | Enable interactive mode with presets (Default: `true`) |
| `--name` | string | Workspace name (e.g. org name) |
| `--nextAppDir` | boolean | Enable the App Router for Next.js |
| `--nextSrcDir` | boolean | Generate a 'src/' directory for Next.js |
| `--framework` | string | Framework option to be used with certain stacks. |
| `--help` | boolean | Show help. |
| `--interactive` | boolean | Enable interactive mode with presets. (Default: `true`) |
| `--name` | string | Workspace name (e.g. org name). |
| `--nextAppDir` | boolean | Enable the App Router for Next.js. |
| `--nextSrcDir` | boolean | Generate a 'src/' directory for Next.js. |
| `--nxCloud` | `github`, `gitlab`, `azure`, `bitbucket-pipelines`, `circleci`, `skip`, `yes` | Which CI provider would you like to use? |
| `--packageManager` | `bun`, `npm`, `pnpm`, `yarn` | Package manager to use (Default: `npm`) |
| `--packageManager` | `bun`, `npm`, `pnpm`, `yarn` | Package manager to use. (Default: `npm`) |
| `--prefix` | string | Prefix to use for Angular component and directive selectors. |
| `--preset` | string | Customizes the initial content of your workspace. Default presets include: ["apps", "npm", "ts", "web-components", "angular-monorepo", "angular-standalone", "react-monorepo", "react-standalone", "vue-monorepo", "vue-standalone", "nuxt", "nuxt-standalone", "next", "nextjs-standalone", "remix-monorepo", "remix-standalone", "react-native", "expo", "nest", "express", "react", "vue", "angular", "node-standalone", "node-monorepo", "ts-standalone"]. To build your own see https://nx.dev/extending-nx/recipes/create-preset |
| `--routing` | boolean | Add a routing setup for an Angular app (Default: `true`) |
| `--skipGit` | boolean | Skip initializing a git repository (Default: `false`) |
| `--ssr` | boolean | Enable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering) for the Angular application |
| `--standaloneApi` | boolean | Use Standalone Components if generating an Angular app (Default: `true`) |
| `--style` | string | Stylesheet type to be used with certain stacks |
| `--preset` | string | Customizes the initial content of your workspace. Default presets include: ["apps", "npm", "ts", "web-components", "angular-monorepo", "angular-standalone", "react-monorepo", "react-standalone", "vue-monorepo", "vue-standalone", "nuxt", "nuxt-standalone", "next", "nextjs-standalone", "remix-monorepo", "remix-standalone", "react-native", "expo", "nest", "express", "react", "vue", "angular", "node-standalone", "node-monorepo", "ts-standalone"]. To build your own see https://nx.dev/extending-nx/recipes/create-preset. |
| `--routing` | boolean | Add a routing setup for an Angular app. (Default: `true`) |
| `--skipGit` | boolean | Skip initializing a git repository. (Default: `false`) |
| `--ssr` | boolean | Enable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering) for the Angular application. |
| `--standaloneApi` | boolean | Use Standalone Components if generating an Angular app. (Default: `true`) |
| `--style` | string | Stylesheet type to be used with certain stacks. |
| `--useGitHub` | boolean | Will you be using GitHub as your git hosting provider? (Default: `false`) |
| `--version` | boolean | Show version number |
| `--workspaceType` | `integrated`, `package-based`, `standalone` | The type of workspace to create |
| `--version` | boolean | Show version number. |
| `--workspaceType` | `integrated`, `package-based`, `standalone` | The type of workspace to create. |
## Presets

View File

@ -1,11 +1,11 @@
---
title: 'daemon - CLI command'
description: 'Prints information about the Nx Daemon process or starts a daemon process'
description: 'Prints information about the Nx Daemon process or starts a daemon process.'
---
# daemon
Prints information about the Nx Daemon process or starts a daemon process
Prints information about the Nx Daemon process or starts a daemon process.
## Usage
@ -18,8 +18,8 @@ Install `nx` globally to invoke the command directly using `nx`, or use `npx nx`
## Options
| Option | Type | Description |
| ----------- | ------- | ------------------- |
| `--help` | boolean | Show help |
| ----------- | ------- | -------------------- |
| `--help` | boolean | Show help. |
| `--start` | boolean | (Default: `false`) |
| `--stop` | boolean | (Default: `false`) |
| `--version` | boolean | Show version number |
| `--version` | boolean | Show version number. |

View File

@ -1,11 +1,11 @@
---
title: 'graph - CLI command'
description: 'Graph dependencies within workspace'
description: 'Graph dependencies within workspace.'
---
# graph
Graph dependencies within workspace
Graph dependencies within workspace.
## Usage
@ -74,24 +74,24 @@ Watch for changes to project graph and update in-browser:
## Options
| Option | Type | Description |
| ----------------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `--affected` | boolean | Highlight affected projects |
| `--base` | string | Base of the current branch (usually main) |
| `--exclude` | string | Exclude certain projects from being processed |
| ----------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `--affected` | boolean | Highlight affected projects. |
| `--base` | string | Base of the current branch (usually main). |
| `--exclude` | string | Exclude certain projects from being processed. |
| `--file` | string | Output file (e.g. --file=output.json or --file=dep-graph.html). |
| `--files` | string | Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces |
| `--files` | string | Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces. |
| `--focus` | string | Use to show the project graph for a particular project and every node that is either an ancestor or a descendant. |
| `--groupByFolder` | boolean | Group projects by folder in the project graph |
| `--head` | string | Latest commit of the current branch (usually HEAD) |
| `--help` | boolean | Show help |
| `--groupByFolder` | boolean | Group projects by folder in the project graph. |
| `--head` | string | Latest commit of the current branch (usually HEAD). |
| `--help` | boolean | Show help. |
| `--host` | string | Bind the project graph server to a specific ip address. |
| `--open` | boolean | Open the project graph in the browser. (Default: `true`) |
| `--port` | number | Bind the project graph server to a specific port. |
| `--print` | boolean | Print the project graph to stdout in the terminal. |
| `--targets` | string | The target to show tasks for in the task graph |
| `--uncommitted` | boolean | Uncommitted changes |
| `--untracked` | boolean | Untracked changes |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces) |
| `--version` | boolean | Show version number |
| `--view` | `projects`, `tasks` | Choose whether to view the projects or task graph (Default: `projects`) |
| `--watch` | boolean | Watch for changes to project graph and update in-browser (Default: `true`) |
| `--targets` | string | The target to show tasks for in the task graph. |
| `--uncommitted` | boolean | Uncommitted changes. |
| `--untracked` | boolean | Untracked changes. |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
| `--version` | boolean | Show version number. |
| `--view` | `projects`, `tasks` | Choose whether to view the projects or task graph. (Default: `projects`) |
| `--watch` | boolean | Watch for changes to project graph and update in-browser. (Default: `true`) |

View File

@ -1,11 +1,11 @@
---
title: 'format:check - CLI command'
description: 'Check for un-formatted files'
description: 'Check for un-formatted files.'
---
# format:check
Check for un-formatted files
Check for un-formatted files.
## Usage
@ -18,15 +18,15 @@ Install `nx` globally to invoke the command directly using `nx`, or use `npx nx`
## Options
| Option | Type | Description |
| ----------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `--all` | boolean | Format all projects |
| `--base` | string | Base of the current branch (usually main) |
| `--exclude` | string | Exclude certain projects from being processed |
| `--files` | string | Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces |
| `--head` | string | Latest commit of the current branch (usually HEAD) |
| `--help` | boolean | Show help |
| ----------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `--all` | boolean | Format all projects. |
| `--base` | string | Base of the current branch (usually main). |
| `--exclude` | string | Exclude certain projects from being processed. |
| `--files` | string | Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces. |
| `--head` | string | Latest commit of the current branch (usually HEAD). |
| `--help` | boolean | Show help. |
| `--libs-and-apps` | boolean | Format only libraries and applications files. |
| `--projects` | string | Projects to format (comma/space delimited) |
| `--uncommitted` | boolean | Uncommitted changes |
| `--untracked` | boolean | Untracked changes |
| `--version` | boolean | Show version number |
| `--projects` | string | Projects to format (comma/space delimited). |
| `--uncommitted` | boolean | Uncommitted changes. |
| `--untracked` | boolean | Untracked changes. |
| `--version` | boolean | Show version number. |

View File

@ -1,11 +1,11 @@
---
title: 'format:write - CLI command'
description: 'Overwrite un-formatted files'
description: 'Overwrite un-formatted files.'
---
# format:write
Overwrite un-formatted files
Overwrite un-formatted files.
## Usage
@ -18,15 +18,15 @@ Install `nx` globally to invoke the command directly using `nx`, or use `npx nx`
## Options
| Option | Type | Description |
| ----------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `--all` | boolean | Format all projects |
| `--base` | string | Base of the current branch (usually main) |
| `--exclude` | string | Exclude certain projects from being processed |
| `--files` | string | Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces |
| `--head` | string | Latest commit of the current branch (usually HEAD) |
| `--help` | boolean | Show help |
| ----------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `--all` | boolean | Format all projects. |
| `--base` | string | Base of the current branch (usually main). |
| `--exclude` | string | Exclude certain projects from being processed. |
| `--files` | string | Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces. |
| `--head` | string | Latest commit of the current branch (usually HEAD). |
| `--help` | boolean | Show help. |
| `--libs-and-apps` | boolean | Format only libraries and applications files. |
| `--projects` | string | Projects to format (comma/space delimited) |
| `--uncommitted` | boolean | Uncommitted changes |
| `--untracked` | boolean | Untracked changes |
| `--version` | boolean | Show version number |
| `--projects` | string | Projects to format (comma/space delimited). |
| `--uncommitted` | boolean | Uncommitted changes. |
| `--untracked` | boolean | Untracked changes. |
| `--version` | boolean | Show version number. |

View File

@ -19,8 +19,8 @@ Install `nx` globally to invoke the command directly using `nx`, or use `npx nx`
| Option | Type | Description |
| ------------------------ | ------- | --------------------------------------------------------------------------------------------------- |
| `--help` | boolean | Show help |
| `--help` | boolean | Show help. |
| `--interactive` | boolean | When false disables interactive input prompts for options. (Default: `true`) |
| `--nxCloud` | boolean | Set up distributed caching with Nx Cloud. |
| `--useDotNxInstallation` | boolean | Initialize an Nx workspace setup in the .nx directory of the current repository. (Default: `false`) |
| `--version` | boolean | Show version number |
| `--version` | boolean | Show version number. |

View File

@ -32,7 +32,7 @@ List the generators and executors available in the `@nx/web` plugin if it is ins
## Options
| Option | Type | Description |
| ----------- | ------- | ---------------------------------------- |
| `--help` | boolean | Show help |
| `--plugin` | string | The name of an installed plugin to query |
| `--version` | boolean | Show version number |
| ----------- | ------- | ----------------------------------------- |
| `--help` | boolean | Show help. |
| `--plugin` | string | The name of an installed plugin to query. |
| `--version` | boolean | Show version number. |

View File

@ -80,16 +80,16 @@ Create a dedicated commit for each successfully completed migration. You can cus
## Options
| Option | Type | Description |
| ---------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `--commitPrefix` | string | Commit prefix to apply to the commit for each migration, when --create-commits is enabled (Default: `chore: [nx migration] `) |
| `--createCommits` | boolean | Automatically create a git commit after each migration runs (Default: `false`) |
| `--excludeAppliedMigrations` | boolean | Exclude migrations that should have been applied on previous updates. To be used with --from (Default: `false`) |
| `--from` | string | Use the provided versions for packages instead of the ones installed in node_modules (e.g., --from="@nx/react@16.0.0,@nx/js@16.0.0") |
| `--help` | boolean | Show help |
| `--ifExists` | boolean | Run migrations only if the migrations file exists, if not continues successfully (Default: `false`) |
| `--interactive` | boolean | Enable prompts to confirm whether to collect optional package updates and migrations (Default: `false`) |
| `--packageAndVersion` | string | The target package and version (e.g, @nx/workspace@16.0.0) |
| `--runMigrations` | string | Execute migrations from a file (when the file isn't provided, execute migrations from migrations.json) |
| `--to` | string | Use the provided versions for packages instead of the ones calculated by the migrator (e.g., --to="@nx/react@16.0.0,@nx/js@16.0.0") |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces) |
| `--version` | boolean | Show version number |
| ---------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `--commitPrefix` | string | Commit prefix to apply to the commit for each migration, when --create-commits is enabled. (Default: `chore: [nx migration] `) |
| `--createCommits` | boolean | Automatically create a git commit after each migration runs. (Default: `false`) |
| `--excludeAppliedMigrations` | boolean | Exclude migrations that should have been applied on previous updates. To be used with --from. (Default: `false`) |
| `--from` | string | Use the provided versions for packages instead of the ones installed in node_modules (e.g., --from="@nx/react@16.0.0,@nx/js@16.0.0"). |
| `--help` | boolean | Show help. |
| `--ifExists` | boolean | Run migrations only if the migrations file exists, if not continues successfully. (Default: `false`) |
| `--interactive` | boolean | Enable prompts to confirm whether to collect optional package updates and migrations. (Default: `false`) |
| `--packageAndVersion` | string | The target package and version (e.g, @nx/workspace@16.0.0). |
| `--runMigrations` | string | Execute migrations from a file (when the file isn't provided, execute migrations from migrations.json). |
| `--to` | string | Use the provided versions for packages instead of the ones calculated by the migrator (e.g., --to="@nx/react@16.0.0,@nx/js@16.0.0"). |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
| `--version` | boolean | Show version number. |

View File

@ -1,11 +1,11 @@
---
title: 'release - CLI command'
description: 'Orchestrate versioning and publishing of applications and libraries'
description: 'Orchestrate versioning and publishing of applications and libraries.'
---
# release
Orchestrate versioning and publishing of applications and libraries
Orchestrate versioning and publishing of applications and libraries.
## Usage
@ -18,20 +18,20 @@ Install `nx` globally to invoke the command directly using `nx`, or use `npx nx`
## Options
| Shared Option | Type | Description |
| --------------- | ------- | ---------------------------------------------------------------------------------------------------- |
| `--dry-run` | boolean | Preview the changes without updating files/creating releases (Default: `false`) |
| --------------- | ------- | ----------------------------------------------------------------------------------------------------- |
| `--dry-run` | boolean | Preview the changes without updating files/creating releases. (Default: `false`) |
| `--groups` | string | One or more release groups to target with the current command. |
| `--help` | boolean | Show help |
| `--printConfig` | string | Print the resolved nx release configuration that would be used for the current command and then exit |
| `--projects` | string | Projects to run. (comma/space delimited project names and/or patterns) |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces) |
| `--version` | boolean | Show version number |
| `--help` | boolean | Show help. |
| `--printConfig` | string | Print the resolved nx release configuration that would be used for the current command and then exit. |
| `--projects` | string | Projects to run. (comma/space delimited project names and/or patterns). |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
| `--version` | boolean | Show version number. |
## Subcommands
### Base Command Options
Create a version and release for the workspace, generate a changelog, and optionally publish the packages
Create a version and release for the workspace, generate a changelog, and optionally publish the packages.
```shell
nx release [specifier]
@ -42,15 +42,15 @@ nx release [specifier]
| Option | Type | Description |
| ----------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--first-release` | boolean | Indicates that this is the first release for the selected release group. If the current version cannot be determined as usual, the version on disk will be used as a fallback. This is useful when using git or the registry to determine the current version of packages, since those sources are only available after the first release. Also indicates that changelog generation should not assume a previous git tag exists and that publishing should not check for the existence of the package before running. |
| `--help` | boolean | Show help |
| `--skip-publish` | boolean | Skip publishing by automatically answering no to the confirmation prompt for publishing |
| `--help` | boolean | Show help. |
| `--skip-publish` | boolean | Skip publishing by automatically answering no to the confirmation prompt for publishing. |
| `--specifier` | string | Exact version or semver keyword to apply to the selected release group. |
| `--version` | boolean | Show version number |
| `--yes` | boolean | Automatically answer yes to the confirmation prompt for publishing |
| `--version` | boolean | Show version number. |
| `--yes` | boolean | Automatically answer yes to the confirmation prompt for publishing. |
### version
Create a version and release for one or more applications and libraries
Create a version and release for one or more applications and libraries.
```shell
nx release version [specifier]
@ -61,21 +61,21 @@ nx release version [specifier]
| Option | Type | Description |
| ---------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--first-release` | boolean | Indicates that this is the first release for the selected release group. If the current version cannot be determined as usual, the version on disk will be used as a fallback. This is useful when using git or the registry to determine the current version of packages, since those sources are only available after the first release. Also indicates that changelog generation should not assume a previous git tag exists and that publishing should not check for the existence of the package before running. |
| `--git-commit` | boolean | Whether or not to automatically commit the changes made by this command |
| `--git-commit-args` | string | Additional arguments (added after the --message argument, which may or may not be customized with --git-commit-message) to pass to the `git commit` command invoked behind the scenes |
| `--git-commit` | boolean | Whether or not to automatically commit the changes made by this command. |
| `--git-commit-args` | string | Additional arguments (added after the --message argument, which may or may not be customized with --git-commit-message) to pass to the `git commit` command invoked behind the scenes. |
| `--git-commit-message` | string | Custom git commit message to use when committing the changes made by this command. {version} will be dynamically interpolated when performing fixed releases, interpolated tags will be appended to the commit body when performing independent releases. |
| `--git-tag` | boolean | Whether or not to automatically tag the changes made by this command |
| `--git-tag-args` | string | Additional arguments to pass to the `git tag` command invoked behind the scenes |
| `--git-tag` | boolean | Whether or not to automatically tag the changes made by this command. |
| `--git-tag-args` | string | Additional arguments to pass to the `git tag` command invoked behind the scenes. |
| `--git-tag-message` | string | Custom git tag message to use when tagging the changes made by this command. This defaults to be the same value as the tag itself. |
| `--help` | boolean | Show help |
| `--preid` | string | The optional prerelease identifier to apply to the version. This will only be applied in the case that the specifier argument has been set to `prerelease` OR when conventional commits are enabled, in which case it will modify the resolved specifier from conventional commits to be its prerelease equivalent. E.g. minor -> preminor (Default: ``) |
| `--help` | boolean | Show help. |
| `--preid` | string | The optional prerelease identifier to apply to the version. This will only be applied in the case that the specifier argument has been set to `prerelease` OR when conventional commits are enabled, in which case it will modify the resolved specifier from conventional commits to be its prerelease equivalent. E.g. minor -> preminor. (Default: ``) |
| `--specifier` | string | Exact version or semver keyword to apply to the selected release group. |
| `--stage-changes` | boolean | Whether or not to stage the changes made by this command. Always treated as true if git-commit is true. |
| `--version` | boolean | Show version number |
| `--version` | boolean | Show version number. |
### changelog
Generate a changelog for one or more projects, and optionally push to Github
Generate a changelog for one or more projects, and optionally push to Github.
```shell
nx release changelog [version]
@ -86,23 +86,23 @@ nx release changelog [version]
| Option | Type | Description |
| ---------------------- | ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--first-release` | boolean | Indicates that this is the first release for the selected release group. If the current version cannot be determined as usual, the version on disk will be used as a fallback. This is useful when using git or the registry to determine the current version of packages, since those sources are only available after the first release. Also indicates that changelog generation should not assume a previous git tag exists and that publishing should not check for the existence of the package before running. |
| `--from` | string | The git reference to use as the start of the changelog. If not set it will attempt to resolve the latest tag and use that |
| `--git-commit` | boolean | Whether or not to automatically commit the changes made by this command |
| `--git-commit-args` | string | Additional arguments (added after the --message argument, which may or may not be customized with --git-commit-message) to pass to the `git commit` command invoked behind the scenes |
| `--from` | string | The git reference to use as the start of the changelog. If not set it will attempt to resolve the latest tag and use that. |
| `--git-commit` | boolean | Whether or not to automatically commit the changes made by this command. |
| `--git-commit-args` | string | Additional arguments (added after the --message argument, which may or may not be customized with --git-commit-message) to pass to the `git commit` command invoked behind the scenes. |
| `--git-commit-message` | string | Custom git commit message to use when committing the changes made by this command. {version} will be dynamically interpolated when performing fixed releases, interpolated tags will be appended to the commit body when performing independent releases. |
| `--git-remote` | string | Alternate git remote in the form {user}/{repo} on which to create the Github release (useful for testing) (Default: `origin`) |
| `--git-tag` | boolean | Whether or not to automatically tag the changes made by this command |
| `--git-tag-args` | string | Additional arguments to pass to the `git tag` command invoked behind the scenes |
| `--git-remote` | string | Alternate git remote in the form {user}/{repo} on which to create the Github release (useful for testing). (Default: `origin`) |
| `--git-tag` | boolean | Whether or not to automatically tag the changes made by this command. |
| `--git-tag-args` | string | Additional arguments to pass to the `git tag` command invoked behind the scenes. |
| `--git-tag-message` | string | Custom git tag message to use when tagging the changes made by this command. This defaults to be the same value as the tag itself. |
| `--help` | boolean | Show help |
| `--interactive` | `all`, `workspace`, `projects` | Interactively modify changelog markdown contents in your code editor before applying the changes. You can set it to be interactive for all changelogs, or only the workspace level, or only the project level |
| `--help` | boolean | Show help. |
| `--interactive` | `all`, `workspace`, `projects` | Interactively modify changelog markdown contents in your code editor before applying the changes. You can set it to be interactive for all changelogs, or only the workspace level, or only the project level. |
| `--stage-changes` | boolean | Whether or not to stage the changes made by this command. Always treated as true if git-commit is true. |
| `--to` | string | The git reference to use as the end of the changelog (Default: `HEAD`) |
| `--version` | string | The version to create a Github release and changelog for |
| `--to` | string | The git reference to use as the end of the changelog. (Default: `HEAD`) |
| `--version` | string | The version to create a Github release and changelog for. |
### publish
Publish a versioned project to a registry
Publish a versioned project to a registry.
```shell
nx release publish
@ -114,27 +114,27 @@ nx release publish
| --------------------------- | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--access` | `public`, `restricted` | Overrides the access level of the published package. Unscoped packages cannot be set to restricted. See the npm publish documentation for more information. |
| `--all` | boolean | [deprecated] `run-many` runs all targets on all projects in the workspace if no projects are provided. This option is no longer required. (Default: `true`) |
| `--exclude` | string | Exclude certain projects from being processed |
| `--excludeTaskDependencies` | boolean | Skips running dependent tasks first (Default: `false`) |
| `--exclude` | string | Exclude certain projects from being processed. |
| `--excludeTaskDependencies` | boolean | Skips running dependent tasks first. (Default: `false`) |
| `--first-release` | boolean | Indicates that this is the first release for the selected release group. If the current version cannot be determined as usual, the version on disk will be used as a fallback. This is useful when using git or the registry to determine the current version of packages, since those sources are only available after the first release. Also indicates that changelog generation should not assume a previous git tag exists and that publishing should not check for the existence of the package before running. |
| `--graph` | string | Show the task graph of the command. Pass a file path to save the graph data instead of viewing it in the browser. Pass "stdout" to print the results to the terminal. |
| `--help` | boolean | Show help |
| `--nxBail` | boolean | Stop command execution after the first failed task (Default: `false`) |
| `--nxIgnoreCycles` | boolean | Ignore cycles in the task graph (Default: `false`) |
| `--otp` | number | A one-time password for publishing to a registry that requires 2FA |
| `--help` | boolean | Show help. |
| `--nxBail` | boolean | Stop command execution after the first failed task. (Default: `false`) |
| `--nxIgnoreCycles` | boolean | Ignore cycles in the task graph. (Default: `false`) |
| `--otp` | number | A one-time password for publishing to a registry that requires 2FA. |
| `--output-style` | `dynamic`, `static`, `stream`, `stream-without-prefixes` | Defines how Nx emits outputs tasks logs. **dynamic**: use dynamic output life cycle, previous content is overwritten or modified as new outputs are added, display minimal logs by default, always show errors. This output format is recommended on your local development environments. **static**: uses static output life cycle, no previous content is rewritten or modified as new outputs are added. This output format is recommened for CI environments. **stream**: nx by default logs output to an internal output stream, enable this option to stream logs to stdout / stderr. **stream-without-prefixes**: nx prefixes the project name the target is running on, use this option remove the project name prefix from output. |
| `--parallel` | string | Max number of parallel processes [default is 3] |
| `--projects` | string | Projects to run. (comma/space delimited project names and/or patterns) |
| `--registry` | string | The registry to publish to |
| `--runner` | string | This is the name of the tasks runner configured in nx.json |
| `--skipNxCache` | boolean | Rerun the tasks even when the results are available in the cache (Default: `false`) |
| `--tag` | string | The distribution tag to apply to the published package |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces) |
| `--version` | boolean | Show version number |
| `--parallel` | string | Max number of parallel processes [default is 3]. |
| `--projects` | string | Projects to run. (comma/space delimited project names and/or patterns). |
| `--registry` | string | The registry to publish to. |
| `--runner` | string | This is the name of the tasks runner configured in nx.json. |
| `--skipNxCache` | boolean | Rerun the tasks even when the results are available in the cache. (Default: `false`) |
| `--tag` | string | The distribution tag to apply to the published package. |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
| `--version` | boolean | Show version number. |
### plan
Create a version plan file to specify the desired semver bump for one or more projects or groups, as well as the relevant changelog entry
Create a version plan file to specify the desired semver bump for one or more projects or groups, as well as the relevant changelog entry.
```shell
nx release plan [bump]
@ -143,22 +143,22 @@ nx release plan [bump]
## Options
| Option | Type | Description |
| --------------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `--base` | string | Base of the current branch (usually main) |
| --------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `--base` | string | Base of the current branch (usually main). |
| `--bump` | `major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, `prerelease` | Semver keyword to use for the selected release group. |
| `--exclude` | string | Exclude certain projects from being processed |
| `--files` | string | Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces |
| `--head` | string | Latest commit of the current branch (usually HEAD) |
| `--help` | boolean | Show help |
| `--message` | string | Custom message to use for the changelog entry |
| `--onlyTouched` | boolean | Only include projects that have been affected by the current changes (Default: `true`) |
| `--uncommitted` | boolean | Uncommitted changes |
| `--untracked` | boolean | Untracked changes |
| `--version` | boolean | Show version number |
| `--exclude` | string | Exclude certain projects from being processed. |
| `--files` | string | Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces. |
| `--head` | string | Latest commit of the current branch (usually HEAD). |
| `--help` | boolean | Show help. |
| `--message` | string | Custom message to use for the changelog entry. |
| `--onlyTouched` | boolean | Only include projects that have been affected by the current changes. (Default: `true`) |
| `--uncommitted` | boolean | Uncommitted changes. |
| `--untracked` | boolean | Untracked changes. |
| `--version` | boolean | Show version number. |
### plan:check
Ensure that all touched projects have an applicable version plan created for them
Ensure that all touched projects have an applicable version plan created for them.
```shell
nx release plan:check
@ -167,12 +167,12 @@ nx release plan:check
## Options
| Option | Type | Description |
| --------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `--base` | string | Base of the current branch (usually main) |
| `--exclude` | string | Exclude certain projects from being processed |
| `--files` | string | Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces |
| `--head` | string | Latest commit of the current branch (usually HEAD) |
| `--help` | boolean | Show help |
| `--uncommitted` | boolean | Uncommitted changes |
| `--untracked` | boolean | Untracked changes |
| `--version` | boolean | Show version number |
| --------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `--base` | string | Base of the current branch (usually main). |
| `--exclude` | string | Exclude certain projects from being processed. |
| `--files` | string | Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces. |
| `--head` | string | Latest commit of the current branch (usually HEAD). |
| `--help` | boolean | Show help. |
| `--uncommitted` | boolean | Uncommitted changes. |
| `--untracked` | boolean | Untracked changes. |
| `--version` | boolean | Show version number. |

View File

@ -35,7 +35,7 @@ Install `nx` globally to invoke the command directly using `nx`, or use `npx nx`
## Options
| Option | Type | Description |
| ----------- | ------- | --------------------------------------------------------------------- |
| `--help` | boolean | Show help |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces) |
| `--version` | boolean | Show version number |
| ----------- | ------- | ---------------------------------------------------------------------- |
| `--help` | boolean | Show help. |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
| `--version` | boolean | Show version number. |

View File

@ -1,11 +1,11 @@
---
title: 'report - CLI command'
description: 'Reports useful version numbers to copy into the Nx issue template'
description: 'Reports useful version numbers to copy into the Nx issue template.'
---
# report
Reports useful version numbers to copy into the Nx issue template
Reports useful version numbers to copy into the Nx issue template.
## Usage

View File

@ -44,10 +44,10 @@ Clears the workspace data directory. Used by Nx to store cached data about the c
## Options
| Option | Type | Description |
| --------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `--help` | boolean | Show help |
| --------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `--help` | boolean | Show help. |
| `--onlyCache` | boolean | Clears the Nx cache directory. This will remove all local cache entries for tasks, but will not affect the remote cache. |
| `--onlyCloud` | boolean | Resets the Nx Cloud client. NOTE: Does not clear the remote cache. |
| `--onlyDaemon` | boolean | Stops the Nx Daemon, it will be restarted fresh when the next Nx command is run. |
| `--onlyWorkspaceData` | boolean | Clears the workspace data directory. Used by Nx to store cached data about the current workspace (e.g. partial results, incremental data, etc) |
| `--version` | boolean | Show version number |
| `--onlyWorkspaceData` | boolean | Clears the workspace data directory. Used by Nx to store cached data about the current workspace (e.g. partial results, incremental data, etc). |
| `--version` | boolean | Show version number. |

View File

@ -1,11 +1,11 @@
---
title: 'run-many - CLI command'
description: 'Run target for multiple listed projects'
description: 'Run target for multiple listed projects.'
---
# run-many
Run target for multiple listed projects
Run target for multiple listed projects.
## Usage
@ -94,19 +94,19 @@ Print the task graph to the console:
| Option | Type | Description |
| --------------------------- | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--all` | boolean | [deprecated] `run-many` runs all targets on all projects in the workspace if no projects are provided. This option is no longer required. (Default: `true`) |
| `--batch` | boolean | Run task(s) in batches for executors which support batches (Default: `false`) |
| `--configuration` | string | This is the configuration to use when performing tasks on projects |
| `--exclude` | string | Exclude certain projects from being processed |
| `--excludeTaskDependencies` | boolean | Skips running dependent tasks first (Default: `false`) |
| `--batch` | boolean | Run task(s) in batches for executors which support batches. (Default: `false`) |
| `--configuration` | string | This is the configuration to use when performing tasks on projects. |
| `--exclude` | string | Exclude certain projects from being processed. |
| `--excludeTaskDependencies` | boolean | Skips running dependent tasks first. (Default: `false`) |
| `--graph` | string | Show the task graph of the command. Pass a file path to save the graph data instead of viewing it in the browser. Pass "stdout" to print the results to the terminal. |
| `--help` | boolean | Show help |
| `--nxBail` | boolean | Stop command execution after the first failed task (Default: `false`) |
| `--nxIgnoreCycles` | boolean | Ignore cycles in the task graph (Default: `false`) |
| `--help` | boolean | Show help. |
| `--nxBail` | boolean | Stop command execution after the first failed task. (Default: `false`) |
| `--nxIgnoreCycles` | boolean | Ignore cycles in the task graph. (Default: `false`) |
| `--output-style` | `dynamic`, `static`, `stream`, `stream-without-prefixes` | Defines how Nx emits outputs tasks logs. **dynamic**: use dynamic output life cycle, previous content is overwritten or modified as new outputs are added, display minimal logs by default, always show errors. This output format is recommended on your local development environments. **static**: uses static output life cycle, no previous content is rewritten or modified as new outputs are added. This output format is recommened for CI environments. **stream**: nx by default logs output to an internal output stream, enable this option to stream logs to stdout / stderr. **stream-without-prefixes**: nx prefixes the project name the target is running on, use this option remove the project name prefix from output. |
| `--parallel` | string | Max number of parallel processes [default is 3] |
| `--projects` | string | Projects to run. (comma/space delimited project names and/or patterns) |
| `--runner` | string | This is the name of the tasks runner configured in nx.json |
| `--skipNxCache` | boolean | Rerun the tasks even when the results are available in the cache (Default: `false`) |
| `--targets` | string | Tasks to run for affected projects |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces) |
| `--version` | boolean | Show version number |
| `--parallel` | string | Max number of parallel processes [default is 3]. |
| `--projects` | string | Projects to run. (comma/space delimited project names and/or patterns). |
| `--runner` | string | This is the name of the tasks runner configured in nx.json. |
| `--skipNxCache` | boolean | Rerun the tasks even when the results are available in the cache. (Default: `false`) |
| `--targets` | string | Tasks to run for affected projects. |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
| `--version` | boolean | Show version number. |

View File

@ -69,17 +69,17 @@ Run's a target named build:test for the myapp project. Note the quotes around th
| Option | Type | Description |
| --------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--batch` | boolean | Run task(s) in batches for executors which support batches (Default: `false`) |
| `--configuration` | string | This is the configuration to use when performing tasks on projects |
| `--exclude` | string | Exclude certain projects from being processed |
| `--excludeTaskDependencies` | boolean | Skips running dependent tasks first (Default: `false`) |
| `--batch` | boolean | Run task(s) in batches for executors which support batches. (Default: `false`) |
| `--configuration` | string | This is the configuration to use when performing tasks on projects. |
| `--exclude` | string | Exclude certain projects from being processed. |
| `--excludeTaskDependencies` | boolean | Skips running dependent tasks first. (Default: `false`) |
| `--graph` | string | Show the task graph of the command. Pass a file path to save the graph data instead of viewing it in the browser. Pass "stdout" to print the results to the terminal. |
| `--nxBail` | boolean | Stop command execution after the first failed task (Default: `false`) |
| `--nxIgnoreCycles` | boolean | Ignore cycles in the task graph (Default: `false`) |
| `--nxBail` | boolean | Stop command execution after the first failed task. (Default: `false`) |
| `--nxIgnoreCycles` | boolean | Ignore cycles in the task graph. (Default: `false`) |
| `--output-style` | `dynamic`, `static`, `stream`, `stream-without-prefixes`, `compact` | Defines how Nx emits outputs tasks logs. **dynamic**: use dynamic output life cycle, previous content is overwritten or modified as new outputs are added, display minimal logs by default, always show errors. This output format is recommended on your local development environments. **static**: uses static output life cycle, no previous content is rewritten or modified as new outputs are added. This output format is recommened for CI environments. **stream**: nx by default logs output to an internal output stream, enable this option to stream logs to stdout / stderr. **stream-without-prefixes**: nx prefixes the project name the target is running on, use this option remove the project name prefix from output. |
| `--parallel` | string | Max number of parallel processes [default is 3] |
| `--project` | string | Target project |
| `--runner` | string | This is the name of the tasks runner configured in nx.json |
| `--skipNxCache` | boolean | Rerun the tasks even when the results are available in the cache (Default: `false`) |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces) |
| `--version` | boolean | Show version number |
| `--parallel` | string | Max number of parallel processes [default is 3]. |
| `--project` | string | Target project. |
| `--runner` | string | This is the name of the tasks runner configured in nx.json. |
| `--skipNxCache` | boolean | Rerun the tasks even when the results are available in the cache. (Default: `false`) |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
| `--version` | boolean | Show version number. |

View File

@ -1,11 +1,11 @@
---
title: 'show - CLI command'
description: 'Show information about the workspace (e.g., list of projects)'
description: 'Show information about the workspace (e.g., list of projects).'
---
# show
Show information about the workspace (e.g., list of projects)
Show information about the workspace (e.g., list of projects).
## Usage
@ -86,16 +86,16 @@ Opens a web browser to explore the configuration of "my-app":
## Options
| Shared Option | Type | Description |
| ------------- | ------- | ------------------- |
| `--help` | boolean | Show help |
| `--json` | boolean | Output JSON |
| `--version` | boolean | Show version number |
| ------------- | ------- | -------------------- |
| `--help` | boolean | Show help. |
| `--json` | boolean | Output JSON. |
| `--version` | boolean | Show version number. |
## Subcommands
### projects
Show a list of projects in the workspace
Show a list of projects in the workspace.
```shell
nx show projects
@ -104,21 +104,21 @@ nx show projects
## Options
| Option | Type | Description |
| --------------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `--affected` | boolean | Show only affected projects |
| `--base` | string | Base of the current branch (usually main) |
| `--exclude` | string | Exclude certain projects from being processed |
| `--files` | string | Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces |
| `--head` | string | Latest commit of the current branch (usually HEAD) |
| `--help` | boolean | Show help |
| --------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `--affected` | boolean | Show only affected projects. |
| `--base` | string | Base of the current branch (usually main). |
| `--exclude` | string | Exclude certain projects from being processed. |
| `--files` | string | Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces. |
| `--head` | string | Latest commit of the current branch (usually HEAD). |
| `--help` | boolean | Show help. |
| `--projects` | string | Show only projects that match a given pattern. |
| `--sep` | string | Outputs projects with the specified seperator |
| `--type` | `app`, `lib`, `e2e` | Select only projects of the given type |
| `--uncommitted` | boolean | Uncommitted changes |
| `--untracked` | boolean | Untracked changes |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces) |
| `--version` | boolean | Show version number |
| `--withTarget` | string | Show only projects that have a specific target |
| `--sep` | string | Outputs projects with the specified seperator. |
| `--type` | `app`, `lib`, `e2e` | Select only projects of the given type. |
| `--uncommitted` | boolean | Uncommitted changes. |
| `--untracked` | boolean | Untracked changes. |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
| `--version` | boolean | Show version number. |
| `--withTarget` | string | Show only projects that have a specific target. |
### project
@ -131,10 +131,10 @@ nx show project <projectName>
## Options
| Option | Type | Description |
| --------------- | ------- | --------------------------------------------------------------------- |
| `--help` | boolean | Show help |
| `--open` | boolean | Set to false to prevent the browser from opening when using --web |
| `--projectName` | string | Which project should be viewed? |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces) |
| `--version` | boolean | Show version number |
| `--web` | boolean | Show project details in the browser. (default when interactive) |
| --------------- | ------- | ---------------------------------------------------------------------- |
| `--help` | boolean | Show help. |
| `--open` | boolean | Set to false to prevent the browser from opening when using --web. |
| `--projectName` | string | Which project should be viewed?. |
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
| `--version` | boolean | Show version number. |
| `--web` | boolean | Show project details in the browser. (default when interactive). |

View File

@ -1,11 +1,11 @@
---
title: 'watch - CLI command'
description: 'Watch for changes within projects, and execute commands'
description: 'Watch for changes within projects, and execute commands.'
---
# watch
Watch for changes within projects, and execute commands
Watch for changes within projects, and execute commands.
## Usage
@ -40,8 +40,8 @@ Watch all projects (including newly created projects) in the workspace:
| Option | Type | Description |
| ---------------------------- | ------- | --------------------------------------------------------------------------- |
| `--all` | boolean | Watch all projects. |
| `--help` | boolean | Show help |
| `--help` | boolean | Show help. |
| `--includeDependentProjects` | boolean | When watching selected projects, include dependent projects as well. |
| `--projects` | string | Projects to watch (comma/space delimited). |
| `--verbose` | boolean | Run watch mode in verbose mode, where commands are logged before execution. |
| `--version` | boolean | Show version number |
| `--version` | boolean | Show version number. |

View File

@ -109,65 +109,67 @@ export const commandsObject: yargs.Argv<Arguments> = yargs
withOptions(
yargs
.option('name', {
describe: chalk.dim`Workspace name (e.g. org name)`,
describe: chalk.dim`Workspace name (e.g. org name).`,
type: 'string',
})
.option('preset', {
// This describe is hard to auto-fix because of the loop in the code.
// eslint-disable-next-line @nx/workspace/valid-command-object
describe: chalk.dim`Customizes the initial content of your workspace. Default presets include: [${Object.values(
Preset
)
.map((p) => `"${p}"`)
.join(
', '
)}]. To build your own see https://nx.dev/extending-nx/recipes/create-preset`,
)}]. To build your own see https://nx.dev/extending-nx/recipes/create-preset.`,
type: 'string',
})
.option('interactive', {
describe: chalk.dim`Enable interactive mode with presets`,
describe: chalk.dim`Enable interactive mode with presets.`,
type: 'boolean',
default: true,
})
.option('workspaceType', {
describe: chalk.dim`The type of workspace to create`,
describe: chalk.dim`The type of workspace to create.`,
choices: ['integrated', 'package-based', 'standalone'],
type: 'string',
})
.option('appName', {
describe: chalk.dim`The name of the app when using a monorepo with certain stacks`,
describe: chalk.dim`The name of the app when using a monorepo with certain stacks.`,
type: 'string',
})
.option('style', {
describe: chalk.dim`Stylesheet type to be used with certain stacks`,
describe: chalk.dim`Stylesheet type to be used with certain stacks.`,
type: 'string',
})
.option('standaloneApi', {
describe: chalk.dim`Use Standalone Components if generating an Angular app`,
describe: chalk.dim`Use Standalone Components if generating an Angular app.`,
type: 'boolean',
default: true,
})
.option('routing', {
describe: chalk.dim`Add a routing setup for an Angular app`,
describe: chalk.dim`Add a routing setup for an Angular app.`,
type: 'boolean',
default: true,
})
.option('bundler', {
describe: chalk.dim`Bundler to be used to build the app`,
describe: chalk.dim`Bundler to be used to build the app.`,
type: 'string',
})
.option('framework', {
describe: chalk.dim`Framework option to be used with certain stacks`,
describe: chalk.dim`Framework option to be used with certain stacks.`,
type: 'string',
})
.option('docker', {
describe: chalk.dim`Generate a Dockerfile for the Node API`,
describe: chalk.dim`Generate a Dockerfile for the Node API.`,
type: 'boolean',
})
.option('nextAppDir', {
describe: chalk.dim`Enable the App Router for Next.js`,
describe: chalk.dim`Enable the App Router for Next.js.`,
type: 'boolean',
})
.option('nextSrcDir', {
describe: chalk.dim`Generate a 'src/' directory for Next.js`,
describe: chalk.dim`Generate a 'src/' directory for Next.js.`,
type: 'boolean',
})
.option('e2eTestRunner', {
@ -176,7 +178,7 @@ export const commandsObject: yargs.Argv<Arguments> = yargs
type: 'string',
})
.option('ssr', {
describe: chalk.dim`Enable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering) for the Angular application`,
describe: chalk.dim`Enable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering) for the Angular application.`,
type: 'boolean',
})
.option('prefix', {

View File

@ -26,7 +26,7 @@ export function withUseGitHub<T = unknown>(argv: yargs.Argv<T>) {
export function withAllPrompts<T = unknown>(argv: yargs.Argv<T>) {
return argv.option('allPrompts', {
alias: 'a',
describe: chalk.dim`Show all prompts`,
describe: chalk.dim`Show all prompts.`,
type: 'boolean',
default: false,
});
@ -35,7 +35,7 @@ export function withAllPrompts<T = unknown>(argv: yargs.Argv<T>) {
export function withPackageManager<T = unknown>(argv: yargs.Argv<T>) {
return argv.option('packageManager', {
alias: 'pm',
describe: chalk.dim`Package manager to use`,
describe: chalk.dim`Package manager to use.`,
choices: [...packageManagerList].sort(),
defaultDescription: 'npm',
type: 'string',
@ -46,25 +46,25 @@ export function withGitOptions<T = unknown>(argv: yargs.Argv<T>) {
return argv
.option('defaultBase', {
defaultDescription: 'main',
describe: chalk.dim`Default base to use for new projects`,
describe: chalk.dim`Default base to use for new projects.`,
type: 'string',
})
.option('skipGit', {
describe: chalk.dim`Skip initializing a git repository`,
describe: chalk.dim`Skip initializing a git repository.`,
type: 'boolean',
default: false,
alias: 'g',
})
.option('commit.name', {
describe: chalk.dim`Name of the committer`,
describe: chalk.dim`Name of the committer.`,
type: 'string',
})
.option('commit.email', {
describe: chalk.dim`E-mail of the committer`,
describe: chalk.dim`E-mail of the committer.`,
type: 'string',
})
.option('commit.message', {
describe: chalk.dim`Commit message`,
describe: chalk.dim`Commit message.`,
type: 'string',
default: 'Initial commit',
});

View File

@ -23,12 +23,12 @@ export const yargsAddCommand: CommandModule<
.positional('packageSpecifier', {
type: 'string',
description:
'The package name and optional version (e.g. `@nx/react` or `@nx/react@latest`) to install and initialize. If the version is not specified it will install the same version as the `nx` package for Nx core plugins or the latest version for other packages',
'The package name and optional version (e.g. `@nx/react` or `@nx/react@latest`) to install and initialize. If the version is not specified it will install the same version as the `nx` package for Nx core plugins or the latest version for other packages.',
})
.option('updatePackageScripts', {
type: 'boolean',
description:
'Update `package.json` scripts with inferred targets. Defaults to `true` when the package is a core Nx plugin',
'Update `package.json` scripts with inferred targets. Defaults to `true` when the package is a core Nx plugin.',
})
.example(
'$0 add @nx/react',

View File

@ -13,7 +13,7 @@ import { handleErrors } from '../../utils/params';
export const yargsAffectedCommand: CommandModule = {
command: 'affected',
describe: 'Run target for affected projects',
describe: 'Run target for affected projects.',
builder: (yargs) =>
linkToNxDevAndExamples(
withAffectedOptions(

View File

@ -6,7 +6,7 @@ import { withVerbose } from '../yargs-utils/shared-options';
export const yargsConnectCommand: CommandModule = {
command: 'connect',
aliases: ['connect-to-nx-cloud'],
describe: `Connect workspace to Nx Cloud`,
describe: `Connect workspace to Nx Cloud.`,
builder: (yargs) =>
linkToNxDevAndExamples(withConnectOptions(yargs), 'connect-to-nx-cloud'),
handler: async (args: any) => {
@ -26,7 +26,7 @@ function withConnectOptions(yargs: Argv) {
return withVerbose(yargs).option('generateToken', {
type: 'boolean',
description:
'Explicitly asks for a token to be created, do not override existing tokens from Nx Cloud',
'Explicitly asks for a token to be created, do not override existing tokens from Nx Cloud.',
});
}

View File

@ -4,7 +4,7 @@ import { linkToNxDevAndExamples } from '../yargs-utils/documentation';
export const yargsDaemonCommand: CommandModule = {
command: 'daemon',
describe:
'Prints information about the Nx Daemon process or starts a daemon process',
'Prints information about the Nx Daemon process or starts a daemon process.',
builder: (yargs) =>
linkToNxDevAndExamples(withDaemonOptions(yargs), 'daemon'),
handler: async (args) => (await import('./daemon')).daemonHandler(args),

View File

@ -39,13 +39,13 @@ export const yargsPrintAffectedCommand: CommandModule = {
.option('select', {
type: 'string',
describe:
'Select the subset of the returned json document (e.g., --select=projects)',
'Select the subset of the returned json document (e.g., --select=projects).',
})
.option('type', {
type: 'string',
choices: ['app', 'lib'],
describe:
'Select the type of projects to be returned (e.g., --type=app)',
'Select the type of projects to be returned (e.g., --type=app).',
}),
handler: async (args) => {
const exitCode = await handleErrors(false, () => {

View File

@ -6,7 +6,7 @@ import {
export const yargsExecCommand: CommandModule = {
command: 'exec',
describe: 'Executes any command as if it was a target on the project',
describe: 'Executes any command as if it was a target on the project.',
builder: (yargs) => withRunManyOptions(yargs),
handler: async (args) => {
try {

View File

@ -4,7 +4,7 @@ import { parseCSV, withAffectedOptions } from '../yargs-utils/shared-options';
export const yargsFormatCheckCommand: CommandModule = {
command: 'format:check',
describe: 'Check for un-formatted files',
describe: 'Check for un-formatted files.',
builder: (yargs) =>
linkToNxDevAndExamples(withFormatOptions(yargs), 'format:check'),
handler: async (args) => {
@ -15,7 +15,7 @@ export const yargsFormatCheckCommand: CommandModule = {
export const yargsFormatWriteCommand: CommandModule = {
command: 'format:write',
describe: 'Overwrite un-formatted files',
describe: 'Overwrite un-formatted files.',
aliases: ['format'],
builder: (yargs) =>
linkToNxDevAndExamples(withFormatOptions(yargs), 'format:write'),
@ -35,12 +35,12 @@ function withFormatOptions(yargs: Argv): Argv {
type: 'boolean',
})
.option('projects', {
describe: 'Projects to format (comma/space delimited)',
describe: 'Projects to format (comma/space delimited).',
type: 'string',
coerce: parseCSV,
})
.option('all', {
describe: 'Format all projects',
describe: 'Format all projects.',
type: 'boolean',
})
.conflicts({

View File

@ -22,23 +22,23 @@ function withGenerateOptions(yargs: Argv) {
process.argv[3] && !process.argv[3].startsWith('-');
const res = withVerbose(yargs)
.positional('generator', {
describe: 'Name of the generator (e.g., @nx/js:library, library)',
describe: 'Name of the generator (e.g., @nx/js:library, library).',
type: 'string',
required: true,
})
.option('dryRun', {
describe: 'Preview the changes without updating files',
describe: 'Preview the changes without updating files.',
alias: 'd',
type: 'boolean',
default: false,
})
.option('interactive', {
describe: 'When false disables interactive input prompts for options',
describe: 'When false disables interactive input prompts for options.',
type: 'boolean',
default: true,
})
.option('quiet', {
describe: 'Hides logs from tree operations (e.g. `CREATE package.json`)',
describe: 'Hides logs from tree operations (e.g. `CREATE package.json`).',
type: 'boolean',
conflicts: ['verbose'],
})

View File

@ -8,7 +8,7 @@ import {
export const yargsGraphCommand: CommandModule = {
command: 'graph',
describe: 'Graph dependencies within workspace',
describe: 'Graph dependencies within workspace.',
aliases: ['dep-graph'],
builder: (yargs) =>
linkToNxDevAndExamples(
@ -17,7 +17,7 @@ export const yargsGraphCommand: CommandModule = {
)
.option('affected', {
type: 'boolean',
description: 'Highlight affected projects',
description: 'Highlight affected projects.',
})
.implies('untracked', 'affected')
.implies('uncommitted', 'affected')
@ -42,14 +42,14 @@ export function withGraphOptions(yargs: Argv) {
})
.option('view', {
describe: 'Choose whether to view the projects or task graph',
describe: 'Choose whether to view the projects or task graph.',
type: 'string',
default: 'projects',
choices: ['projects', 'tasks'],
})
.option('targets', {
describe: 'The target to show tasks for in the task graph',
describe: 'The target to show tasks for in the task graph.',
type: 'string',
coerce: parseCSV,
})
@ -68,7 +68,7 @@ export function withGraphOptions(yargs: Argv) {
})
.option('groupByFolder', {
describe: 'Group projects by folder in the project graph',
describe: 'Group projects by folder in the project graph.',
type: 'boolean',
})
@ -83,7 +83,7 @@ export function withGraphOptions(yargs: Argv) {
})
.option('watch', {
describe: 'Watch for changes to project graph and update in-browser',
describe: 'Watch for changes to project graph and update in-browser.',
type: 'boolean',
default: true,
})

View File

@ -12,30 +12,30 @@ export const yargsImportCommand: CommandModule = {
yargs
.positional('sourceRemoteUrl', {
type: 'string',
description: 'The remote URL of the source to import',
description: 'The remote URL of the source to import.',
})
.positional('destination', {
type: 'string',
description:
'The directory in the current workspace to import into',
'The directory in the current workspace to import into.',
})
.option('source', {
type: 'string',
description:
'The directory in the source repository to import from',
'The directory in the source repository to import from.',
})
.option('ref', {
type: 'string',
description: 'The branch from the source repository to import',
description: 'The branch from the source repository to import.',
})
.option('depth', {
type: 'number',
description:
'The depth to clone the source repository (limit this for faster git clone)',
'The depth to clone the source repository (limit this for faster git clone).',
})
.option('interactive', {
type: 'boolean',
description: 'Interactive mode',
description: 'Interactive mode.',
default: true,
})
),

View File

@ -7,7 +7,7 @@ export const yargsListCommand: CommandModule = {
builder: (yargs) =>
yargs.positional('plugin', {
type: 'string',
description: 'The name of an installed plugin to query',
description: 'The name of an installed plugin to query.',
}),
handler: async (args: any) => {
await (await import('./list')).listHandler(args);

View File

@ -42,49 +42,49 @@ function withMigrationOptions(yargs: Argv) {
return withVerbose(yargs)
.positional('packageAndVersion', {
describe: `The target package and version (e.g, @nx/workspace@16.0.0)`,
describe: `The target package and version (e.g, @nx/workspace@16.0.0).`,
type: 'string',
})
.option('runMigrations', {
describe: `Execute migrations from a file (when the file isn't provided, execute migrations from migrations.json)`,
describe: `Execute migrations from a file (when the file isn't provided, execute migrations from migrations.json).`,
type: 'string',
})
.option('ifExists', {
describe: `Run migrations only if the migrations file exists, if not continues successfully`,
describe: `Run migrations only if the migrations file exists, if not continues successfully.`,
type: 'boolean',
default: false,
})
.option('from', {
describe:
'Use the provided versions for packages instead of the ones installed in node_modules (e.g., --from="@nx/react@16.0.0,@nx/js@16.0.0")',
'Use the provided versions for packages instead of the ones installed in node_modules (e.g., --from="@nx/react@16.0.0,@nx/js@16.0.0").',
type: 'string',
})
.option('to', {
describe:
'Use the provided versions for packages instead of the ones calculated by the migrator (e.g., --to="@nx/react@16.0.0,@nx/js@16.0.0")',
'Use the provided versions for packages instead of the ones calculated by the migrator (e.g., --to="@nx/react@16.0.0,@nx/js@16.0.0").',
type: 'string',
})
.option('createCommits', {
describe: 'Automatically create a git commit after each migration runs',
describe: 'Automatically create a git commit after each migration runs.',
type: 'boolean',
alias: ['C'],
default: false,
})
.option('commitPrefix', {
describe:
'Commit prefix to apply to the commit for each migration, when --create-commits is enabled',
'Commit prefix to apply to the commit for each migration, when --create-commits is enabled.',
type: 'string',
default: defaultCommitPrefix,
})
.option('interactive', {
describe:
'Enable prompts to confirm whether to collect optional package updates and migrations',
'Enable prompts to confirm whether to collect optional package updates and migrations.',
type: 'boolean',
default: false,
})
.option('excludeAppliedMigrations', {
describe:
'Exclude migrations that should have been applied on previous updates. To be used with --from',
'Exclude migrations that should have been applied on previous updates. To be used with --from.',
type: 'boolean',
default: false,
})

View File

@ -17,12 +17,12 @@ export const yargsNewCommand: CommandModule = {
function withNewOptions(yargs: Argv) {
return yargs
.option('nxWorkspaceRoot', {
describe: 'The folder where the new workspace is going to be created',
describe: 'The folder where the new workspace is going to be created.',
type: 'string',
required: true,
})
.option('interactive', {
describe: 'When false disables interactive input prompts for options',
describe: 'When false disables interactive input prompts for options.',
type: 'boolean',
default: true,
});

View File

@ -103,7 +103,7 @@ export const yargsReleaseCommand: CommandModule<
> = {
command: 'release',
describe:
'Orchestrate versioning and publishing of applications and libraries',
'Orchestrate versioning and publishing of applications and libraries.',
builder: (yargs) =>
withVerbose(yargs)
.command(releaseCommand)
@ -127,11 +127,11 @@ export const yargsReleaseCommand: CommandModule<
alias: 'p',
coerce: parseCSV,
describe:
'Projects to run. (comma/space delimited project names and/or patterns)',
'Projects to run. (comma/space delimited project names and/or patterns).',
})
.option('dry-run', {
describe:
'Preview the changes without updating files/creating releases',
'Preview the changes without updating files/creating releases.',
alias: 'd',
type: 'boolean',
default: false,
@ -140,7 +140,7 @@ export const yargsReleaseCommand: CommandModule<
.option('printConfig', {
type: 'string',
describe:
'Print the resolved nx release configuration that would be used for the current command and then exit',
'Print the resolved nx release configuration that would be used for the current command and then exit.',
coerce: (val: string) => {
if (val === '') {
return true;
@ -178,7 +178,7 @@ export const yargsReleaseCommand: CommandModule<
const releaseCommand: CommandModule<NxReleaseArgs, ReleaseOptions> = {
command: '$0 [specifier]',
describe:
'Create a version and release for the workspace, generate a changelog, and optionally publish the packages',
'Create a version and release for the workspace, generate a changelog, and optionally publish the packages.',
builder: (yargs) =>
withFirstReleaseOptions(yargs)
.positional('specifier', {
@ -190,12 +190,12 @@ const releaseCommand: CommandModule<NxReleaseArgs, ReleaseOptions> = {
type: 'boolean',
alias: 'y',
description:
'Automatically answer yes to the confirmation prompt for publishing',
'Automatically answer yes to the confirmation prompt for publishing.',
})
.option('skip-publish', {
type: 'boolean',
description:
'Skip publishing by automatically answering no to the confirmation prompt for publishing',
'Skip publishing by automatically answering no to the confirmation prompt for publishing.',
})
.check((argv) => {
if (argv.yes !== undefined && argv.skipPublish !== undefined) {
@ -220,7 +220,7 @@ const versionCommand: CommandModule<NxReleaseArgs, VersionOptions> = {
command: 'version [specifier]',
aliases: ['v'],
describe:
'Create a version and release for one or more applications and libraries',
'Create a version and release for one or more applications and libraries.',
builder: (yargs) =>
withFirstReleaseOptions(
withGitCommitAndGitTagOptions(
@ -233,7 +233,7 @@ const versionCommand: CommandModule<NxReleaseArgs, VersionOptions> = {
.option('preid', {
type: 'string',
describe:
'The optional prerelease identifier to apply to the version. This will only be applied in the case that the specifier argument has been set to `prerelease` OR when conventional commits are enabled, in which case it will modify the resolved specifier from conventional commits to be its prerelease equivalent. E.g. minor -> preminor',
'The optional prerelease identifier to apply to the version. This will only be applied in the case that the specifier argument has been set to `prerelease` OR when conventional commits are enabled, in which case it will modify the resolved specifier from conventional commits to be its prerelease equivalent. E.g. minor -> preminor.',
default: '',
})
.option('stage-changes', {
@ -258,7 +258,7 @@ const changelogCommand: CommandModule<NxReleaseArgs, ChangelogOptions> = {
command: 'changelog [version]',
aliases: ['c'],
describe:
'Generate a changelog for one or more projects, and optionally push to Github',
'Generate a changelog for one or more projects, and optionally push to Github.',
builder: (yargs) =>
withFirstReleaseOptions(
withGitCommitAndGitTagOptions(
@ -268,29 +268,30 @@ const changelogCommand: CommandModule<NxReleaseArgs, ChangelogOptions> = {
.positional('version', {
type: 'string',
description:
'The version to create a Github release and changelog for',
'The version to create a Github release and changelog for.',
})
.option('from', {
type: 'string',
description:
'The git reference to use as the start of the changelog. If not set it will attempt to resolve the latest tag and use that',
'The git reference to use as the start of the changelog. If not set it will attempt to resolve the latest tag and use that.',
})
.option('to', {
type: 'string',
description: 'The git reference to use as the end of the changelog',
description:
'The git reference to use as the end of the changelog.',
default: 'HEAD',
})
.option('interactive', {
alias: 'i',
type: 'string',
description:
'Interactively modify changelog markdown contents in your code editor before applying the changes. You can set it to be interactive for all changelogs, or only the workspace level, or only the project level',
'Interactively modify changelog markdown contents in your code editor before applying the changes. You can set it to be interactive for all changelogs, or only the workspace level, or only the project level.',
choices: ['all', 'workspace', 'projects'],
})
.option('git-remote', {
type: 'string',
description:
'Alternate git remote in the form {user}/{repo} on which to create the Github release (useful for testing)',
'Alternate git remote in the form {user}/{repo} on which to create the Github release (useful for testing).',
default: 'origin',
})
.check((argv) => {
@ -317,17 +318,18 @@ const changelogCommand: CommandModule<NxReleaseArgs, ChangelogOptions> = {
const publishCommand: CommandModule<NxReleaseArgs, PublishOptions> = {
command: 'publish',
aliases: ['p'],
describe: 'Publish a versioned project to a registry',
describe: 'Publish a versioned project to a registry.',
builder: (yargs) =>
withFirstReleaseOptions(
withRunManyOptions(withOutputStyleOption(yargs))
.option('registry', {
type: 'string',
description: 'The registry to publish to',
description: 'The registry to publish to.',
})
.option('tag', {
type: 'string',
description: 'The distribution tag to apply to the published package',
description:
'The distribution tag to apply to the published package.',
})
.option('access', {
type: 'string',
@ -338,7 +340,7 @@ const publishCommand: CommandModule<NxReleaseArgs, PublishOptions> = {
.option('otp', {
type: 'number',
description:
'A one-time password for publishing to a registry that requires 2FA',
'A one-time password for publishing to a registry that requires 2FA.',
})
),
handler: async (args) => {
@ -357,7 +359,7 @@ const planCommand: CommandModule<NxReleaseArgs, PlanOptions> = {
command: 'plan [bump]',
aliases: ['pl'],
describe:
'Create a version plan file to specify the desired semver bump for one or more projects or groups, as well as the relevant changelog entry',
'Create a version plan file to specify the desired semver bump for one or more projects or groups, as well as the relevant changelog entry.',
builder: (yargs) =>
withAffectedOptions(yargs)
.positional('bump', {
@ -376,12 +378,12 @@ const planCommand: CommandModule<NxReleaseArgs, PlanOptions> = {
.option('message', {
type: 'string',
alias: 'm',
describe: 'Custom message to use for the changelog entry',
describe: 'Custom message to use for the changelog entry.',
})
.option('onlyTouched', {
type: 'boolean',
describe:
'Only include projects that have been affected by the current changes',
'Only include projects that have been affected by the current changes.',
default: true,
}),
handler: async (args) => {
@ -398,7 +400,7 @@ const planCommand: CommandModule<NxReleaseArgs, PlanOptions> = {
const planCheckCommand: CommandModule<NxReleaseArgs, PlanCheckOptions> = {
command: 'plan:check',
describe:
'Ensure that all touched projects have an applicable version plan created for them',
'Ensure that all touched projects have an applicable version plan created for them.',
builder: (yargs) => withAffectedOptions(yargs),
handler: async (args) => {
const release = await import('./plan-check');
@ -420,7 +422,7 @@ function withGitCommitAndGitTagOptions<T>(
return yargs
.option('git-commit', {
describe:
'Whether or not to automatically commit the changes made by this command',
'Whether or not to automatically commit the changes made by this command.',
type: 'boolean',
})
.option('git-commit-message', {
@ -430,12 +432,12 @@ function withGitCommitAndGitTagOptions<T>(
})
.option('git-commit-args', {
describe:
'Additional arguments (added after the --message argument, which may or may not be customized with --git-commit-message) to pass to the `git commit` command invoked behind the scenes',
'Additional arguments (added after the --message argument, which may or may not be customized with --git-commit-message) to pass to the `git commit` command invoked behind the scenes.',
type: 'string',
})
.option('git-tag', {
describe:
'Whether or not to automatically tag the changes made by this command',
'Whether or not to automatically tag the changes made by this command.',
type: 'boolean',
})
.option('git-tag-message', {
@ -445,7 +447,7 @@ function withGitCommitAndGitTagOptions<T>(
})
.option('git-tag-args', {
describe:
'Additional arguments to pass to the `git tag` command invoked behind the scenes',
'Additional arguments to pass to the `git tag` command invoked behind the scenes.',
type: 'string',
})
.option('stage-changes', {

View File

@ -2,7 +2,8 @@ import { CommandModule } from 'yargs';
export const yargsReportCommand: CommandModule = {
command: 'report',
describe: 'Reports useful version numbers to copy into the Nx issue template',
describe:
'Reports useful version numbers to copy into the Nx issue template.',
handler: async () => {
await (await import('./report')).reportHandler();
process.exit(0);

View File

@ -34,7 +34,7 @@ export const yargsResetCommand: CommandModule<
})
.option('onlyWorkspaceData', {
description:
'Clears the workspace data directory. Used by Nx to store cached data about the current workspace (e.g. partial results, incremental data, etc)',
'Clears the workspace data directory. Used by Nx to store cached data about the current workspace (e.g. partial results, incremental data, etc).',
type: 'boolean',
}),
handler: async (argv) => (await import('./reset')).resetHandler(argv),

View File

@ -11,7 +11,7 @@ import { handleErrors } from '../../utils/params';
export const yargsRunManyCommand: CommandModule = {
command: 'run-many',
describe: 'Run target for multiple listed projects',
describe: 'Run target for multiple listed projects.',
builder: (yargs) =>
linkToNxDevAndExamples(
withRunManyOptions(

View File

@ -35,7 +35,7 @@ export const yargsRunCommand: CommandModule = {
export const yargsNxInfixCommand: CommandModule = {
...yargsRunCommand,
command: '$0 <target> [project] [_..]',
describe: 'Run a target for a project',
describe: 'Run a target for a project.',
handler: async (args) => {
const exitCode = await handleErrors(
(args.verbose as boolean) ?? process.env.NX_VERBOSE_LOGGING === 'true',

View File

@ -38,7 +38,7 @@ export const yargsShowCommand: CommandModule<
NxShowArgs
> = {
command: 'show',
describe: 'Show information about the workspace (e.g., list of projects)',
describe: 'Show information about the workspace (e.g., list of projects).',
builder: (yargs) =>
yargs
.command(showProjectsCommand)
@ -46,7 +46,7 @@ export const yargsShowCommand: CommandModule<
.demandCommand()
.option('json', {
type: 'boolean',
description: 'Output JSON',
description: 'Output JSON.',
})
.example(
'$0 show projects',
@ -68,12 +68,12 @@ export const yargsShowCommand: CommandModule<
const showProjectsCommand: CommandModule<NxShowArgs, ShowProjectsOptions> = {
command: 'projects',
describe: 'Show a list of projects in the workspace',
describe: 'Show a list of projects in the workspace.',
builder: (yargs) =>
withVerbose(withAffectedOptions(yargs))
.option('affected', {
type: 'boolean',
description: 'Show only affected projects',
description: 'Show only affected projects.',
})
.option('projects', {
type: 'string',
@ -84,17 +84,17 @@ const showProjectsCommand: CommandModule<NxShowArgs, ShowProjectsOptions> = {
.option('withTarget', {
type: 'string',
alias: ['t'],
description: 'Show only projects that have a specific target',
description: 'Show only projects that have a specific target.',
coerce: parseCSV,
})
.option('type', {
type: 'string',
description: 'Select only projects of the given type',
description: 'Select only projects of the given type.',
choices: ['app', 'lib', 'e2e'],
})
.option('sep', {
type: 'string',
description: 'Outputs projects with the specified seperator',
description: 'Outputs projects with the specified seperator.',
})
.implies('untracked', 'affected')
.implies('uncommitted', 'affected')
@ -140,17 +140,17 @@ const showProjectCommand: CommandModule<NxShowArgs, ShowProjectOptions> = {
.positional('projectName', {
type: 'string',
alias: 'p',
description: 'Which project should be viewed?',
description: 'Which project should be viewed?.',
})
.option('web', {
type: 'boolean',
description:
'Show project details in the browser. (default when interactive)',
'Show project details in the browser. (default when interactive).',
})
.option('open', {
type: 'boolean',
description:
'Set to false to prevent the browser from opening when using --web',
'Set to false to prevent the browser from opening when using --web.',
implies: 'web',
})
.check((argv) => {

View File

@ -5,7 +5,7 @@ import { parseCSV, withVerbose } from '../yargs-utils/shared-options';
export const yargsWatchCommand: CommandModule = {
command: 'watch',
describe: 'Watch for changes within projects, and execute commands',
describe: 'Watch for changes within projects, and execute commands.',
builder: (yargs) => linkToNxDevAndExamples(withWatchOptions(yargs), 'watch'),
handler: async (args) => {
await import('./watch').then((m) => m.watch(args as WatchArguments));

View File

@ -15,7 +15,7 @@ export const defaultYargsParserConfiguration: Partial<ParserConfigurationOptions
export function withExcludeOption<T>(yargs: Argv<T>): Argv<T & ExcludeOptions> {
return yargs.option('exclude', {
describe: 'Exclude certain projects from being processed',
describe: 'Exclude certain projects from being processed.',
type: 'string',
coerce: parseCSV,
}) as any;
@ -43,7 +43,7 @@ export interface RunOptions {
export function withRunOptions<T>(yargs: Argv<T>): Argv<T & RunOptions> {
return withVerbose(withExcludeOption(yargs))
.option('parallel', {
describe: 'Max number of parallel processes [default is 3]',
describe: 'Max number of parallel processes [default is 3].',
type: 'string',
})
.option('maxParallel', {
@ -51,11 +51,11 @@ export function withRunOptions<T>(yargs: Argv<T>): Argv<T & RunOptions> {
hidden: true,
})
.options('runner', {
describe: 'This is the name of the tasks runner configured in nx.json',
describe: 'This is the name of the tasks runner configured in nx.json.',
type: 'string',
})
.option('prod', {
describe: 'Use the production configuration',
describe: 'Use the production configuration.',
type: 'boolean',
default: false,
hidden: true,
@ -75,23 +75,23 @@ export function withRunOptions<T>(yargs: Argv<T>): Argv<T & RunOptions> {
: value,
})
.option('nxBail', {
describe: 'Stop command execution after the first failed task',
describe: 'Stop command execution after the first failed task.',
type: 'boolean',
default: false,
})
.option('nxIgnoreCycles', {
describe: 'Ignore cycles in the task graph',
describe: 'Ignore cycles in the task graph.',
type: 'boolean',
default: false,
})
.options('skipNxCache', {
describe:
'Rerun the tasks even when the results are available in the cache',
'Rerun the tasks even when the results are available in the cache.',
type: 'boolean',
default: false,
})
.options('excludeTaskDependencies', {
describe: 'Skips running dependent tasks first',
describe: 'Skips running dependent tasks first.',
type: 'boolean',
default: false,
})
@ -120,7 +120,7 @@ export function withTargetAndConfigurationOption(
demandOption = true
) {
return withConfiguration(yargs).option('targets', {
describe: 'Tasks to run for affected projects',
describe: 'Tasks to run for affected projects.',
type: 'string',
alias: ['target', 't'],
requiresArg: true,
@ -133,7 +133,7 @@ export function withTargetAndConfigurationOption(
export function withConfiguration(yargs: Argv) {
return yargs.options('configuration', {
describe:
'This is the configuration to use when performing tasks on projects',
'This is the configuration to use when performing tasks on projects.',
type: 'string',
alias: 'c',
});
@ -143,7 +143,7 @@ export function withVerbose<T>(yargs: Argv<T>) {
return yargs
.option('verbose', {
describe:
'Prints additional information about the commands (e.g., stack traces)',
'Prints additional information about the commands (e.g., stack traces).',
type: 'boolean',
})
.middleware((args) => {
@ -156,7 +156,7 @@ export function withVerbose<T>(yargs: Argv<T>) {
export function withBatch(yargs: Argv) {
return yargs.options('batch', {
type: 'boolean',
describe: 'Run task(s) in batches for executors which support batches',
describe: 'Run task(s) in batches for executors which support batches.',
coerce: (v) => {
return v || process.env.NX_BATCH_MODE === 'true';
},
@ -169,26 +169,26 @@ export function withAffectedOptions(yargs: Argv) {
.parserConfiguration(defaultYargsParserConfiguration)
.option('files', {
describe:
'Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces',
'Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces.',
type: 'string',
requiresArg: true,
coerce: parseCSV,
})
.option('uncommitted', {
describe: 'Uncommitted changes',
describe: 'Uncommitted changes.',
type: 'boolean',
})
.option('untracked', {
describe: 'Untracked changes',
describe: 'Untracked changes.',
type: 'boolean',
})
.option('base', {
describe: 'Base of the current branch (usually main)',
describe: 'Base of the current branch (usually main).',
type: 'string',
requiresArg: true,
})
.option('head', {
describe: 'Latest commit of the current branch (usually HEAD)',
describe: 'Latest commit of the current branch (usually HEAD).',
type: 'string',
requiresArg: true,
})
@ -227,7 +227,7 @@ export function withRunManyOptions<T>(
alias: 'p',
coerce: parseCSV,
describe:
'Projects to run. (comma/space delimited project names and/or patterns)',
'Projects to run. (comma/space delimited project names and/or patterns).',
})
.option('all', {
describe:
@ -288,11 +288,11 @@ export function withRunOneOptions(yargs: Argv) {
)
.parserConfiguration(defaultYargsParserConfiguration)
.option('project', {
describe: 'Target project',
describe: 'Target project.',
type: 'string',
})
.option('help', {
describe: 'Show Help',
describe: 'Show Help.',
type: 'boolean',
});

View File

@ -275,6 +275,14 @@ export function generateOptionsMarkdown(
''
)}\`)`;
}
if (
(option.name === 'version' &&
option.description === 'Show version number') ||
(option.name === 'help' && option.description === 'Show help')
) {
// Add . to the end of the built-in description for consistency with our other descriptions
description = `${description}.`;
}
items.push({ name, type, description });
});
}

View File

@ -1,3 +1,7 @@
import {
RULE_NAME as validCommandObjectName,
rule as validCommandObject,
} from './rules/valid-command-object';
import {
RULE_NAME as validSchemaDescriptionName,
rule as validSchemaDescription,
@ -27,5 +31,8 @@ module.exports = {
* [myCustomRuleName]: myCustomRule
* }
*/
rules: { [validSchemaDescriptionName]: validSchemaDescription },
rules: {
[validSchemaDescriptionName]: validSchemaDescription,
[validCommandObjectName]: validCommandObject,
},
};

View File

@ -0,0 +1,149 @@
import { TSESLint } from '@typescript-eslint/utils';
import { rule, RULE_NAME } from './valid-command-object';
const ruleTester = new TSESLint.RuleTester({
parser: require.resolve('@typescript-eslint/parser'),
});
ruleTester.run(RULE_NAME, rule, {
valid: [
// Not a command object file, so should not report
`module.exports = {
description: 'My command',
}`,
// Not a command object file, so should not report
`module.exports = {
describe: 'My command',
}`,
{
// Already has a . at the end of the description
code: `module.exports = {
description: 'My command.',
}`,
filename: 'some/path/command-object.ts',
},
{
// Already has a . at the end of the description
code: `module.exports = {
describe: 'My command.',
}`,
filename: 'another/command-object.ts',
},
{
// Boolean property, so should not report
code: `module.exports = {
describe: false,
};`,
filename: 'command-object.ts',
},
],
invalid: [
// With "describe" and single quotes
{
filename: 'some/path/command-object.ts',
code: `
const planCheckCommand: CommandModule<NxReleaseArgs, PlanCheckOptions> = {
command: 'plan:check',
describe:
'Ensure that all touched projects have an applicable version plan created for them',
builder: (yargs) => withAffectedOptions(yargs),
handler: async (args) => {
const release = await import('./plan-check');
const result = await release.releasePlanCheckCLIHandler(args);
process.exit(result);
},
};
`,
errors: [
{
messageId: 'validCommandDescription',
line: 4,
column: 11,
},
],
output: `
const planCheckCommand: CommandModule<NxReleaseArgs, PlanCheckOptions> = {
command: 'plan:check',
describe:
'Ensure that all touched projects have an applicable version plan created for them.',
builder: (yargs) => withAffectedOptions(yargs),
handler: async (args) => {
const release = await import('./plan-check');
const result = await release.releasePlanCheckCLIHandler(args);
process.exit(result);
},
};
`,
},
// With "description" and backticks
{
filename: 'some/path/command-object.ts',
code: `
const planCheckCommand: CommandModule<NxReleaseArgs, PlanCheckOptions> = {
command: 'plan:check',
description: \`Ensure that all touched projects have an applicable version plan created for them\`,
builder: (yargs) => withAffectedOptions(yargs),
handler: async (args) => {
const release = await import('./plan-check');
const result = await release.releasePlanCheckCLIHandler(args);
process.exit(result);
},
};
`,
errors: [
{
messageId: 'validCommandDescription',
line: 4,
column: 11,
},
],
output: `
const planCheckCommand: CommandModule<NxReleaseArgs, PlanCheckOptions> = {
command: 'plan:check',
description: \`Ensure that all touched projects have an applicable version plan created for them.\`,
builder: (yargs) => withAffectedOptions(yargs),
handler: async (args) => {
const release = await import('./plan-check');
const result = await release.releasePlanCheckCLIHandler(args);
process.exit(result);
},
};
`,
},
// With "description" and double quotes
{
filename: 'some/path/command-object.ts',
code: `
const planCheckCommand: CommandModule<NxReleaseArgs, PlanCheckOptions> = {
command: 'plan:check',
description: "Ensure that all touched projects have an applicable version plan created for them",
builder: (yargs) => withAffectedOptions(yargs),
handler: async (args) => {
const release = await import('./plan-check');
const result = await release.releasePlanCheckCLIHandler(args);
process.exit(result);
},
};
`,
errors: [
{
messageId: 'validCommandDescription',
line: 4,
column: 11,
},
],
output: `
const planCheckCommand: CommandModule<NxReleaseArgs, PlanCheckOptions> = {
command: 'plan:check',
description: "Ensure that all touched projects have an applicable version plan created for them.",
builder: (yargs) => withAffectedOptions(yargs),
handler: async (args) => {
const release = await import('./plan-check');
const result = await release.releasePlanCheckCLIHandler(args);
process.exit(result);
},
};
`,
},
],
});

View File

@ -0,0 +1,87 @@
/**
* This file sets you up with structure needed for an ESLint rule.
*
* It leverages utilities from @typescript-eslint to allow TypeScript to
* provide autocompletions etc for the configuration.
*
* Your rule's custom logic will live within the create() method below
* and you can learn more about writing ESLint rules on the official guide:
*
* https://eslint.org/docs/developer-guide/working-with-rules
*
* You can also view many examples of existing rules here:
*
* https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin/src/rules
*/
import { ASTUtils, ESLintUtils, TSESTree } from '@typescript-eslint/utils';
// NOTE: The rule will be available in ESLint configs as "@nx/workspace-valid-command-object"
export const RULE_NAME = 'valid-command-object';
export const rule = ESLintUtils.RuleCreator(() => __filename)({
name: RULE_NAME,
meta: {
type: 'problem',
fixable: 'code',
docs: {
description: `Ensures that commands contain valid descriptions in order to provide consistent --help output and generated documentation`,
},
schema: [],
messages: {
validCommandDescription:
'A command description should end with a . character for consistency',
},
},
defaultOptions: [],
create(context) {
if (
!context.physicalFilename.endsWith('command-object.ts') &&
!(
context.physicalFilename.includes('nx/src/command-line/') &&
// Ignore the examples file, those descriptions work differently
!context.physicalFilename.endsWith('examples.ts') &&
// Ignore spec files
!context.physicalFilename.endsWith('.spec.ts')
) &&
!context.physicalFilename.includes('packages/create-nx-workspace')
) {
return {};
}
return {
'Property > :matches(Identifier[name="describe"], Identifier[name="description"], TaggedTemplateExpression)':
(node: TSESTree.Identifier) => {
const propertyNode = node.parent as TSESTree.Property;
const stringToCheck =
(propertyNode.value.type === 'Literal' &&
typeof propertyNode.value.value !== 'boolean') ||
propertyNode.value.type === 'TemplateLiteral'
? ASTUtils.getStringIfConstant(propertyNode.value)
: null;
// String description already ends with a . character (or some other form of punctuation)
if (
!stringToCheck ||
// Call trim() to avoid issues with trailing whitespace
stringToCheck.trim().endsWith('.') ||
stringToCheck.trim().endsWith('!') ||
stringToCheck.trim().endsWith('?')
) {
return;
}
context.report({
messageId: 'validCommandDescription',
node: propertyNode,
fix: (fixer) => {
// We need to take the closing ' or " or ` into account when applying the . character
return fixer.insertTextAfterRange(
[propertyNode.value.range[0], propertyNode.value.range[1] - 1],
'.'
);
},
});
},
};
},
});