CLI for managing versions in a Capacitor project across multiple platforms.
- 📱 Capacitor-native: Designed specifically for Capacitor projects and workflows.
- 🤖 Android: Full Android platform support with build.gradle integration.
- 🍎 iOS: Complete iOS platform support with Xcode project integration.
- 🌐 Web: Complete web platform support with package.json integration.
- ⬆️ Automatic increase: Easily increment major, minor, patch, and hotfix versions.
- 🔧 Hotfixes: Support for hotfix versioning on mobile platforms.
- 🩺 Health checks: Verify version consistency across platforms with built-in diagnostics.
- 🎯 Easy usage: Simple commands with intuitive CLI interface.
- ✅ Fully tested: Comprehensive test coverage for reliable operation.
The CLI can be installed globally via npm:
npm install -g @capawesome/capver
The CLI can be invoked with the @capawesome/capver
command.
npx @capawesome/capver <command> [options]
# Initialize a new Capacitor project with version 0.0.1
npx @capawesome/capver set 0.0.1
# Increment the patch version
npx @capawesome/capver patch
# Increment the minor version
npx @capawesome/capver minor
# Increment the major version
npx @capawesome/capver major
# Increment only the build number
npx @capawesome/capver hotfix
# Check version consistency across platforms
npx @capawesome/capver get
# Synchronize all platforms to use the highest version found
npx @capawesome/capver sync
Get the version of the app from all relevant files.
npx @capawesome/capver get
This command displays the current version across all platforms and verifies they are synchronized.
Set the version of the app in all relevant files.
npx @capawesome/capver set <version>
Arguments:
version
- Version in formatmajor.minor.patch
(e.g.,1.2.3
)
Increment the major version of the app in all relevant files.
npx @capawesome/capver major
Increments the major version number (e.g., 1.2.3
→ 2.0.0
).
Increment the minor version of the app in all relevant files.
npx @capawesome/capver minor
Increments the minor version number (e.g., 1.2.3
→ 1.3.0
). Maximum value: 999.
Increment the patch version of the app in all relevant files.
npx @capawesome/capver patch
Increments the patch version number (e.g., 1.2.3
→ 1.2.4
). Maximum value: 99.
Increment the hotfix version of the app in all relevant files.
npx @capawesome/capver hotfix
Increments the hotfix version for mobile platforms (iOS/Android only). Maximum value: 99.
Set the highest version number among all platforms in all relevant files.
npx @capawesome/capver sync
Synchronizes all platforms to use the highest version found across any platform.
Prints out necessary information for debugging.
npx @capawesome/capver doctor
Displays system information including Node.js, NPM, CLI version, and OS details.
The CLI ships with command documentation that is accessible with the --help
flag.
npx @capawesome/capver --help
The commit-and-tag-version package offers automatic versioning, changelog generation, and Git tagging using conventional commits. You can integrate it with the @capawesome/capver
CLI for a seamless versioning experience. Just add the following configuration to your package.json
:
{
"version": "0.0.1",
"scripts": {
"release": "commit-and-tag-version --commit-all"
},
"commit-and-tag-version": {
"scripts": {
"postbump": "npx @capawesome/capver set $npm_package_version"
}
}
}
This configuration ensures that the version is automatically updated in all relevant files whenever a new version is released. Just run npm run release
to automatically bump the version, update all relevant files, and commit the changes.
Run the following commands to get started with development:
-
Clone the repository:
git clone https://github.com/capawesome-team/capver.git
-
Install dependencies:
npm install
-
Run your first command:
npm start -- --help
Note: The
--
is required to pass arguments to the script.
See CHANGELOG.
See LICENSE.