{"id":17061800,"url":"https://github.com/phlak/semver-cli","last_synced_at":"2025-04-12T18:12:47.051Z","repository":{"id":45177530,"uuid":"61960030","full_name":"PHLAK/SemVer-CLI","owner":"PHLAK","description":"Command line tool for managing semantic versioning within a project.","archived":false,"fork":false,"pushed_at":"2024-02-20T22:51:51.000Z","size":150,"stargazers_count":5,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T18:12:39.735Z","etag":null,"topics":["cli","semantic-versioning","semver","semver-cli","versioning"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/phlak/semver-cli","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PHLAK.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":"PHLAK","patreon":"PHLAK","custom":"https://paypal.me/ChrisKankiewicz"}},"created_at":"2016-06-25T20:17:34.000Z","updated_at":"2024-06-19T16:04:55.000Z","dependencies_parsed_at":"2024-02-20T23:31:52.755Z","dependency_job_id":"8b8a2569-ff34-4c7c-b528-070445b84a2a","html_url":"https://github.com/PHLAK/SemVer-CLI","commit_stats":{"total_commits":83,"total_committers":3,"mean_commits":"27.666666666666668","dds":0.03614457831325302,"last_synced_commit":"eacb6d2b1c67d8cae37bb804fefb77dd156e2b1b"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHLAK%2FSemVer-CLI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHLAK%2FSemVer-CLI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHLAK%2FSemVer-CLI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHLAK%2FSemVer-CLI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PHLAK","download_url":"https://codeload.github.com/PHLAK/SemVer-CLI/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248610341,"owners_count":21132919,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","semantic-versioning","semver","semver-cli","versioning"],"created_at":"2024-10-14T10:48:13.515Z","updated_at":"2025-04-12T18:12:47.009Z","avatar_url":"https://github.com/PHLAK.png","language":"PHP","readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"semver-cli.svg\" alt=\"SemVer CLI\" width=\"50%\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/PHLAK/SemVer-CLI/discussions\"\u003e\u003cimg src=\"https://img.shields.io/badge/Join_the-Community-7b16ff.svg?style=for-the-badge\" alt=\"Join our Community\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/users/PHLAK/sponsorship\"\u003e\u003cimg src=\"https://img.shields.io/badge/Become_a-Sponsor-cc4195.svg?style=for-the-badge\" alt=\"Become a Sponsor\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://paypal.me/ChrisKankiewicz\"\u003e\u003cimg src=\"https://img.shields.io/badge/Make_a-Donation-006bb6.svg?style=for-the-badge\" alt=\"One-time Donation\"\u003e\u003c/a\u003e\n    \u003cbr\u003e\n    \u003ca href=\"https://packagist.org/packages/PHLAK/SemVer-CLI\"\u003e\u003cimg src=\"https://img.shields.io/packagist/v/PHLAK/SemVer-CLI.svg?style=flat-square\" alt=\"Latest Stable Version\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://packagist.org/packages/PHLAK/SemVer-CLI\"\u003e\u003cimg src=\"https://img.shields.io/packagist/dt/PHLAK/SemVer-CLI.svg?style=flat-square\" alt=\"Total Downloads\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/PHLAK/SemVer-CLI/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/PHLAK/SemVer-CLI.svg?style=flat-square\" alt=\"License\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://travis-ci.com/PHLAK/SemVer-CLI\"\u003e\u003cimg src=\"https://img.shields.io/travis/com/PHLAK/SemVer-CLI.svg?style=flat-square\" alt=\"Build Status\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://styleci.io/repos/61960030\"\u003e\u003cimg src=\"https://styleci.io/repos/61960030/shield?branch=master\u0026style=flat-square\" alt=\"StyleCI\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    Command line tool for managing \u003ca href=\"http://semver.org\"\u003esemantic versioning\u003c/a\u003e for a project\n    \u003cbr\u003e\n    Created by \u003ca href=\"https://www.ChrisKankiewicz.com\"\u003eChris Kankiewicz\u003c/a\u003e (\u003ca href=\"https://twitter.com/PHLAK\"\u003e@PHLAK\u003c/a\u003e)\n\u003c/p\u003e\n\n---\n\nRequirements\n------------\n\n  - [PHP](https://php.net) \u003e= 7.2\n\nInstallation\n------------\n\nThe SemVer CLI can be installed via [Composer](https://getcomposer.org) \nper-project or globally.\n\n#### Per-project\n\n    composer require phlak/semver-cli\n\nWhen installed to a projcet the `semver` tool is installed to the project's\n`vendor/bin` directory.\n\n\u003e ℹ️ It is recommended to add `vendor/bin` to your `PATH` environment variable \n\u003e when installing within a project. Otherwise you will have to call the command \n\u003e with a relative path (i.e. `vendor/bin/semver [arguments]`) every time.\n\n#### Globally\n\n    composer global require phlak/semver-cli\n\nWhen required globally the `semver` tool will be installed to the global \n`${COMOPSER_HOME}/vendor/bin` directory.\n\n\u003e ℹ️ You should add `${COMOPSER_HOME}/vendor/bin` to your `PATH` environment \n\u003e variable when installing globally. If you don't you will have to specify the \n\u003e full installation path with every call call.\n\nUsage\n-----\n\n#### Initialization\n\nTo begin, you must initialize semantic versioning within a directory.\n\n    $ semver initialize\n\nThis initializes the version to `0.1.0` by creating a `VERSION` file containing \nthe version in the current directory.\n\n#### Initialize a Specific Version\n\nTo initialize to a specific version, pass the version as an argument to the \n`initialize` command.\n\n    $ semver initialize 1.3.37\n\n#### Initializing Incomplete Versions\n\nSometimes you may need to initialize semantic versioning with an incomplete \nversion. By default the `initialize` command requires a valid semantic version \nstring. If you want to allow the command to make a \"best guess\" attempt you can\ndo so with the `--parse` option.\n\n    $ semver initialize --parse 1.2\n\n#### Setting Version Values\n\nAfter initialization you can set (override) the complete version with the \n`set:version` command.\n\n    $ semver set:version 1.3.37\n\nAlternately, you may set individual values.\n\n    $ semver set:major 1\n    $ semver set:minor 3\n    $ semver set:patch 37\n    $ semver set:pre-release beta.5\n    $ semver set:build 007\n\n\u003e ℹ️ Setting certain values may affect other values\n\u003e   - Setting the `major` value will reset the `minor` and `patch` values to `0`.\n\u003e   - Setting the `minor` value will only reset the `patch` value to `0`\n\u003e   - Setting the the `major`, `minor` or `patch` value will also clear the \n\u003e     `pre-release` and `build` values\n\n#### Clearing Values\n\nYou may clear the `pre-release` or `build` values with the `clear` commands.\n\n    $ semver clear:build\n    $ semver clear:pre-release\n\n#### Retrieving Values\n\nAt any point after initialization you may get the full version.\n\n    $ semver get:version\n\nTo get the version prefixed with `v` (i.e. `v1.3.37`) use the `--prefix` option.\n    \n    $ semver get:version --prefix\n\nYou may also retrieve individual values.\n\n    $ semver get:major\n    $ semver get:minor\n    $ semver get:patch\n    $ semver get:pre-release\n    $ semver get:build\n\nIf the `pre-release` and `build` values are unset they will return no output by\ndefault. To force output add the `--verbose` option.\n\n    $ semver get:pre-release --verbose\n    $ semver get:build --verbose\n\n#### Incrementing the Version\n\nYou can increment the version values with the `increment` command.\n\n    $ semver increment:major\n    $ semver increment:minor\n    $ semver increment:patch\n\n\u003e ℹ️ Incrementing certain values may affect other values\n\u003e   - Incrementing the `major` value will reset the `minor` and `patch` values to `0`\n\u003e   - Incrementing the `minor` value will only reset the `patch` value to `0`\n\u003e   - Incrementing the `major`, `minor` or `patch` value will also clear the \n\u003e     `pre-release` and `build` values\n\nAdapters\n--------\n\nThe method used for storing version information can be configured with the\n`--adapter` option. The following are the available adapters to choose from.\n\n\u003cdl\u003e\n  \u003cdt\u003e\u003ccode\u003efile\u003c/code\u003e\u003c/dt\u003e\n  \u003cdd\u003eStores the version in a regular file in the current directory (default)\u003cdd\u003e\n\n  \u003cdt\u003e\u003ccode\u003ecomposer\u003c/code\u003e\u003c/dt\u003e\n  \u003cdd\u003e\n    Stores the version in the \u003ccode\u003ecomposer.json\u003c/code\u003e file under the\n    \u003ca href=\"https://getcomposer.org/doc/04-schema.md#version\"\u003eversion\u003c/a\u003e property\n  \u003c/dd\u003e\n\u003c/dl\u003e\n\nWhen using the `file` adapter you can control the file to which commands read\nand write the version via the `--file` option. This option takes the name you'd\nlike to use and will look for a file with that name in the current directory.\n\n    $ semver --file .version get:version\n\nBy default the `composer` adapter will look for your `composer.json` file in the\ncurrent directory. If your `composer.json` file lives elsewhere you can specify\nthe path with the `--composer` option.\n\n    $ semver --composer path/to/composer.json increment:major\n\n\u003e ℹ️ Adapter options can be passed passed along with any command.\n\nConfiguration\n-------------\n\nInstead of passing adapter options with every command you can set these options\nin a persistent configuration file. To enable the config create a file in your\nproject directory with a name of `semver.config.php`. This file MUST be a PHP\nfile and return an array with with one or more of the followng configuration\noptions.\n\n\u003cdl\u003e\n  \u003cdt\u003e\u003ccode\u003eadapter\u003c/code\u003e\u003c/dt\u003e\n  \u003cdd\u003e\n    \u003cp\u003eThe storage adapter in which version data will be stored.\u003c/p\u003e\n    \u003cp\u003eEquivilent to the \u003ccode\u003e--adapter\u003c/code\u003e option.\u003c/p\u003e\n  \u003c/dd\u003e\n\n  \u003cdt\u003e\u003ccode\u003efile_name\u003c/code\u003e\u003c/dt\u003e\n  \u003cdd\u003e\n    \u003cp\u003eName of the version file when using the file adapter.\u003c/p\u003e\n    \u003cp\u003eEquvilent to the \u003ccode\u003e--file\u003c/code\u003e option.\u003c/p\u003e\n  \u003c/dd\u003e\n\n  \u003cdt\u003e\u003ccode\u003ecomposer_file\u003c/code\u003e\u003c/dt\u003e\n  \u003cdd\u003e\n    \u003cp\u003ePath to the composer file when using the composer adpater\u003c/p\u003e\n    \u003cp\u003eEquvilent to the \u003ccode\u003e--composer\u003c/code\u003e option.\u003c/p\u003e\n  \u003c/dd\u003e\n\u003c/dl\u003e\n\n### Examples\n\n```php\n\u003c?php\n\nreturn [\n    'adapter' =\u003e 'composer',\n    'composer_file' =\u003e 'some/path/composer.json',\n];\n```\n\nChangelog\n---------\n\nA list of changes can be found on the [GitHub Releases](https://github.com/PHLAK/SemVer-CLI/releases) page.\n\nTroubleshooting\n---------------\n\nFor general help and support join our [GitHub Discussions](https://github.com/PHLAK/SemVer-CLI/discussions) or reach out on [Twitter](https://twitter.com/PHLAK).\n\nPlease report bugs to the [GitHub Issue Tracker](https://github.com/PHLAK/SemVer-CLI/issues).\n\nCopyright\n---------\n\nThis project is liscensed under the [MIT License](https://github.com/PHLAK/SemVer-CLI/blob/master/LICENSE).\n","funding_links":["https://github.com/sponsors/PHLAK","https://patreon.com/PHLAK","https://paypal.me/ChrisKankiewicz"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphlak%2Fsemver-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphlak%2Fsemver-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphlak%2Fsemver-cli/lists"}