syntatis / version-cli
A simple PHP CLI tool for working with SemVer version strings
Requires
- php: ^7.4 || ^8.0
- beberlei/assert: ^3.3
- nikolaposa/version: ^4.1.1
- symfony/console: ^5.4 || ^6.0 || ^7.0
Requires (Dev)
- dealerdirect/phpcodesniffer-composer-installer: ^1.0
- nunomaduro/collision: ^5.11
- phpcompatibility/php-compatibility: ^9.3
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2.1
- phpstan/phpstan-beberlei-assert: ^2.0
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- phpunit/phpunit: ^9.6
- shipmonk/phpstan-rules: ^4.1
- squizlabs/php_codesniffer: ^3.0
- symfony/var-dumper: ^5.4
- syntatis/coding-standard: ^2.0
Suggests
- nunomaduro/collision: Provide better error rendering in the console
- symfony/var-dumper: Provide better debugging output
This package is auto-updated.
Last update: 2025-07-31 11:52:55 UTC
README
This is a simple command-line tool built with PHP that helps you work with SemVer (Semantic Versioning) strings. You can use it to check if a version string is valid, compare two versions to see which one is greater, or increase a version by major, minor, or patch levels.
Requirements
- PHP 7.4 or higher
- Composer
Installation
You can install it globally or locally using Composer:
composer global require syntatis/version-cli
Or, use as a development dependency in your project:
composer require --dev syntatis/version-cli
Usage
If you run it globally, you can use the version
command directly in your terminal:
version --help
If you installed it locally in your project, run it using the vendor binary:
vendor/bin/version --help
The command provides several options to work with version strings:
Command | Description | Usage |
---|---|---|
validate |
Validates the given version string against the SemVer specification. | version validate 1.0.0 |
increment |
Increments the version string by major, minor, or patch. | version increment 1.0.0 |
gt |
Compares two version strings to see if the first is greater than the second. | version gt 1.0.0 0.9.0 |
lt |
Compares two version strings to see if the first is less than the second. | version lt 1.0.0 0.9.0 |
eq |
Compares two version strings to see if they are equal. | version eq 1.0.0 1.0.0 |
The command supports both patterns with or without the v
prefix, so you can use 1.0.0
or v1.0.0
. For more details on each command, you can run:
version list