lpm version
Bump package.json version with npm-compatible increments, JSON plans, and optional git commit/tag.
lpm version patchBumps 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 writingBump values
| Value | Effect |
|---|---|
patch | Stable patch bump. From a prerelease, releases the same version (1.2.3-rc.1 -> 1.2.3). |
minor | Next minor, patch reset to 0. |
major | Next major, minor and patch reset to 0. |
prepatch | Next patch prerelease (1.2.3 -> 1.2.4-0). |
preminor | Next minor prerelease (1.2.3 -> 1.3.0-0). |
premajor | Next major prerelease (1.2.3 -> 2.0.0-0). |
prerelease | Increment 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:
- verifies the current directory is inside a git worktree
- verifies
git status --porcelainis clean - verifies the target tag name is valid and does not already exist
- writes
package.json - runs
git add package.json - commits with the message template
- 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
| Flag | Description |
|---|---|
--dry-run | Print the plan without writing files, committing, or tagging. |
--json | Emit a structured plan with success, dry_run, git_tag_version, commit, tag, and plan. |
--no-git-tag-version | Update 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 orchestrationlpm publish— publish the package after a version bumplpm run— run a package script namedversion