https://github.com/tranquility2/semvergit
Manage your project's version numbers
https://github.com/tranquility2/semvergit
cli git semver versioning
Last synced: 11 months ago
JSON representation
Manage your project's version numbers
- Host: GitHub
- URL: https://github.com/tranquility2/semvergit
- Owner: Tranquility2
- License: mit
- Created: 2023-12-27T15:32:38.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2025-07-11T17:42:15.000Z (12 months ago)
- Last Synced: 2025-07-11T19:26:13.118Z (12 months ago)
- Topics: cli, git, semver, versioning
- Language: Python
- Homepage:
- Size: 153 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
|||
|-|-|
| CI/CD | [](https://github.com/Tranquility2/semvergit/actions/workflows/pytest.yml) [](https://github.com/Tranquility2/semvergit/actions/workflows/publish.yml)  [](https://coveralls.io/github/Tranquility2/semvergit) [](https://github.com/pre-commit/pre-commit)|
| Package | [](https://pypi.org/project/semvergit/) [](https://pypi.org/project/semvergit/) [](https://pepy.tech/project/semvergit) |
| Meta | [](https://github.com/psf/black) [](https://github.com/PyCQA/bandit) [](https://pycqa.github.io/isort/) [](https://github.com/pylint-dev/pylint) [](http://mypy-lang.org/) [](https://spdx.org/licenses/) |
# semvergit

semvergit is a CLI tool to manage your project's version numbers.
It uses [Semantic Versioning](https://semver.org/) to bump the version number.
The supported bump types are:
- `major`
- `minor`
- `patch`
- `prerelease`
## Internal Workflow
___What's actully happening when you run this tool___
1. Use the latest git tag to determine the current version number.
2. Bump the version number
3. Create a new git tag
4. Push the tag to the remote
## Why?
I created this tool to help me manage my project's version numbers.
I wanted a simple tool that I could use in my CI/CD pipeline to bump the version number and tag the commit.
## Features
❇️ Bump the version number and update the git tag in one command
❇️ Dry run mode
❇️ Verbose mode
❇️ Custom commit message*
❇️ Auto commit message*
🆕 Version 0.4+ introduces the ability to automatically update the version number in a file*
*Please see the [limitations](#Limitations) section below
## How to use
Simple install using
``pip install semvergit``
Then you can use it in your project as simply as:
``semvergit -t patch -v``
(to bump the patch version)
This will:
1. create the relvant tag (in this case a patch bump 0.0.x -> 0.0.x+1)
2. push it to the remote
Please checkout ``semvergit --help`` for more info.
```shell
Usage: semvergit [OPTIONS] COMMAND [ARGS]...
CLI for semvergit.
Options:
--version Show the version and exit.
-d, --dry_run Dry run
-v, --verbose Verbose level [0<=x<=2]
-t, --bump_type TEXT Bump Type ['major', 'minor', 'patch', 'prerelease']
-m, --message TEXT Commit message
-am, --auto_message Auto commit message
-f, --version_file FILE Version file
--help Show this message and exit.
```
## Limitations
Please keep in mind that when using features like `commit message` / `auto commit message` and `version file` the tool will try and commit the changes to the git repo.
Even though this is quite handy, it should be used mannually as it **cannot be used directly in a CI/CD pipeline directed at `master` or `main` branches** as it will likly fail due to the commit not being allowed without a PR.
💡 Only git tags can be pushed to the remote without a PR *(and this is the main use case for this tool)*.
## Development
Please see [CONTRIBUTING.md](CONTRIBUTING.md)
## License
This project is published under the MIT license.
If you do find it useful, please consider contributing your changes back upstream.