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]Options
Section titled “Options”| Flag | Default | Description |
|---|---|---|
-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, --verbose | false | Also 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-unstable | false | Skip 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 tag | Start of the commit range (tag or SHA). |
--to <ref> | HEAD | End of the commit range (tag or SHA). |
Parser options
Section titled “Parser options”These override how commits are parsed (normally provided by the preset — rarely needed):
| Flag | Description |
|---|---|
-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. |
Examples
Section titled “Examples”Recommend a bump
Section titled “Recommend a bump”conventional-recommended-bump -p conventionalcommitsA feat is present, so the next release is a minor:
minorExplain the recommendation
Section titled “Explain the recommendation”--verbose (-v) prints why:
conventional-recommended-bump -p conventionalcommits -vminorReason: There are 0 BREAKING CHANGES and 1 featuresDifferent histories, different bumps
Section titled “Different histories, different bumps”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 CHANGEconventional-recommended-bump -p conventionalcommits# → major
# History with only fixes / perfconventional-recommended-bump -p conventionalcommits# → patchMonorepos: tag prefixes and paths
Section titled “Monorepos: tag prefixes and paths”Read package-specific tags and scope the commits to one directory:
# Tags like "api-v1.1.0", commits touching packages/apiconventional-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/apiA specific range
Section titled “A specific range”conventional-recommended-bump -p conventionalcommits --from v1.0.0 --to v1.1.0Using a config file instead of a preset
Section titled “Using a config file instead of a preset”Point --config (-g) at a script that exports the rules. A preset factory already returns them:
import createPreset from 'conventional-changelog-conventionalcommits'
export default createPreset()conventional-recommended-bump -g ./bump.config.js