Skip to content

CLI

The conventional-recommended-bump binary reads the commits since your last tag and prints the recommended release type — major, minor, or patch — to stdout. It needs a preset (--preset) or a config file (--config) to know the rules. See Introduction for installation.

conventional-recommended-bump [options]
FlagDefaultDescription
-p, --preset <name>Preset whose rules decide the bump. Required unless --config is given.
-g, --config <path>Path to a config script exporting whatBump (and optionally tags, commits, parser).
-v, --verbosefalseAlso print the reasoning behind the recommendation.
-t, --tag-prefix <prefix>Tag prefix to consider when reading tags.
-l, --lerna-package <name>Recommend a bump for a Lerna package, reading name@1.0.0-style tags.
--skip-unstablefalseSkip unstable tags, e.g. x.x.x-alpha.1, x.x.x-rc.2.
--commit-path <path>Only consider commits that touch a specific directory.
--from <ref>last semver tagStart of the commit range (tag or SHA).
--to <ref>HEADEnd of the commit range (tag or SHA).

These override how commits are parsed (normally provided by the preset — rarely needed):

FlagDescription
-h, --header-pattern <regex>Regex to match the commit header.
-c, --header-correspondence <list>Comma-separated names for the header pattern’s capture groups.
-r, --reference-actions <list>Comma-separated keywords that reference issues.
-i, --issue-prefixes <list>Comma-separated issue prefixes.
-n, --note-keywords <list>Comma-separated keywords for notes (e.g. BREAKING CHANGE).
-f, --field-pattern <regex>Regex to match other commit fields.
--revert-pattern <regex>Regex to detect revert commits.
--revert-correspondence <list>Comma-separated names for the revert pattern’s capture groups.
--merge-pattern <regex>Regex to detect merge commits.
conventional-recommended-bump -p conventionalcommits

A feat is present, so the next release is a minor:

minor

--verbose (-v) prints why:

conventional-recommended-bump -p conventionalcommits -v
minor
Reason: There are 0 BREAKING CHANGES and 1 features

The recommendation depends on the commits in range — a breaking change makes it a major, while only fixes or perf changes make it a patch:

# History with a BREAKING CHANGE
conventional-recommended-bump -p conventionalcommits
# → major
# History with only fixes / perf
conventional-recommended-bump -p conventionalcommits
# → patch

Read package-specific tags and scope the commits to one directory:

# Tags like "api-v1.1.0", commits touching packages/api
conventional-recommended-bump -p conventionalcommits -t "api-v" --commit-path packages/api
# Lerna-style tags like "api@1.1.0"
conventional-recommended-bump -p conventionalcommits -l api --commit-path packages/api
conventional-recommended-bump -p conventionalcommits --from v1.0.0 --to v1.1.0

Point --config (-g) at a script that exports the rules. A preset factory already returns them:

bump.config.js
import createPreset from 'conventional-changelog-conventionalcommits'
export default createPreset()
conventional-recommended-bump -g ./bump.config.js