Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/nrwl/nx/llms.txt

Use this file to discover all available pages before exploring further.

nx release is a set of subcommands for managing the full release lifecycle: bumping versions, generating changelogs, and publishing to a registry.
nx release [specifier] [options]      # full release workflow
nx release version [specifier]        # version only
nx release changelog <version>        # changelog only
nx release publish                    # publish only
nx release plan [bump]                # create a version plan
nx release plan:check                 # verify version plans exist

Subcommands

Runs version bumping, changelog generation, and optionally publishing in a single command.
nx release
nx release minor
nx release --dry-run
nx release --first-release
Positional argument
specifier
string
Exact version or semver keyword to apply (e.g., major, minor, patch, prerelease, or 1.2.3).
Options
--preid
string
Prerelease identifier to append when using prerelease as the specifier, or when using conventional commits (e.g., alpha, beta).
--yes
boolean
Automatically answer yes to the publish confirmation prompt. Alias: -y. Mutually exclusive with --skip-publish.
--skip-publish
boolean
Skip publishing by automatically answering no to the publish confirmation. Mutually exclusive with --yes.
--otp
number
One-time password for publishing to a registry that requires 2FA.
--first-release
boolean
Indicates this is the first release for the selected release group. Uses the version on disk as a fallback when the current version cannot be determined, and skips checking for existing tags or packages.
Bump the version of one or more projects without running changelog or publish steps.
nx release version minor
nx release version 2.0.0
nx release version --dry-run
Positional argument
specifier
string
Exact version or semver keyword (e.g., major, minor, patch, 1.2.3).
Options
--preid
string
Prerelease identifier (e.g., alpha, beta).
--stage-changes
boolean
Stage the changes made by this command. Useful when combining with changelog generation.
--git-commit
boolean
Automatically commit the changes made by this command.
--git-commit-message
string
Custom commit message. Use {version} as a placeholder for the version.
--git-commit-args
string
Additional arguments to pass to git commit.
--git-tag
boolean
Automatically create a git tag after versioning.
--git-tag-message
string
Custom message for the git tag.
--git-push
boolean
Automatically push commits and tags to the remote repository.
--git-remote
string
default:"origin"
The git remote to push to.
--first-release
boolean
Indicates this is the first release for the selected release group.
Generate a changelog for one or more projects and optionally create a GitHub/GitLab release.
nx release changelog 2.0.0
nx release changelog 2.0.0 --from=v1.0.0
nx release changelog 2.0.0 --interactive=all
Positional argument
version
string
required
The version to generate the changelog for.
Options
--from
string
Git ref to use as the start of the changelog range. Defaults to the latest matching tag.
--to
string
default:"HEAD"
Git ref to use as the end of the changelog range.
--interactive
string
Open changelogs in your editor before applying. Choices: all, workspace, projects. Alias: -i.
--replace-existing-contents
boolean
default:"false"
Overwrite the existing changelog file contents instead of prepending to them.
--resolve-version-plans
string
default:"all"
How to resolve version plan files for changelog generation. Choices: all, using-from-and-to.
--first-release
boolean
Indicates this is the first release; skips checking for existing git tags.
Publish versioned projects to a package registry.
nx release publish
nx release publish --registry=https://registry.npmjs.org
nx release publish --tag=next
nx release publish --dry-run
Options
--registry
string
The registry URL to publish to.
--tag
string
The distribution tag to apply to the published package (e.g., latest, next, beta).
--access
string
Access level for the published package. Choices: public, restricted. Unscoped packages cannot be set to restricted.
--otp
number
One-time password for registries that require 2FA.
--first-release
boolean
Skip checking for the existence of the package before publishing.
Create a version plan file specifying the desired semver bump and a changelog entry for one or more projects or groups.
nx release plan minor
nx release plan patch --message="Fix memory leak in cache layer"
Positional argument
bump
string
Semver keyword. Choices: major, premajor, minor, preminor, patch, prepatch, prerelease.
Options
--message
string
Custom message to use as the changelog entry. Alias: -m.
--only-touched
boolean
default:"true"
Only include projects affected by current changes.
Verify that all touched projects have an applicable version plan file. Exits with a non-zero code if any are missing.
nx release plan:check
nx release plan:check --base=origin/main

Global release options

These options apply to all nx release subcommands.
--dry-run
boolean
default:"false"
Preview changes without updating files, creating releases, or publishing packages. Alias: -d.
--verbose
boolean
Print additional information about the release process.
--groups
string
One or more release groups to target (comma-separated). Defined in nx.json. Aliases: --group, -g. Mutually exclusive with --projects.
--projects
string
Comma or space-separated project names or patterns to target. Alias: -p. Mutually exclusive with --groups.
--print-config
string
Print the resolved nx release configuration for the current command and exit.

Examples

nx release --dry-run
nx release

Release groups

Release groups let you version and publish different subsets of your workspace independently. Define groups in nx.json:
{
  "release": {
    "groups": {
      "frontend": {
        "projects": ["myapp", "ui-lib"]
      },
      "backend": {
        "projects": ["api", "data-access"]
      }
    }
  }
}
Then target a group with:
nx release version minor --groups=frontend

Build docs developers (and LLMs) love