A CLI tool and GitHub Action that automatically bumps versions in package.json and other JSON files based on conventional commits. Supports monorepos.
Bump Please is also available as a GitHub Action. See bump-please-action for usage and documentation.
The action exposes commit-sha and version as outputs, so downstream steps can reference the bump commit.
npm install -g bump-please
# or
yarn global add bump-pleaseBump Please automatically analyzes your git commits since the last tag and determines the appropriate version bump based loosely on Conventional Commits specification.
bump-please bumpThe tool will:
- Analyze commits since the last git tag
- Determine the version bump type (patch, minor, or major)
- Update version numbers in your
package.jsonfiles - Create a git tag with the new version
- Commit and push the changes
By default, the root package.json will allways be modified. Add additional configuration to also bump the version of monorepo packages. All package.json files will get the same version.
Bump Please uses conventional commit messages to determine the version bump type:
Patch versions are used for bug fixes and non-breaking changes. Commits with these prefixes trigger a patch bump:
fix:- Bug fixesperf:- Performance improvementsrefactor:- Code refactoringdocs:- Documentation changes
Examples:
git commit -m "fix: resolve memory leak in cache"
git commit -m "perf: optimize database queries"
git commit -m "refactor: simplify authentication logic"
git commit -m "docs: update API documentation"Minor versions are used for new features that don't break existing functionality. Commits with this prefix trigger a minor bump:
feat:- New features
Examples:
git commit -m "feat: add user authentication"
git commit -m "feat(api): implement rate limiting"
git commit -m "feat: add dark mode support"Major versions are used for breaking changes. Commits that include breaking change indicators trigger a major bump:
BREAKING CHANGE:orBREAKING CHANGES:in the commit body
Examples:
git commit -m "feat: redesign API" -m "BREAKING CHANGE: API endpoints have changed"
git commit -m "refactor: update data model
BREAKING CHANGES: Database schema has been restructured"When multiple commit types are present, Bump Please uses the highest priority:
- Major (breaking changes) - highest priority
- Minor (new features)
- Patch (fixes/improvements) - lowest priority
For example, if you have both feat: and fix: commits, the version will be bumped as minor.
Configuration is optional. Bump Please resolves config in this order and logs which source it used:
bump-please-config.jsonin the project root (or the path passed via--config-file/CONFIG_FILE).bumpPleaseConfigkey in your rootpackage.json— used only when the config file above is missing.- Empty config (
{}) — used when neither of the above is present. The rootpackage.jsonversion is still bumped; no additional package files are updated.
Create a bump-please-config.json file in your project root:
{
"packages": [
{
"path": "./packages/package-a"
},
{
"path": "./packages/package-b"
}
]
}Or, to avoid an extra file, embed the same config under a bumpPleaseConfig key in your root package.json:
{
"name": "my-app",
"version": "1.0.0",
"bumpPleaseConfig": {
"packages": [
{ "path": "./packages/package-a" },
{ "path": "./packages/package-b" }
]
}
}If both a bump-please-config.json file and a bumpPleaseConfig key exist, the file wins — the package.json key is ignored.
packages(optional): Array of package paths to update versions for (monorepo support)dryRun(optional): Iftrue, shows what would be changed without making changesdisableGitWrites(optional): Iftrue, skips git commits, tags, and pushesgitBranch(optional): Branch to push to (defaults to current branch)gitCommitterName(optional): Name for git commitsgitCommitterEmail(optional): Email for git commitsgithubToken(optional): GitHub token for authentication (can also useGITHUB_TOKENenv var)
You can specify arbitrary JSON files to update instead of (or in addition to) package.json. This is useful for projects like Expo apps that store version information in app.json.
Example: Bumping Expo app.json version
For an Expo app, the version is typically stored at expo.version in app.json. Configure it like this:
{
"packages": [
{
"path": ".",
"jsonFileName": "app.json",
"jsonPropertyPath": "expo.version"
}
]
}This will update the version in your app.json file:
{
"expo": {
"name": "MyApp",
"version": "1.2.3"
}
}You can combine this with regular package.json updates by including multiple package entries in your configuration.
bump-please bump [options]Options:
--dry-run- Preview changes without applying them--config-file <path>- Path to config file (default:bump-please-config.json)--disable-git-writes- Skip git operations--github-token <token>- GitHub token for authentication--gh-token <token>- Alternative GitHub token flag--git-branch <branch>- Branch to push to--git-committer-name <name>- Git committer name--git-committer-email <email>- Git committer email--root-package-json <path>- Path to root package.json (default:./package.json)
You can also configure the tool using environment variables:
DRY_RUN- Enable dry run modeCONFIG_FILE- Path to config fileDISABLE_GIT_WRITES- Disable git writesGITHUB_TOKENorGH_TOKEN- GitHub tokenGIT_BRANCH- Git branchGIT_COMMITTER_NAME- Git committer nameGIT_COMMITTER_EMAIL- Git committer emailROOT_PACKAGE_JSON- Path to root package.json
Preview what changes would be made:
bump-please bump --dry-runFor a monorepo with multiple packages:
{
"packages": [
{ "path": "./packages/core" },
{ "path": "./packages/ui" },
{ "path": "./packages/utils" }
]
}- Tag Detection: Finds the last semantic version tag (e.g.,
v1.2.3) - Commit Analysis: Analyzes all commits since the last tag
- Version Calculation: Determines the next version based on conventional commits
- Package Updates: Updates version in root
package.jsonand configured packages - Git Operations: Creates a commit, tags it, and pushes to the remote repository
If no previous tag exists, the tool uses the version from your root package.json as the starting point.
yarn
yarn dlx @yarnpkg/sdks vscode
yarn build
./bump-please/dist/cli.js bump