https://github.com/silverwind/versions
CLI to flexibly increment a project's version
https://github.com/silverwind/versions
cli git-tag nodejs semantic-versioning version-bump version-update
Last synced: 14 days ago
JSON representation
CLI to flexibly increment a project's version
- Host: GitHub
- URL: https://github.com/silverwind/versions
- Owner: silverwind
- License: bsd-2-clause
- Created: 2018-09-05T05:18:03.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-04-02T08:48:22.000Z (about 2 months ago)
- Last Synced: 2025-04-27T19:46:38.995Z (24 days ago)
- Topics: cli, git-tag, nodejs, semantic-versioning, version-bump, version-update
- Language: JavaScript
- Homepage:
- Size: 1.56 MB
- Stars: 12
- Watchers: 2
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# versions
[](https://www.npmjs.org/package/versions) [](https://www.npmjs.org/package/versions) [](https://packagephobia.com/result?p=versions)> CLI to flexibly increment a project's version
## Usage
```bash
# increment patch version of current project
npx versions patch
```## Bun and Deno
```bash
bunx versions
deno run -A npm:versions
```## Options
```
usage: versions [options] patch|minor|major [files...]Options:
-a, --all Add all changed files to the commit
-b, --base Base version. Default is from latest git tag or 0.0.0
-p, --prefix Prefix version string with a "v" character. Default is none
-c, --command Run command after files are updated but before git commit and tag
-d, --date [] Replace dates in format YYYY-MM-DD with current or given date
-m, --message Custom tag and commit message
-r, --replace Additional replacements in the format "s#regexp#replacement#flags"
-g, --gitless Do not perform any git action like creating commit and tag
-D, --dry Do not create a tag or commit, just print what would be done
-v, --version Print the version
-h, --help Print this helpThe message and replacement strings accept tokens _VER_, _MAJOR_, _MINOR_, _PATCH_.
Examples:
$ versions patch
$ versions -c 'npm run build' -m 'Release _VER_' minor file.css
```## Signing commits and tags
To automatically sign commits and tags created by `versions` with GPG add this to your `~/.gitconfig`:
```ini
[user]
signingkey =
[commit]
gpgSign = true
[tag]
forceSignAnnotated = true
[push]
gpgSign = if-asked
```## CI environments
CI environments usually do incomplete git checkouts without tags. Fetch tags first:
```bash
git fetch --tags --force
```© [silverwind](https://github.com/silverwind), distributed under BSD licence