version - Show Version Info

version - Show Version Info

The version command displays the current Update-Watcher version, the git commit hash it was built from, and the build date. Use the --short flag to output only the version number.

Usage

Terminal
update-watcher version [--short]

Flags

FlagDescription
--shortOutput only the version number (e.g., v1.3.0). Omits the commit hash and build date.

Output

Full Version Info

Terminal
update-watcher version
Output
update-watcher v1.3.0
  commit: a1b2c3d
  built:  2025-04-15T10:30:00Z

The output includes:

  • Version – The semantic version number (e.g., v1.3.0).
  • Commit – The short git commit hash of the source code this binary was built from.
  • Built – The date and time the binary was compiled, in ISO 8601 format.

Short Version

Terminal
update-watcher version --short
Output
v1.3.0

The short output is useful in scripts where you need just the version string:

Terminal
CURRENT_VERSION=$(update-watcher version --short)
echo "Running Update-Watcher $CURRENT_VERSION"

Use Cases

  • Bug reports – Include the full version output when reporting issues.
  • Deployment verification – Confirm which version is installed on a server after deployment.
  • Scripting – Use --short to capture the version number for comparison or logging.
  • Inventory – Collect version information across multiple servers for fleet management.

Examples

Check If Installed

Terminal
update-watcher version > /dev/null 2>&1 && echo "Installed" || echo "Not found"

Compare Versions in a Script

Terminal
INSTALLED=$(update-watcher version --short)
REQUIRED="v1.3.0"

if [ "$INSTALLED" != "$REQUIRED" ]; then
  echo "Version mismatch: installed $INSTALLED, required $REQUIRED"
fi

Related