Nx Commands
The Nx command line has various subcommands and options to help you manage your Nx workspace and run tasks efficiently. Below is a complete reference for all available commands and their options. You can run nx —help to view all available options.
Available Commands
nx add
Install a plugin and initialize it.
Usage:
nx add <packageSpecifier>Options
| Option | Type | Description | Default |
|---|---|---|---|
--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 |
nx affected
Run target for affected projects. Affected projects are projects that have been changed and projects that depend on the changed projects. See https://nx.dev/ci/features/affected for more details.
Usage:
nx affectedOptions
| Option | Type | Description | Default |
|---|---|---|---|
--all | boolean | ⚠️ Deprecated: Use nx run-many instead | |
--base | string | Base of the current branch (usually main). | |
--batch | boolean | Run task(s) in batches for executors which support batches. | false |
--configuration, -c | 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. | 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. | false |
--nxIgnoreCycles | boolean | Ignore cycles in the task graph. | false |
--outputStyle | string | Defines how Nx emits outputs tasks logs. tui: enables the Nx Terminal UI, recommended for local development environments. dynamic-legacy: use dynamic-legacy 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 for local development environments where tui is not supported. 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. (choices: dynamic-legacy, dynamic, tui, static, stream, stream-without-prefixes) | |
--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, --disableNxCache | boolean | Rerun the tasks even when the results are available in the cache. | false |
--skipRemoteCache, --disableRemoteCache | boolean | Disables the remote cache. | false |
--skipSync | boolean | Skips running the sync generators associated with the tasks. | false |
--targets, --target, -t | string | Tasks to run for affected projects. | |
--tui | boolean | Enable or disable the Nx Terminal UI. | |
--tuiAutoExit | string | Whether or not to exit the TUI automatically after all tasks finish, and after how long. If set to true, the TUI will exit immediately. If set to false the TUI will not automatically exit. If set to a number, an interruptible countdown popup will be shown for that many seconds before the TUI exits. | |
--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 |
nx configure-ai-agents
Configure and update AI agent configurations for your workspace.
Usage:
nx configure-ai-agentsOptions
| Option | Type | Description | Default |
|---|---|---|---|
--agents | string | List of AI agents to set up. (choices: claude, codex, copilot, cursor, gemini) | |
--check | string | Check agent configurations. Use —check or —check=outdated to check only configured agents, or —check=all to include unconfigured/partial configurations. Does not make any changes. (choices: outdated, all) | |
--help | boolean | Show help | |
--interactive | boolean | When false disables interactive input prompts for options. | true |
--verbose | boolean | Prints additional information about the commands (e.g., stack traces). | |
--version | boolean | Show version number |
nx connect
Connect workspace to Nx Cloud.
Usage:
nx connectOptions
| Option | Type | Description | Default |
|---|---|---|---|
--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 |
nx daemon
Prints information about the Nx Daemon process or starts a daemon process.
Usage:
nx daemonOptions
| Option | Type | Description | Default |
|---|---|---|---|
--help | boolean | Show help | |
--start | boolean | No Description | false |
--stop | boolean | No Description | false |
--verbose | boolean | Prints additional information about the commands (e.g., stack traces). | |
--version | boolean | Show version number |
nx fix-ci
Fixes CI failures. This command is an alias for nx-cloud fix-ci.
Usage:
nx fix-ci [options]Options
| Option | Type | Description | Default |
|---|---|---|---|
--help | boolean | Show help. | |
--verbose | boolean | Prints additional information about the commands (e.g., stack traces). | |
--version | boolean | Show version number |
nx format:check
Check for un-formatted files.
Usage:
nx format:checkOptions
| Option | Type | Description | Default |
|---|---|---|---|
--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). | |
--sort-root-tsconfig-paths | boolean | Ensure the workspace’s tsconfig compilerOptions.paths are sorted. Warning: This will cause comments in the tsconfig to be lost. The default value is “false” unless NX_FORMAT_SORT_TSCONFIG_PATHS is set to “true”. | |
--uncommitted | boolean | Uncommitted changes. | |
--untracked | boolean | Untracked changes. | |
--version | boolean | Show version number |
nx format:write
Overwrite un-formatted files.
Usage:
nx format:writeOptions
| Option | Type | Description | Default |
|---|---|---|---|
--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). | |
--sort-root-tsconfig-paths | boolean | Ensure the workspace’s tsconfig compilerOptions.paths are sorted. Warning: This will cause comments in the tsconfig to be lost. The default value is “false” unless NX_FORMAT_SORT_TSCONFIG_PATHS is set to “true”. | |
--uncommitted | boolean | Uncommitted changes. | |
--untracked | boolean | Untracked changes. | |
--version | boolean | Show version number |
nx graph
Graph dependencies within workspace.
Usage:
nx graphOptions
| Option | Type | Description | Default |
|---|---|---|---|
--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. | |
--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 | |
--host | string | Bind the project graph server to a specific ip address. | |
--open | boolean | Open the project graph in the browser. | 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 | string | Choose whether to view the projects or task graph. (choices: projects, tasks) | projects |
--watch | boolean | Watch for changes to project graph and update in-browser. | true |
nx import
Import code and git history from another repository into this repository.
Usage:
nx import [sourceRepository] [destinationDirectory]Options
| Option | Type | Description | Default |
|---|---|---|---|
--depth | number | The depth to clone the source repository (limit this for faster git clone). | |
--destinationDirectory, --destination | string | The directory in the current workspace to import into. | |
--help | boolean | Show help | |
--interactive | boolean | Interactive mode. | true |
--ref | string | The branch from the source repository to import. | |
--sourceDirectory, --source | string | The directory in the source repository to import from. | |
--sourceRepository | string | The remote URL of the source to import. | |
--verbose | boolean | Prints additional information about the commands (e.g., stack traces). | |
--version | boolean | Show version number |
nx init
Adds Nx to any type of workspace. It installs nx, creates an nx.json configuration file and optionally sets up remote caching. For more info, check https://nx.dev/recipes/adopting-nx.
Usage:
nx initOptions
| Option | Type | Description | Default |
|---|---|---|---|
--aiAgents | string | List of AI agents to set up. (choices: claude, codex, copilot, cursor, gemini) | |
--force | boolean | Force the migration to continue and ignore custom webpack setup or uncommitted changes. Only for CRA projects. | false |
--help | boolean | Show help | |
--interactive | boolean | When false disables interactive input prompts for options. | 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. | false |
--version | boolean | Show version number |
nx list
Lists installed plugins, capabilities of installed plugins and other available plugins.
Usage:
nx list [plugin]Options
| Option | Type | Description | Default |
|---|---|---|---|
--help | boolean | Show help | |
--plugin | string | The name of an installed plugin to query. | |
--version | boolean | Show version number |
nx login
Login to Nx Cloud. This command is an alias for nx-cloud login.
Usage:
nx login [nxCloudUrl]Options
| Option | Type | Description | Default |
|---|---|---|---|
--help | boolean | Show help. | |
--nxCloudUrl | string | The Nx Cloud URL of the instance you are trying to connect to. If no positional argument is provided, this command will connect to your configured Nx Cloud instance by default. | |
--verbose | boolean | Prints additional information about the commands (e.g., stack traces). | |
--version | boolean | Show version number |
nx logout
Logout from Nx Cloud. This command is an alias for nx-cloud logout.
Usage:
nx logoutOptions
| Option | Type | Description | Default |
|---|---|---|---|
--help | boolean | Show help. | |
--verbose | boolean | Prints additional information about the commands (e.g., stack traces). | |
--version | boolean | Show version number |
nx mcp
Starts the Nx MCP server.
Usage:
nx mcpnx migrate
Creates a migrations file or runs migrations from the migrations file.
- Migrate packages and create migrations.json (e.g., nx migrate @nx/workspace@latest)
- Run migrations (e.g., nx migrate —run-migrations=migrations.json). Use flag —if-exists to run migrations only if the migrations file exists.
Usage:
nx migrate [packageAndVersion]Options
| Option | Type | Description | Default |
|---|---|---|---|
--commitPrefix | string | Commit prefix to apply to the commit for each migration, when —create-commits is enabled. | chore: [nx migration] |
--createCommits, -C | boolean | Automatically create a git commit after each migration runs. | false |
--excludeAppliedMigrations | boolean | Exclude migrations that should have been applied on previous updates. To be used with —from. | 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. | false |
--interactive | boolean | Enable prompts to confirm whether to collect optional package updates and migrations. | 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 |
nx record
Records a command execution for distributed task execution. This command is an alias for nx-cloud record.
Usage:
nx record [options]Options
| Option | Type | Description | Default |
|---|---|---|---|
--help | boolean | Show help. | |
--verbose | boolean | Prints additional information about the commands (e.g., stack traces). | |
--version | boolean | Show version number |
nx release
Orchestrate versioning and publishing of applications and libraries.
Usage:
nx releaseShared Options
| Option | Type | Description | Default |
|---|---|---|---|
--dry-run, -d | boolean | Preview the changes without updating files/creating releases. | false |
--groups, --group, -g | 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, -p | 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 |
nx release changelog
Generate a changelog for one or more projects, and optionally push to Github.
Usage:
nx changelog [version]Options
| Option | Type | Description | Default |
|---|---|---|---|
--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. | |
--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-push | boolean | Whether or not to automatically push the changes made by this command to the remote git repository. | |
--git-push-args | string | Additional arguments to pass to the git push command invoked behind the scenes. | |
--git-remote | string | Alternate git remote to push commits and tags to (can be useful for testing). | 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, -i | string | 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) | |
--replace-existing-contents | boolean | Whether to overwrite the existing changelog contents instead of prepending to them. | false |
--resolve-version-plans | string | How to resolve version plans for changelog generation, defaults to resolving all version plan files available on disk. (choices: all, using-from-and-to) | all |
--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. | HEAD |
--version | string | The version to create a Github release and changelog for. |
nx release 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.
Usage:
nx plan [bump]Options
| Option | Type | Description | Default |
|---|---|---|---|
--base | string | Base of the current branch (usually main). | |
--bump | string | Semver keyword to use for the selected release group. (choices: major, premajor, minor, preminor, patch, prepatch, prerelease) | |
--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, -m | string | Custom message to use for the changelog entry. | |
--onlyTouched | boolean | Only include projects that have been affected by the current changes. | true |
--uncommitted | boolean | Uncommitted changes. | |
--untracked | boolean | Untracked changes. | |
--version | boolean | Show version number |
nx release plan:check
Ensure that all touched projects have an applicable version plan created for them.
Usage:
nx plan:checkOptions
| Option | Type | Description | Default |
|---|---|---|---|
--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 |
nx release publish
Publish a versioned project to a registry.
Usage:
nx publishOptions
| Option | Type | Description | Default |
|---|---|---|---|
--access | string | Overrides the access level of the published package. Unscoped packages cannot be set to restricted. See the npm publish documentation for more information. (choices: public, restricted) | |
--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. | true |
--exclude | string | Exclude certain projects from being processed. | |
--excludeTaskDependencies | boolean | Skips running dependent tasks first. | 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. | false |
--nxIgnoreCycles | boolean | Ignore cycles in the task graph. | false |
--otp | number | A one-time password for publishing to a registry that requires 2FA. | |
--outputStyle | string | Defines how Nx emits outputs tasks logs. tui: enables the Nx Terminal UI, recommended for local development environments. dynamic-legacy: use dynamic-legacy 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 for local development environments where tui is not supported. 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. (choices: dynamic-legacy, dynamic, tui, static, stream, stream-without-prefixes) | |
--parallel | string | Max number of parallel processes [default is 3]. | |
--projects, -p | 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, --disableNxCache | boolean | Rerun the tasks even when the results are available in the cache. | false |
--skipRemoteCache, --disableRemoteCache | boolean | Disables the remote cache. | false |
--skipSync | boolean | Skips running the sync generators associated with the tasks. | 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 |
nx release version
Create a version and release for one or more applications and libraries.
Usage:
nx version [specifier]Options
| Option | Type | Description | Default |
|---|---|---|---|
--dockerVersion | string | Exact docker version to use, bypassing the version scheme logic. Warning: Docker support is experimental. Breaking changes may occur and not adhere to semver versioning. | |
--dockerVersionScheme | string | Exact docker version scheme to apply to the selected release group. Warning: Docker support is experimental. Breaking changes may occur and not adhere to semver versioning. | |
--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-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-push | boolean | Whether or not to automatically push the changes made by this command to the remote git repository. | |
--git-push-args | string | Additional arguments to pass to the git push command invoked behind the scenes. | |
--git-remote | string | Alternate git remote to push commits and tags to (can be useful for testing). | 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 | |
--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. | “ |
--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 |
nx repair
Repair any configuration that is no longer supported by Nx.
Specifically, this will run every migration within the `nx` packageagainst the current repository. Doing so should fix any configurationdetails left behind if the repository was previously updated to a newNx version without using `nx migrate`.
If your repository has only ever updated to newer versions of Nx with`nx migrate`, running `nx repair` should do nothing.Usage:
nx repairOptions
| Option | Type | Description | Default |
|---|---|---|---|
--help | boolean | Show help | |
--verbose | boolean | Prints additional information about the commands (e.g., stack traces). | |
--version | boolean | Show version number |
nx report
Reports useful version numbers to copy into the Nx issue template.
Usage:
nx reportnx reset
Clears cached Nx artifacts and metadata about the workspace and shuts down the Nx Daemon.
Usage:
nx resetOptions
| Option | Type | Description | Default |
|---|---|---|---|
--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 and clears its workspace data, 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 |
nx run
Run a target for a project (e.g., nx run myapp:serve:production).
You can also use the infix notation to run a target:(e.g., nx serve myapp --configuration=production)
You can skip the use of Nx cache by using the --skip-nx-cache option.Usage:
nx run [project][:target][:configuration] [_..]Options
| Option | Type | Description | Default |
|---|---|---|---|
--batch | boolean | Run task(s) in batches for executors which support batches. | false |
--configuration, -c | 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. | 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. | false |
--nxIgnoreCycles | boolean | Ignore cycles in the task graph. | false |
--outputStyle | string | Defines how Nx emits outputs tasks logs. tui: enables the Nx Terminal UI, recommended for local development environments. dynamic-legacy: use dynamic-legacy 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 for local development environments where tui is not supported. 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. (choices: tui, dynamic, dynamic-legacy, static, stream, stream-without-prefixes) | |
--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, --disableNxCache | boolean | Rerun the tasks even when the results are available in the cache. | false |
--skipRemoteCache, --disableRemoteCache | boolean | Disables the remote cache. | false |
--skipSync | boolean | Skips running the sync generators associated with the tasks. | false |
--tui | boolean | Enable or disable the Nx Terminal UI. | |
--tuiAutoExit | string | Whether or not to exit the TUI automatically after all tasks finish, and after how long. If set to true, the TUI will exit immediately. If set to false the TUI will not automatically exit. If set to a number, an interruptible countdown popup will be shown for that many seconds before the TUI exits. | |
--verbose | boolean | Prints additional information about the commands (e.g., stack traces). | |
--version | boolean | Show version number |
nx run-many
Run target for multiple listed projects.
Usage:
nx run-manyOptions
| Option | Type | Description | Default |
|---|---|---|---|
--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. | true |
--batch | boolean | Run task(s) in batches for executors which support batches. | false |
--configuration, -c | 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. | 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. | false |
--nxIgnoreCycles | boolean | Ignore cycles in the task graph. | false |
--outputStyle | string | Defines how Nx emits outputs tasks logs. tui: enables the Nx Terminal UI, recommended for local development environments. dynamic-legacy: use dynamic-legacy 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 for local development environments where tui is not supported. 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. (choices: dynamic-legacy, dynamic, tui, static, stream, stream-without-prefixes) | |
--parallel | string | Max number of parallel processes [default is 3]. | |
--projects, -p | 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, --disableNxCache | boolean | Rerun the tasks even when the results are available in the cache. | false |
--skipRemoteCache, --disableRemoteCache | boolean | Disables the remote cache. | false |
--skipSync | boolean | Skips running the sync generators associated with the tasks. | false |
--targets, --target, -t | string | Tasks to run for affected projects. | |
--tui | boolean | Enable or disable the Nx Terminal UI. | |
--tuiAutoExit | string | Whether or not to exit the TUI automatically after all tasks finish, and after how long. If set to true, the TUI will exit immediately. If set to false the TUI will not automatically exit. If set to a number, an interruptible countdown popup will be shown for that many seconds before the TUI exits. | |
--verbose | boolean | Prints additional information about the commands (e.g., stack traces). | |
--version | boolean | Show version number |
nx show
Show information about the workspace (e.g., list of projects).
Usage:
nx showShared Options
| Option | Type | Description | Default |
|---|---|---|---|
--help | boolean | Show help | |
--json | boolean | Output JSON. | |
--version | boolean | Show version number |
nx show project
Shows resolved project configuration for a given project. If run within a project directory and no project name is provided, the project is inferred from the current working directory.
Usage:
nx project [projectName]Options
| Option | Type | Description | Default |
|---|---|---|---|
--help | boolean | Show help | |
--open | boolean | Set to false to prevent the browser from opening when using —web. | |
--projectName, -p | string | The project to show. If not provided, infers the project from the current working directory. | |
--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). |
nx show projects
Show a list of projects in the workspace.
Usage:
nx projectsOptions
| Option | Type | Description | Default |
|---|---|---|---|
--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, -p | string | Show only projects that match a given pattern. | |
--sep | string | Outputs projects with the specified seperator. | |
--type | string | Select only projects of the given type. (choices: app, lib, e2e) | |
--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, -t | string | Show only projects that have a specific target. |
nx start-agent
Starts a new agent for distributed task execution. This command is an alias for nx-cloud start-agent.
Usage:
nx start-agent [options]Options
| Option | Type | Description | Default |
|---|---|---|---|
--help | boolean | Show help. | |
--verbose | boolean | Prints additional information about the commands (e.g., stack traces). | |
--version | boolean | Show version number |
nx start-ci-run
Starts a new CI run for distributed task execution. This command is an alias for nx-cloud start-ci-run.
Usage:
nx start-ci-run [options]Options
| Option | Type | Description | Default |
|---|---|---|---|
--help | boolean | Show help. | |
--verbose | boolean | Prints additional information about the commands (e.g., stack traces). | |
--version | boolean | Show version number |
nx stop-all-agents
Terminates all dedicated agents associated with this CI pipeline execution. This command is an alias for nx-cloud stop-all-agents.
Usage:
nx stop-all-agents [options]Options
| Option | Type | Description | Default |
|---|---|---|---|
--help | boolean | Show help. | |
--verbose | boolean | Prints additional information about the commands (e.g., stack traces). | |
--version | boolean | Show version number |
nx sync
Sync the workspace files by running all the sync generators.
Usage:
nx syncOptions
| Option | Type | Description | Default |
|---|---|---|---|
--help | boolean | Show help | |
--verbose | boolean | Prints additional information about the commands (e.g., stack traces). | |
--version | boolean | Show version number |
nx sync:check
Check that no changes are required after running all sync generators.
Usage:
nx sync:checkOptions
| Option | Type | Description | Default |
|---|---|---|---|
--help | boolean | Show help | |
--verbose | boolean | Prints additional information about the commands (e.g., stack traces). | |
--version | boolean | Show version number |
nx view-logs
Enables you to view and interact with the logs via the advanced analytic UI from Nx Cloud to help you debug your issue. To do this, Nx needs to connect your workspace to Nx Cloud and upload the most recent run details. Only the metrics are uploaded, not the artefacts.
Usage:
nx view-logsnx watch
Watch for changes within projects, and execute commands.
Usage:
nx watchOptions
| Option | Type | Description | Default |
|---|---|---|---|
--all | boolean | Watch all projects. | |
--help | boolean | Show help | |
--includeDependentProjects, -d | boolean | When watching selected projects, include dependent projects as well. | |
--initialRun, -i | boolean | Run the command once before watching for changes. | false |
--projects, -p | 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 |
Getting Help
You can get help for any command by adding the --help flag:
nx <command> --help