Skip to content

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:

Terminal window
nx add <packageSpecifier>

Options

OptionTypeDescriptionDefault
--helpbooleanShow help
--packageSpecifierstringThe 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.
--updatePackageScriptsbooleanUpdate package.json scripts with inferred targets. Defaults to true when the package is a core Nx plugin.
--verbosebooleanPrints additional information about the commands (e.g., stack traces).
--versionbooleanShow 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:

Terminal window
nx affected

Options

OptionTypeDescriptionDefault
--allboolean⚠️ Deprecated: Use nx run-many instead
--basestringBase of the current branch (usually main).
--batchbooleanRun task(s) in batches for executors which support batches.false
--configuration, -cstringThis is the configuration to use when performing tasks on projects.
--excludestringExclude certain projects from being processed.
--excludeTaskDependenciesbooleanSkips running dependent tasks first.false
--filesstringChange the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces.
--graphstringShow 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.
--headstringLatest commit of the current branch (usually HEAD).
--helpbooleanShow help
--nxBailbooleanStop command execution after the first failed task.false
--nxIgnoreCyclesbooleanIgnore cycles in the task graph.false
--outputStylestringDefines 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)
--parallelstringMax number of parallel processes [default is 3].
--runnerstringThis is the name of the tasks runner configured in nx.json.
--skipNxCache, --disableNxCachebooleanRerun the tasks even when the results are available in the cache.false
--skipRemoteCache, --disableRemoteCachebooleanDisables the remote cache.false
--skipSyncbooleanSkips running the sync generators associated with the tasks.false
--targets, --target, -tstringTasks to run for affected projects.
--tuibooleanEnable or disable the Nx Terminal UI.
--tuiAutoExitstringWhether 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.
--uncommittedbooleanUncommitted changes.
--untrackedbooleanUntracked changes.
--verbosebooleanPrints additional information about the commands (e.g., stack traces).
--versionbooleanShow version number

nx configure-ai-agents

Configure and update AI agent configurations for your workspace.

Usage:

Terminal window
nx configure-ai-agents

Options

OptionTypeDescriptionDefault
--agentsstringList of AI agents to set up. (choices: claude, codex, copilot, cursor, gemini)
--checkstringCheck 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)
--helpbooleanShow help
--interactivebooleanWhen false disables interactive input prompts for options.true
--verbosebooleanPrints additional information about the commands (e.g., stack traces).
--versionbooleanShow version number

nx connect

Connect workspace to Nx Cloud.

Usage:

Terminal window
nx connect

Options

OptionTypeDescriptionDefault
--generateTokenbooleanExplicitly asks for a token to be created, do not override existing tokens from Nx Cloud.
--helpbooleanShow help
--verbosebooleanPrints additional information about the commands (e.g., stack traces).
--versionbooleanShow version number

nx daemon

Prints information about the Nx Daemon process or starts a daemon process.

Usage:

Terminal window
nx daemon

Options

OptionTypeDescriptionDefault
--helpbooleanShow help
--startbooleanNo Descriptionfalse
--stopbooleanNo Descriptionfalse
--verbosebooleanPrints additional information about the commands (e.g., stack traces).
--versionbooleanShow version number

nx fix-ci

Fixes CI failures. This command is an alias for nx-cloud fix-ci.

Usage:

Terminal window
nx fix-ci [options]

Options

OptionTypeDescriptionDefault
--helpbooleanShow help.
--verbosebooleanPrints additional information about the commands (e.g., stack traces).
--versionbooleanShow version number

nx format:check

Check for un-formatted files.

Usage:

Terminal window
nx format:check

Options

OptionTypeDescriptionDefault
--allbooleanFormat all projects.
--basestringBase of the current branch (usually main).
--excludestringExclude certain projects from being processed.
--filesstringChange the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces.
--headstringLatest commit of the current branch (usually HEAD).
--helpbooleanShow help
--libs-and-appsbooleanFormat only libraries and applications files.
--projectsstringProjects to format (comma/space delimited).
--sort-root-tsconfig-pathsbooleanEnsure 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”.
--uncommittedbooleanUncommitted changes.
--untrackedbooleanUntracked changes.
--versionbooleanShow version number

nx format:write

Overwrite un-formatted files.

Usage:

Terminal window
nx format:write

Options

OptionTypeDescriptionDefault
--allbooleanFormat all projects.
--basestringBase of the current branch (usually main).
--excludestringExclude certain projects from being processed.
--filesstringChange the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces.
--headstringLatest commit of the current branch (usually HEAD).
--helpbooleanShow help
--libs-and-appsbooleanFormat only libraries and applications files.
--projectsstringProjects to format (comma/space delimited).
--sort-root-tsconfig-pathsbooleanEnsure 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”.
--uncommittedbooleanUncommitted changes.
--untrackedbooleanUntracked changes.
--versionbooleanShow version number

nx graph

Graph dependencies within workspace.

Usage:

Terminal window
nx graph

Options

OptionTypeDescriptionDefault
--affectedbooleanHighlight affected projects.
--basestringBase of the current branch (usually main).
--excludestringExclude certain projects from being processed.
--filestringOutput file (e.g. —file=output.json or —file=dep-graph.html).
--filesstringChange the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces.
--focusstringUse to show the project graph for a particular project and every node that is either an ancestor or a descendant.
--groupByFolderbooleanGroup projects by folder in the project graph.
--headstringLatest commit of the current branch (usually HEAD).
--helpbooleanShow help
--hoststringBind the project graph server to a specific ip address.
--openbooleanOpen the project graph in the browser.true
--portnumberBind the project graph server to a specific port.
--printbooleanPrint the project graph to stdout in the terminal.
--targetsstringThe target to show tasks for in the task graph.
--uncommittedbooleanUncommitted changes.
--untrackedbooleanUntracked changes.
--verbosebooleanPrints additional information about the commands (e.g., stack traces).
--versionbooleanShow version number
--viewstringChoose whether to view the projects or task graph. (choices: projects, tasks)projects
--watchbooleanWatch for changes to project graph and update in-browser.true

nx import

Import code and git history from another repository into this repository.

Usage:

Terminal window
nx import [sourceRepository] [destinationDirectory]

Options

OptionTypeDescriptionDefault
--depthnumberThe depth to clone the source repository (limit this for faster git clone).
--destinationDirectory, --destinationstringThe directory in the current workspace to import into.
--helpbooleanShow help
--interactivebooleanInteractive mode.true
--refstringThe branch from the source repository to import.
--sourceDirectory, --sourcestringThe directory in the source repository to import from.
--sourceRepositorystringThe remote URL of the source to import.
--verbosebooleanPrints additional information about the commands (e.g., stack traces).
--versionbooleanShow 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:

Terminal window
nx init

Options

OptionTypeDescriptionDefault
--aiAgentsstringList of AI agents to set up. (choices: claude, codex, copilot, cursor, gemini)
--forcebooleanForce the migration to continue and ignore custom webpack setup or uncommitted changes. Only for CRA projects.false
--helpbooleanShow help
--interactivebooleanWhen false disables interactive input prompts for options.true
--nxCloudbooleanSet up distributed caching with Nx Cloud.
--useDotNxInstallationbooleanInitialize an Nx workspace setup in the .nx directory of the current repository.false
--versionbooleanShow version number

nx list

Lists installed plugins, capabilities of installed plugins and other available plugins.

Usage:

Terminal window
nx list [plugin]

Options

OptionTypeDescriptionDefault
--helpbooleanShow help
--pluginstringThe name of an installed plugin to query.
--versionbooleanShow version number

nx login

Login to Nx Cloud. This command is an alias for nx-cloud login.

Usage:

Terminal window
nx login [nxCloudUrl]

Options

OptionTypeDescriptionDefault
--helpbooleanShow help.
--nxCloudUrlstringThe 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.
--verbosebooleanPrints additional information about the commands (e.g., stack traces).
--versionbooleanShow version number

nx logout

Logout from Nx Cloud. This command is an alias for nx-cloud logout.

Usage:

Terminal window
nx logout

Options

OptionTypeDescriptionDefault
--helpbooleanShow help.
--verbosebooleanPrints additional information about the commands (e.g., stack traces).
--versionbooleanShow version number

nx mcp

Starts the Nx MCP server.

Usage:

Terminal window
nx mcp

nx 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:

Terminal window
nx migrate [packageAndVersion]

Options

OptionTypeDescriptionDefault
--commitPrefixstringCommit prefix to apply to the commit for each migration, when —create-commits is enabled.chore: [nx migration]
--createCommits, -CbooleanAutomatically create a git commit after each migration runs.false
--excludeAppliedMigrationsbooleanExclude migrations that should have been applied on previous updates. To be used with —from.false
--fromstringUse 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”).
--helpbooleanShow help
--ifExistsbooleanRun migrations only if the migrations file exists, if not continues successfully.false
--interactivebooleanEnable prompts to confirm whether to collect optional package updates and migrations.false
--packageAndVersionstringThe target package and version (e.g, @nx/workspace@16.0.0).
--runMigrationsstringExecute migrations from a file (when the file isn’t provided, execute migrations from migrations.json).
--tostringUse 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”).
--verbosebooleanPrints additional information about the commands (e.g., stack traces).
--versionbooleanShow version number

nx record

Records a command execution for distributed task execution. This command is an alias for nx-cloud record.

Usage:

Terminal window
nx record [options]

Options

OptionTypeDescriptionDefault
--helpbooleanShow help.
--verbosebooleanPrints additional information about the commands (e.g., stack traces).
--versionbooleanShow version number

nx release

Orchestrate versioning and publishing of applications and libraries.

Usage:

Terminal window
nx release

Shared Options

OptionTypeDescriptionDefault
--dry-run, -dbooleanPreview the changes without updating files/creating releases.false
--groups, --group, -gstringOne or more release groups to target with the current command.
--helpbooleanShow help
--printConfigstringPrint the resolved nx release configuration that would be used for the current command and then exit.
--projects, -pstringProjects to run. (comma/space delimited project names and/or patterns).
--verbosebooleanPrints additional information about the commands (e.g., stack traces).
--versionbooleanShow version number

nx release changelog

Generate a changelog for one or more projects, and optionally push to Github.

Usage:

Terminal window
nx changelog [version]

Options

OptionTypeDescriptionDefault
--first-releasebooleanIndicates 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.
--fromstringThe 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-commitbooleanWhether or not to automatically commit the changes made by this command.
--git-commit-argsstringAdditional 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-messagestringCustom 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-pushbooleanWhether or not to automatically push the changes made by this command to the remote git repository.
--git-push-argsstringAdditional arguments to pass to the git push command invoked behind the scenes.
--git-remotestringAlternate git remote to push commits and tags to (can be useful for testing).origin
--git-tagbooleanWhether or not to automatically tag the changes made by this command.
--git-tag-argsstringAdditional arguments to pass to the git tag command invoked behind the scenes.
--git-tag-messagestringCustom git tag message to use when tagging the changes made by this command. This defaults to be the same value as the tag itself.
--helpbooleanShow help
--interactive, -istringInteractively 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-contentsbooleanWhether to overwrite the existing changelog contents instead of prepending to them.false
--resolve-version-plansstringHow 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-changesbooleanWhether or not to stage the changes made by this command. Always treated as true if git-commit is true.
--tostringThe git reference to use as the end of the changelog.HEAD
--versionstringThe 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:

Terminal window
nx plan [bump]

Options

OptionTypeDescriptionDefault
--basestringBase of the current branch (usually main).
--bumpstringSemver keyword to use for the selected release group. (choices: major, premajor, minor, preminor, patch, prepatch, prerelease)
--excludestringExclude certain projects from being processed.
--filesstringChange the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces.
--headstringLatest commit of the current branch (usually HEAD).
--helpbooleanShow help
--message, -mstringCustom message to use for the changelog entry.
--onlyTouchedbooleanOnly include projects that have been affected by the current changes.true
--uncommittedbooleanUncommitted changes.
--untrackedbooleanUntracked changes.
--versionbooleanShow version number

nx release plan:check

Ensure that all touched projects have an applicable version plan created for them.

Usage:

Terminal window
nx plan:check

Options

OptionTypeDescriptionDefault
--basestringBase of the current branch (usually main).
--excludestringExclude certain projects from being processed.
--filesstringChange the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces.
--headstringLatest commit of the current branch (usually HEAD).
--helpbooleanShow help
--uncommittedbooleanUncommitted changes.
--untrackedbooleanUntracked changes.
--versionbooleanShow version number

nx release publish

Publish a versioned project to a registry.

Usage:

Terminal window
nx publish

Options

OptionTypeDescriptionDefault
--accessstringOverrides 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)
--allboolean[deprecated] run-many runs all targets on all projects in the workspace if no projects are provided. This option is no longer required.true
--excludestringExclude certain projects from being processed.
--excludeTaskDependenciesbooleanSkips running dependent tasks first.false
--first-releasebooleanIndicates 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.
--graphstringShow 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.
--helpbooleanShow help
--nxBailbooleanStop command execution after the first failed task.false
--nxIgnoreCyclesbooleanIgnore cycles in the task graph.false
--otpnumberA one-time password for publishing to a registry that requires 2FA.
--outputStylestringDefines 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)
--parallelstringMax number of parallel processes [default is 3].
--projects, -pstringProjects to run. (comma/space delimited project names and/or patterns).
--registrystringThe registry to publish to.
--runnerstringThis is the name of the tasks runner configured in nx.json.
--skipNxCache, --disableNxCachebooleanRerun the tasks even when the results are available in the cache.false
--skipRemoteCache, --disableRemoteCachebooleanDisables the remote cache.false
--skipSyncbooleanSkips running the sync generators associated with the tasks.false
--tagstringThe distribution tag to apply to the published package.
--verbosebooleanPrints additional information about the commands (e.g., stack traces).
--versionbooleanShow version number

nx release version

Create a version and release for one or more applications and libraries.

Usage:

Terminal window
nx version [specifier]

Options

OptionTypeDescriptionDefault
--dockerVersionstringExact docker version to use, bypassing the version scheme logic. Warning: Docker support is experimental. Breaking changes may occur and not adhere to semver versioning.
--dockerVersionSchemestringExact 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-releasebooleanIndicates 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-commitbooleanWhether or not to automatically commit the changes made by this command.
--git-commit-argsstringAdditional 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-messagestringCustom 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-pushbooleanWhether or not to automatically push the changes made by this command to the remote git repository.
--git-push-argsstringAdditional arguments to pass to the git push command invoked behind the scenes.
--git-remotestringAlternate git remote to push commits and tags to (can be useful for testing).origin
--git-tagbooleanWhether or not to automatically tag the changes made by this command.
--git-tag-argsstringAdditional arguments to pass to the git tag command invoked behind the scenes.
--git-tag-messagestringCustom git tag message to use when tagging the changes made by this command. This defaults to be the same value as the tag itself.
--helpbooleanShow help
--preidstringThe 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.
--specifierstringExact version or semver keyword to apply to the selected release group.
--stage-changesbooleanWhether or not to stage the changes made by this command. Always treated as true if git-commit is true.
--versionbooleanShow version number

nx repair

Repair any configuration that is no longer supported by Nx.

Specifically, this will run every migration within the `nx` package
against the current repository. Doing so should fix any configuration
details left behind if the repository was previously updated to a new
Nx 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:

Terminal window
nx repair

Options

OptionTypeDescriptionDefault
--helpbooleanShow help
--verbosebooleanPrints additional information about the commands (e.g., stack traces).
--versionbooleanShow version number

nx report

Reports useful version numbers to copy into the Nx issue template.

Usage:

Terminal window
nx report

nx reset

Clears cached Nx artifacts and metadata about the workspace and shuts down the Nx Daemon.

Usage:

Terminal window
nx reset

Options

OptionTypeDescriptionDefault
--helpbooleanShow help
--onlyCachebooleanClears the Nx cache directory. This will remove all local cache entries for tasks, but will not affect the remote cache.
--onlyCloudbooleanResets the Nx Cloud client. NOTE: Does not clear the remote cache.
--onlyDaemonbooleanStops the Nx Daemon and clears its workspace data, it will be restarted fresh when the next Nx command is run.
--onlyWorkspaceDatabooleanClears the workspace data directory. Used by Nx to store cached data about the current workspace (e.g. partial results, incremental data, etc).
--versionbooleanShow 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:

Terminal window
nx run [project][:target][:configuration] [_..]

Options

OptionTypeDescriptionDefault
--batchbooleanRun task(s) in batches for executors which support batches.false
--configuration, -cstringThis is the configuration to use when performing tasks on projects.
--excludestringExclude certain projects from being processed.
--excludeTaskDependenciesbooleanSkips running dependent tasks first.false
--graphstringShow 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.
--nxBailbooleanStop command execution after the first failed task.false
--nxIgnoreCyclesbooleanIgnore cycles in the task graph.false
--outputStylestringDefines 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)
--parallelstringMax number of parallel processes [default is 3].
--projectstringTarget project.
--runnerstringThis is the name of the tasks runner configured in nx.json.
--skipNxCache, --disableNxCachebooleanRerun the tasks even when the results are available in the cache.false
--skipRemoteCache, --disableRemoteCachebooleanDisables the remote cache.false
--skipSyncbooleanSkips running the sync generators associated with the tasks.false
--tuibooleanEnable or disable the Nx Terminal UI.
--tuiAutoExitstringWhether 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.
--verbosebooleanPrints additional information about the commands (e.g., stack traces).
--versionbooleanShow version number

nx run-many

Run target for multiple listed projects.

Usage:

Terminal window
nx run-many

Options

OptionTypeDescriptionDefault
--allboolean[deprecated] run-many runs all targets on all projects in the workspace if no projects are provided. This option is no longer required.true
--batchbooleanRun task(s) in batches for executors which support batches.false
--configuration, -cstringThis is the configuration to use when performing tasks on projects.
--excludestringExclude certain projects from being processed.
--excludeTaskDependenciesbooleanSkips running dependent tasks first.false
--graphstringShow 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.
--helpbooleanShow help
--nxBailbooleanStop command execution after the first failed task.false
--nxIgnoreCyclesbooleanIgnore cycles in the task graph.false
--outputStylestringDefines 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)
--parallelstringMax number of parallel processes [default is 3].
--projects, -pstringProjects to run. (comma/space delimited project names and/or patterns).
--runnerstringThis is the name of the tasks runner configured in nx.json.
--skipNxCache, --disableNxCachebooleanRerun the tasks even when the results are available in the cache.false
--skipRemoteCache, --disableRemoteCachebooleanDisables the remote cache.false
--skipSyncbooleanSkips running the sync generators associated with the tasks.false
--targets, --target, -tstringTasks to run for affected projects.
--tuibooleanEnable or disable the Nx Terminal UI.
--tuiAutoExitstringWhether 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.
--verbosebooleanPrints additional information about the commands (e.g., stack traces).
--versionbooleanShow version number

nx show

Show information about the workspace (e.g., list of projects).

Usage:

Terminal window
nx show

Shared Options

OptionTypeDescriptionDefault
--helpbooleanShow help
--jsonbooleanOutput JSON.
--versionbooleanShow 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:

Terminal window
nx project [projectName]

Options

OptionTypeDescriptionDefault
--helpbooleanShow help
--openbooleanSet to false to prevent the browser from opening when using —web.
--projectName, -pstringThe project to show. If not provided, infers the project from the current working directory.
--verbosebooleanPrints additional information about the commands (e.g., stack traces).
--versionbooleanShow version number
--webbooleanShow project details in the browser. (default when interactive).

nx show projects

Show a list of projects in the workspace.

Usage:

Terminal window
nx projects

Options

OptionTypeDescriptionDefault
--affectedbooleanShow only affected projects.
--basestringBase of the current branch (usually main).
--excludestringExclude certain projects from being processed.
--filesstringChange the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces.
--headstringLatest commit of the current branch (usually HEAD).
--helpbooleanShow help
--projects, -pstringShow only projects that match a given pattern.
--sepstringOutputs projects with the specified seperator.
--typestringSelect only projects of the given type. (choices: app, lib, e2e)
--uncommittedbooleanUncommitted changes.
--untrackedbooleanUntracked changes.
--verbosebooleanPrints additional information about the commands (e.g., stack traces).
--versionbooleanShow version number
--withTarget, -tstringShow 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:

Terminal window
nx start-agent [options]

Options

OptionTypeDescriptionDefault
--helpbooleanShow help.
--verbosebooleanPrints additional information about the commands (e.g., stack traces).
--versionbooleanShow 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:

Terminal window
nx start-ci-run [options]

Options

OptionTypeDescriptionDefault
--helpbooleanShow help.
--verbosebooleanPrints additional information about the commands (e.g., stack traces).
--versionbooleanShow 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:

Terminal window
nx stop-all-agents [options]

Options

OptionTypeDescriptionDefault
--helpbooleanShow help.
--verbosebooleanPrints additional information about the commands (e.g., stack traces).
--versionbooleanShow version number

nx sync

Sync the workspace files by running all the sync generators.

Usage:

Terminal window
nx sync

Options

OptionTypeDescriptionDefault
--helpbooleanShow help
--verbosebooleanPrints additional information about the commands (e.g., stack traces).
--versionbooleanShow version number

nx sync:check

Check that no changes are required after running all sync generators.

Usage:

Terminal window
nx sync:check

Options

OptionTypeDescriptionDefault
--helpbooleanShow help
--verbosebooleanPrints additional information about the commands (e.g., stack traces).
--versionbooleanShow 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:

Terminal window
nx view-logs

nx watch

Watch for changes within projects, and execute commands.

Usage:

Terminal window
nx watch

Options

OptionTypeDescriptionDefault
--allbooleanWatch all projects.
--helpbooleanShow help
--includeDependentProjects, -dbooleanWhen watching selected projects, include dependent projects as well.
--initialRun, -ibooleanRun the command once before watching for changes.false
--projects, -pstringProjects to watch (comma/space delimited).
--verbosebooleanRun watch mode in verbose mode, where commands are logged before execution.
--versionbooleanShow version number

Getting Help

You can get help for any command by adding the --help flag:

Terminal window
nx <command> --help