Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 48 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,17 @@ go install github.com/flaticols/bump@latest

```bash
# In your git repository
bump # Bumps patch version (e.g., 1.2.3 -> 1.2.4)
bump major # Bumps major version (e.g., 1.2.3 -> 2.0.0)
bump minor # Bumps minor version (e.g., 1.2.3 -> 1.3.0)
bump patch # Bumps patch version (e.g., 1.2.3 -> 1.2.4)
bump # Bumps patch version (e.g., v1.2.3 -> v1.2.4)
bump major # Bumps major version (e.g., v1.2.3 -> v2.0.0)
bump minor # Bumps minor version (e.g., v1.2.3 -> v1.3.0)
bump patch # Bumps patch version (e.g., v1.2.3 -> v1.2.4)

# Monorepo: specify package name as last argument
bump pkg/x # Bumps patch for pkg/x (e.g., pkg/x/v1.2.3 -> pkg/x/v1.2.4)
bump major pkg/x # Bumps major for pkg/x (e.g., pkg/x/v1.2.3 -> pkg/x/v2.0.0)
bump minor services/api # Works with any prefix structure

# Other commands
bump undo # Removes the latest semver git tag
```

Expand All @@ -42,6 +49,8 @@ bump undo # Removes the latest semver git tag
--local, -l If local is set, bump will not error if no remotes are found
--brave, -b If brave is set, bump will not ask any questions (default: false)
--no-color Disable colorful output (default: false)
--json Output a single JSON object to stdout
--prefix Tag prefix to use for monorepo support (e.g., 'pkg/x')
--version Print version information
```

Expand Down Expand Up @@ -78,6 +87,40 @@ $ bump --brave
• tag v1.2.4 pushed
```

## Monorepo Support

`bump` supports monorepos where each package has its own version tags with prefixes. Simply specify the package name as the last argument:

```bash
# Bump version for a specific package in a monorepo
bump pkg/x # Bumps patch version (e.g., pkg/x/v1.2.3 -> pkg/x/v1.2.4)
bump major pkg/x # Bumps major version (e.g., pkg/x/v1.2.3 -> pkg/x/v2.0.0)
bump minor pkg/x # Bumps minor version (e.g., pkg/x/v1.2.3 -> pkg/x/v1.3.0)

# Different packages in the same repo can have different versions
bump pkg/y # Works independently of pkg/x tags
bump services/api # Can use any prefix structure
bump major libs/utils # Works with all version parts

# You can also use the --prefix flag for backward compatibility
bump --prefix pkg/x # Same as: bump pkg/x
```

The package name is used exactly as provided - if you want `pkg/x/foo/v1.0.0`, use `bump pkg/x/foo`.

Example output:
```bash
$ bump major pkg/x
• on default branch: main
• no uncommitted changes
• no remote changes
• no unpushed changes
• no new remote tags
• bump tag pkg/x/v1.2.3 => pkg/x/v2.0.0
• tag pkg/x/v2.0.0 created
• tag pkg/x/v2.0.0 pushed
```

## Features

- Automatically detects and increments from the latest git tag
Expand All @@ -88,3 +131,4 @@ $ bump --brave
- Provides colorful terminal output with status indicators
- Support for brave mode to bypass warnings and continue operations
- Allows removing the latest tag with the `undo` command
- Monorepo support with custom tag prefixes (e.g., `pkg/name/vX.X.X`)
Loading