Automated version management and Git operations for Node.js and PHP projects.
Note: tagit is intended for use on Linux systems only.
tagit is a Linux-focused CLI utility that automates a release workflow for Node.js and PHP projects. It increments the project version, updates package.json and/or composer.json, runs dependency/build commands, commits the result, creates a Git tag, and pushes the commit and tags to the configured remote.
- Increments the semantic version in
package.jsonand/orcomposer.json - Keeps
package.jsonandcomposer.jsonversions in sync when both files exist - Runs Composer maintenance commands for PHP projects
- Runs
npm updatefor Node.js projects - Detects webpack projects and runs a build before committing
- Commits all changes with a message like
Version <version> - MM-DD-YYYY - Tags the commit with the new version, for example
1.2.4 - Pushes commits and tags to your remote repository
- Logs each step for transparency
- Linux
- Node.js 22 or newer is recommended
- npm
- Git
- Composer, if the target project contains
composer.json - A clean, correctly configured Git repository with push access to its remote
tagit increments the final numeric segment of the existing version string:
1.2.3 -> 1.2.4
When both version files are present, composer.json is used as the source version. The resulting new version is then written to both composer.json and package.json.
If only package.json exists, that file is used as the source version.
If only composer.json exists, that file is used as the source version.
Each detected version file must contain a version field.
Clone the repository (suggested location: /opt):
sudo git clone https://github.com/eliware/tagit.git /opt/tagit
cd /opt/tagit
sudo npm install
# (Optional) Run tests
sudo npm testCreate a symlink to make tagit available system-wide:
sudo ln -s /opt/tagit/tagit.mjs /usr/bin/tagitSwitch to the root directory of the project you want to release, then run:
tagitIf you have not created the symlink, you can run it directly with:
/opt/tagit/tagit.mjsWhen run from a target project, tagit performs these steps:
- Stops immediately if a
.notagfile exists in the current directory. - Updates
composer.jsonand/orpackage.jsonwith the next version. - If
composer.jsonexists, runs:
COMPOSER_HOME="." COMPOSER_ALLOW_SUPERUSER=1 composer update
COMPOSER_HOME="." COMPOSER_ALLOW_SUPERUSER=1 composer bump- If
package.jsonexists, runs:
npm update- If
package.jsoncontains atestscript, runs:
npm test- If webpack is detected, runs the first available build command:
npm run build
npm run webpack
npx webpack- Stages all changes, commits, tags, and pushes:
git add -A
git commit -m 'Version <version> - MM-DD-YYYY'
git tag <version>
git push
git push --tagsWebpack is detected when the project has a webpack dependency in dependencies, devDependencies, peerDependencies, or optionalDependencies, or when webpack.config.js / webpack.config.mjs exists.
Create a .notag file in the target project root to prevent tagit from making any changes:
touch .notagRemove the file when releases should be allowed again.
Run the test suite with:
npm testtagitrunsnpm updateandcomposer update, so dependency lock files may change during a release.- If
npm update,npm test,npm run build, or Composer update/bump fails,tagitrestores the original version contents before exiting. tagitcommits every staged and unstaged change after runninggit add -A.- The GitHub Actions workflow publishes to npm when a tag is pushed.
For help or questions, join the community and chat with the author:

