LPM CLI

lpm version

Bump package.json version with npm-compatible increments, JSON plans, and optional git commit/tag.

lpm version patch

Bumps the current package's package.json version. By default, LPM writes the manifest, commits it, and creates a git tag just like npm version, but with stricter release safety: the git tree must be clean before commit/tag, and exact versions must move forward.

The built-in command wins over a package script named version. To run that script, use lpm run version.

Examples

lpm version patch                         # 1.2.3 -> 1.2.4, commit, tag v1.2.4
lpm version minor --message "release %s"  # commit message: release 1.3.0
lpm version prepatch                      # 1.2.3 -> 1.2.4-0
lpm version prerelease                    # 1.2.4-0 -> 1.2.4-1
lpm version 2.0.0                         # exact forward version
lpm version patch --no-git-tag-version    # edit package.json only
lpm version patch --dry-run --json        # print the plan without writing

Bump values

ValueEffect
patchStable patch bump. From a prerelease, releases the same version (1.2.3-rc.1 -> 1.2.3).
minorNext minor, patch reset to 0.
majorNext major, minor and patch reset to 0.
prepatchNext patch prerelease (1.2.3 -> 1.2.4-0).
preminorNext minor prerelease (1.2.3 -> 1.3.0-0).
premajorNext major prerelease (1.2.3 -> 2.0.0-0).
prereleaseIncrement the prerelease number, or start the next patch prerelease from a stable version.
<exact>Set an exact semver version, if it is greater than the current version.

Git behavior

With the default git mode, lpm version:

  1. verifies the current directory is inside a git worktree
  2. verifies git status --porcelain is clean
  3. verifies the target tag name is valid and does not already exist
  4. writes package.json
  5. runs git add package.json
  6. commits with the message template
  7. creates a tag

Use --no-git-tag-version when you want only the manifest edit. --dry-run prints the same version plan without writing, committing, or tagging.

Flags

FlagDescription
--dry-runPrint the plan without writing files, committing, or tagging.
--jsonEmit a structured plan with success, dry_run, git_tag_version, commit, tag, and plan.
--no-git-tag-versionUpdate package.json only.
--tag-prefix <PREFIX>Prefix for the git tag. Defaults to v; the resulting tag must be accepted by git tag and cannot start with -.
-m, --message <TEXT>Commit message. %s is replaced with the new version. Defaults to v%s.

Plus the global flags.

See also

  • lpm release — workspace release planning and publish orchestration
  • lpm publish — publish the package after a version bump
  • lpm run — run a package script named version