A generic CLI tool for managing version tags across multiple Go repositories.
- Generic Package Discovery: Automatically discovers Go packages across multiple repositories
- Custom Tag Naming: Support for custom tag naming conventions via configuration
- Interactive Setup: Guided configuration for new packages with sensible defaults
- Version Management: Support for major, minor, and patch version updates
- Configuration Persistence: Remembers your tag naming preferences
- Multi-Repository Support: Works across any number of Go repositories
- Git Integration: Automatic tag creation and pushing
Install the latest version directly from GitHub:
go install github.com/gambitier/tag-manager@latest
This will install the tag-manager
binary to your $GOPATH/bin
directory (usually ~/go/bin
). Make sure $GOPATH/bin
is in your $PATH
.
To update to the latest version:
go install github.com/gambitier/tag-manager@latest
For development and building from source:
-
Clone the repository:
git clone https://github.com/gambitier/tag-manager.git cd tag-manager
-
Install dependencies:
go mod tidy
-
Build the application:
make build # or go build -o build/tag-manager
-
(Optional) Add to your PATH:
sudo cp build/tag-manager /usr/local/bin/tag-manager
tag-manager list
This command will scan for Go modules in the current directory and its subdirectories, displaying all discovered packages.
tag-manager update
The tool will guide you through the entire process interactively:
- Package Discovery: Automatically scan for Go packages in the current directory and its subdirectories
- Package Selection: Choose from the discovered packages
- Configuration Setup: Configure tag naming convention (first time only)
- Version Selection: Choose version type (major/minor/patch)
- Confirmation: Review and confirm the tag update
First-time setup for a package:
tag-manager update
# 1. Select package from discovered list
# 2. Choose tag format (default or custom)
# 3. Select version type
# 4. Confirm tag creation
Subsequent updates:
tag-manager update
# 1. Select package (configuration remembered)
# 2. Select version type
# 3. Confirm tag creation
The tool uses a configuration file (~/.tag-manager.yaml
) to store package-specific settings:
- Tag Format: Custom tag naming conventions per package
- Default Settings: Global defaults for new packages
- Package Settings: Individual package configurations
Default Tag Format: {package-name}/v{major}.{minor}.{patch}
Custom Format Examples:
{package-name}-v{major}.{minor}.{patch}
v{major}.{minor}.{patch}
{package-name}/{major}.{minor}.{patch}
major
: Increments the major version (e.g., v1.2.3 → v2.0.0)minor
: Increments the minor version (e.g., v1.2.3 → v1.3.0)patch
: Increments the patch version (e.g., v1.2.3 → v1.2.4)
When building from source, you can use the provided Makefile for easier development:
# Show all available commands
make help
# Build the application
make build
# Run the tag manager (interactive)
make run
# List packages
make list
# Show configuration
make config
# Clean build artifacts
make clean
Note: For end users who installed via go install
, use the tag-manager
command directly:
tag-manager update
- Package Discovery: Scans the current directory and its subdirectories for
go.mod
files to discover Go packages - Package Selection: User selects from discovered packages
- Configuration Check: Checks if package has custom tag format configuration
- Interactive Setup: For new packages, guides user through tag format configuration
- Version Selection: User chooses version type (major/minor/patch)
- Tag Calculation: Calculates new version based on current tag and selected type
- Confirmation: Shows current and new tags for user confirmation
- Git Operations: Creates and pushes the new git tag
The tool supports flexible tag formats through configuration:
Default Format: {package-name}/v{major}.{minor}.{patch}
Examples:
utils/v1.2.3
cache/v2.0.0
Custom Formats:
utils-v1.2.3
(using{package-name}-v{major}.{minor}.{patch}
)v1.2.3
(usingv{major}.{minor}.{patch}
)utils/1.2.3
(using{package-name}/{major}.{minor}.{patch}
)
The tool creates a configuration file at ~/.tag-manager.yaml
to store your preferences:
packages:
github.com/example/package:
module_path: github.com/example/package1
tag_format: '{version}'
use_default: false
github.com/example/package2:
module_path: github.com/example/package2
tag_format: '{package-name}/v{major}.{minor}.{patch}'
use_default: false
defaults:
tag_format: '{package-name}/v{major}.{minor}.{patch}'