rhapsodic/pbump
Composer 安装命令:
composer require rhapsodic/pbump
包简介
CLI tool for semantic release versioning and git tagging
README 文档
README
pbump is a CLI tool for semver releases in PHP projects with automatic release commit creation and git tagging.
Features
- bump the version manually (
patch,minor,major,as-is) or by conventional commits (next); - read the current version from
composer.jsonor the latest git tag; - update
composer.jsonwhen the version source is set tocomposer; - run in
dry-runmode without making changes; - optionally release with unrelated uncommitted files while committing only
composer.json; - work interactively through a menu or non-interactively in CI.
Requirements
- PHP
^8.2 - Git
Installation
composer require --dev rhapsodic/pbump
After installation, the binary will be available as vendor/bin/pbump.
Quick Start
Preview what will happen:
php vendor/bin/pbump --dry-run --type=next
Create a patch release without interactive confirmation:
php vendor/bin/pbump --type=patch --yes
Show the current version:
php vendor/bin/pbump --version
Show help:
php vendor/bin/pbump --help
How a Release Works
During a normal pbump run:
- it determines the current version;
- it calculates the target version;
- it updates
composer.jsonwhen needed; - it creates a
chore: release vX.Y.Zcommit; - it creates a git tag;
- it pushes the current branch and tag.
By default, the tag is named vX.Y.Z, but you can disable tagging or provide a custom tag name.
By default, pbump requires a clean working tree. If you need to release while unrelated files are modified, use
--allow-dirty or set "allowDirty": true; in that mode pbump updates composer.json, commits only
composer.json, and leaves the other files untouched.
Release Types
patch-X.Y.Z -> X.Y.(Z+1)minor-X.Y.Z -> X.(Y+1).0major-X.Y.Z -> (X+1).0.0as-is- keep the current versionnext- calculate the bump from conventional commitsconventional- alias fornext
Version Source
The --version-source flag supports three modes:
auto- usecomposer.json.versionfirst, and fall back to the latest git tag if it is missing;composer- always read the version fromcomposer.json.versionand update it during release;tag- always read the version from the latest git tag;composer.jsonis not modified.
If there are no tags yet and the source is tag, the current version is treated as 0.0.0.
The latest tag must contain a semver version at the end of the name, for example v1.2.3 or release-1.2.3.
Configuration via .pbump.config.json
You can create a .pbump.config.json file in the project root with default values:
{
"type": "next",
"versionSource": "auto",
"tag": true,
"push": true,
"yes": false,
"quiet": false,
"allowDirty": false
}
Supported keys:
typedryRuntagpushyesquietversionSourceallowDirty
CLI arguments take precedence over .pbump.config.json.
tag can be:
true- create the standardvX.Y.Ztag;false- do not create a tag;- a string - create a tag with the provided name.
Main Options
-h,--help- show help-v,--version- print the current version--dry-run- show the plan without making changes--type=<type>- explicitly set the release type--version-source=<source>- choose the version source:auto,composer,tag-t,--tag[=<name>]- create a tag, optionally with a custom name--no-tag- do not create a tag-p,--push- push using the current git upstream--no-push- do not push-y,--yes- skip confirmation-q,--quiet- hide the summary--allow-dirty- allow unrelated uncommitted files and commit onlycomposer.json
Interactive and CI Behavior
If --type is not provided and input is interactive, pbump will show a release type selection menu.
For non-interactive runs, it is best to always pass:
php vendor/bin/pbump --type=next --yes
Otherwise, the tool will not be able to ask for confirmation before creating a release.
Development and Tests
Run linter:
composer lint
Run static analysis:
composer analyse
Run tests:
composer test
Format code:
composer format
Run the entrypoint locally without a Composer bin proxy:
php scripts/release.php --help
License
rhapsodic/pbump 适用场景与选型建议
rhapsodic/pbump 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 124 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 05 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「git」 「composer」 「semver」 「release」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 rhapsodic/pbump 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 rhapsodic/pbump 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 rhapsodic/pbump 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Easily manage git hooks in your composer config
PHP Semantic Versioning Parser and Comparator
Converts SemVer version (like Composer packages) into integer version with operators. Helps managing versions: store, compare, sort and retrive by conditions.
A decent, standards-compliant, Semantic Versioning (SemVer) parser and library
MediaWiki extension that allows embedding external content, specified by URL, into your wiki pages
Nagios plugin to verify a git repository.
统计信息
- 总下载量: 124
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 51
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-05-06