Skip to main content
The mizu version command shows information about the installed Mizu CLI, including the version number, Go version, and build details. Use this command to verify your installation works or to include version info in bug reports.

Basic Usage

mizu version
Output:
mizu version 0.1.0
go version: go1.23.0
commit: abc1234
built: 2024-01-15T10:30:00Z

What Each Field Means

FieldDescriptionExample
versionThe semantic version of the CLI0.1.0
go versionThe Go version used to compilego1.23.0
commitShort Git commit hashabc1234
builtWhen this version was built (UTC)2024-01-15T10:30:00Z

Flags

FlagDescription
--jsonOutput as JSON
-h, --helpShow help

JSON Output

For scripts and automation, use --json:
mizu version --json
Output:
{
  "version": "0.1.0",
  "go_version": "go1.23.0",
  "commit": "abc1234",
  "built_at": "2024-01-15T10:30:00Z"
}

When to Use This Command

Verify Installation

After installing the CLI, confirm it’s working:
mizu version
If you see version information, the CLI is installed correctly.

Check for Updates

Compare your version with the latest release:
# Check your version
mizu version

# Update to latest
go install github.com/go-mizu/mizu/cmd/mizu@latest

# Verify update
mizu version

Include in Bug Reports

When reporting issues, include your version information:
mizu version --json > version.json
Share this file with your bug report so maintainers know your exact setup.

CI/CD Version Checks

Ensure a minimum version in build scripts:
#!/bin/bash

# Get the version
VERSION=$(mizu version --json | jq -r '.version')

# Compare versions (requires semver comparison)
if [[ "$VERSION" == "dev" ]]; then
  echo "Warning: Using development build"
fi

echo "Using mizu $VERSION"

Development Builds

If you built from source without setting version flags, you’ll see:
mizu version dev
go version: go1.23.0
commit: unknown
built: unknown
This is normal for local development builds.

Setting Build Information

When building the CLI, you can embed version information using Go’s -ldflags:
go build -ldflags "\
  -X github.com/go-mizu/mizu/cli.Version=1.0.0 \
  -X github.com/go-mizu/mizu/cli.Commit=$(git rev-parse --short HEAD) \
  -X github.com/go-mizu/mizu/cli.BuildTime=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
  -o mizu ./cmd/mizu
This is useful for:
  • Release builds
  • CI/CD pipelines
  • Custom distribution

Variables

VariableDefault
cli.Versiondev
cli.Commitunknown
cli.BuildTimeunknown

Exit Codes

CodeDescription
0Success (always)
The version command always succeeds if the CLI is running.

Troubleshooting

”command not found: mizu”

The CLI isn’t installed or isn’t in your PATH. See Installation.

Version Shows “dev”

You’re running a development build. This is fine for testing but you may want to install a release version:
go install github.com/go-mizu/mizu/cmd/mizu@latest

Next Steps