Version Command#

Display version and build information for the GeoServer CLI.

Usage#

1
./geoserver-cli version

Output#

The command displays:

  • Version: Semantic version number (e.g., v1.2.3)
  • Commit: Git commit hash used to build the binary

Example Output:

1
geoserver-cli v1.2.3 (commit abc123def456)

Build Information#

Version and commit information are set at build time using Go linker flags:

1
go build -ldflags "-X geoserver-cli/internal/cli.version=v1.2.3 -X geoserver-cli/internal/cli.commit=abc123" ./cmd/geoserver-cli

Use Cases#

Verify Installation#

Check that the CLI is installed and working:

1
./geoserver-cli version

Debugging#

Include version information when reporting issues:

1
./geoserver-cli version > version_info.txt

CI/CD#

Use in scripts to verify CLI version:

1
2
3
4
5
VERSION=$(./geoserver-cli version | awk '{print $2}')
if [ "$VERSION" != "v1.2.3" ]; then
  echo "Version mismatch!"
  exit 1
fi

Development Builds#

Development builds show:

1
geoserver-cli dev (commit none)

This indicates the binary was built without version/commit information, typically during local development.