release

Orchestrate versioning and publishing of applications and libraries

Usage

nx release

Install nx globally to invoke the command directly using nx, or use npx nx, yarn nx, or pnpm nx.

Options

Shared OptionTypeDescription
--dry-runbooleanPreview the changes without updating files/creating releases (Default: false)
--groupsstringOne 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
--projectsstringProjects to run. (comma/space delimited project names and/or patterns)
--verbosebooleanPrints additional information about the commands (e.g., stack traces)
--versionbooleanShow version number

Subcommands

Base Command Options

Create a version and release for the workspace, generate a changelog, and optionally publish the packages

nx release [specifier]

Options

OptionTypeDescription
--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.
--helpbooleanShow help
--skip-publishbooleanSkip publishing by automatically answering no to the confirmation prompt for publishing
--specifierstringExact version or semver keyword to apply to the selected release group.
--versionbooleanShow version number
--yesbooleanAutomatically answer yes to the confirmation prompt for publishing

version

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

nx release version [specifier]

Options

OptionTypeDescription
--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-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 (Default: ``)
--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

changelog

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

nx release changelog [version]

Options

OptionTypeDescription
--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-remotestringAlternate git remote in the form {user}/{repo} on which to create the Github release (useful for testing) (Default: 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
--interactiveall, workspace, projectsInteractively 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-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 (Default: HEAD)
--versionstringThe version to create a Github release and changelog for

publish

Publish a versioned project to a registry

nx release publish

Options

OptionTypeDescription
--accesspublic, restrictedOverrides the access level of the published package. Unscoped packages cannot be set to restricted. See the npm publish documentation for more information.
--allboolean[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)
--excludestringExclude certain projects from being processed
--excludeTaskDependenciesbooleanSkips running dependent tasks first (Default: 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 (Default: false)
--nxIgnoreCyclesbooleanIgnore cycles in the task graph (Default: false)
--otpnumberA one-time password for publishing to a registry that requires 2FA
--output-styledynamic, static, stream, stream-without-prefixesDefines 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.
--parallelstringMax number of parallel processes [default is 3]
--projectsstringProjects 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
--skipNxCachebooleanRerun the tasks even when the results are available in the cache (Default: false)
--tagstringThe distribution tag to apply to the published package
--verbosebooleanPrints additional information about the commands (e.g., stack traces)
--versionbooleanShow 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

nx release plan [bump]

Options

OptionTypeDescription
--basestringBase of the current branch (usually main)
--bumpmajor, premajor, minor, preminor, patch, prepatch, prereleaseSemver keyword to use for the selected release group.
--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
--messagestringCustom message to use for the changelog entry
--onlyTouchedbooleanOnly include projects that have been affected by the current changes (Default: true)
--uncommittedbooleanUncommitted changes
--untrackedbooleanUntracked changes
--versionbooleanShow version number

plan:check

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

nx release plan:check

Options

OptionTypeDescription
--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