Automated version bumping tool with git integration for semantic versioning workflows
npx @tessl/cli install tessl/npm-bumpp@9.11.0bumpp is an automated version bumping tool that streamlines software release workflows. It provides both a CLI and programmatic API for semantic version management, file updates, git operations (commit/tag/push), and monorepo support. Originally forked from version-bump-prompt, bumpp enhances the experience with interactive prompts, conventional commits, and extensive configuration options.
npm install bumppimport {
versionBump,
versionBumpInfo,
defineConfig,
loadBumpConfig,
bumpConfigDefaults
} from "bumpp";
// Types
import type {
VersionBumpOptions,
VersionBumpResults,
VersionBumpProgress,
ReleaseType
} from "bumpp";For CommonJS:
const {
versionBump,
versionBumpInfo,
defineConfig,
loadBumpConfig,
bumpConfigDefaults
} = require("bumpp");import { versionBump } from "bumpp";
// Interactive version bumping (prompts user)
const result = await versionBump();
// Explicit version bump
const result = await versionBump("patch");
// Full configuration
const result = await versionBump({
release: "minor",
commit: true,
tag: true,
push: true,
files: ["package.json", "src/version.ts"]
});
console.log(`Bumped from ${result.currentVersion} to ${result.newVersion}`);bumpp is built around several key components:
versionBump() and versionBumpInfo() functions for version managementdefineConfig() helper and defaultsCore version bumping functionality with multiple operation modes including interactive prompts, explicit version specification, and full configuration control. Includes information functions for dry-run operations.
function versionBump(): Promise<VersionBumpResults>;
function versionBump(release: string): Promise<VersionBumpResults>;
function versionBump(options: VersionBumpOptions): Promise<VersionBumpResults>;
function versionBumpInfo(): Promise<Operation>;
function versionBumpInfo(release: string): Promise<Operation>;
function versionBumpInfo(options: VersionBumpOptions): Promise<Operation>;
interface VersionBumpResults {
release?: ReleaseType;
currentVersion: string;
newVersion: string;
commit: string | false;
tag: string | false;
updatedFiles: string[];
skippedFiles: string[];
}
// Note: Operation is an internal type returned by versionBumpInfo()
// See version-bumping.md for full Operation interface details
interface Operation {
readonly results: VersionBumpResults;
readonly state: Readonly<{
currentVersion: string;
newVersion: string;
}>;
}Configuration system supporting file-based configuration, environment overrides, and programmatic configuration with type-safe defaults.
function defineConfig(config: Partial<VersionBumpOptions>): Partial<VersionBumpOptions>;
function loadBumpConfig(
overrides?: Partial<VersionBumpOptions>,
cwd?: string
): Promise<VersionBumpOptions>;
const bumpConfigDefaults: VersionBumpOptions;Semantic versioning system with extended release types and conventional commit support.
type ReleaseType =
| "major" | "minor" | "patch"
| "premajor" | "preminor" | "prepatch" | "prerelease"
| "next" | "conventional";Command-line interface providing the bumpp executable for terminal-based version bumping workflows with interactive prompts and comprehensive options.
Note: CLI functions are internal implementation details and not part of the public programmatic API. Use the bumpp command directly or the main API functions above.
interface VersionBumpOptions {
/** Version string or release type (e.g., "1.2.3", "patch", "major") */
release?: string;
/** Current version to bump from (auto-detected if not provided) */
currentVersion?: string;
/** Prerelease identifier (e.g., "alpha", "beta") */
preid?: string;
/** Create git commit with optional custom message */
commit?: boolean | string;
/** Create git tag with optional custom format */
tag?: boolean | string;
/** Sign git commit and tag with GPG/SSH key */
sign?: boolean;
/** Push git commit and tag to remote */
push?: boolean;
/** Run npm install after version bump */
install?: boolean;
/** Include all files in git commit (--all flag) */
all?: boolean;
/** Skip git working directory checks */
noGitCheck?: boolean;
/** Prompt for confirmation before executing */
confirm?: boolean;
/** Bypass git commit hooks (--no-verify) */
noVerify?: boolean;
/** Files to update with new version */
files?: string[];
/** Working directory for operations */
cwd?: string;
/** CLI interface configuration */
interface?: boolean | InterfaceOptions;
/** Skip npm version lifecycle scripts */
ignoreScripts?: boolean;
/** Progress callback for operation updates */
progress?: (progress: VersionBumpProgress) => void;
/** Custom command or function to execute before commit */
execute?: string | ((config: Operation) => void | PromiseLike<void>);
/** Enable recursive bumping for monorepos */
recursive?: boolean;
/** Print recent commit history */
printCommits?: boolean;
/** Custom version provider function */
customVersion?: (currentVersion: string, semver: typeof import('semver')) => Promise<string | void> | string | void;
}interface VersionBumpProgress extends VersionBumpResults {
event: ProgressEvent;
script?: NpmScript;
}
enum ProgressEvent {
FileUpdated = "file updated",
FileSkipped = "file skipped",
GitCommit = "git commit",
GitTag = "git tag",
GitPush = "git push",
NpmScript = "npm script"
}
enum NpmScript {
PreVersion = "preversion",
Version = "version",
PostVersion = "postversion"
}