Description
Shows the check-image version with full build information including version, commit hash, build date, Go version, and platform.Command Syntax
Flags
| Flag | Type | Default | Description |
|---|---|---|---|
--short | bool | false | Print only the version number |
--output / -o | string | text | Output format: text or json |
Usage Examples
Full Version Information
Short Version
JSON Output (Full)
JSON Output (Short)
Example Output
Text Format (Full)
Text Format (Short)
JSON Format (Full)
JSON Format (Short)
Build Information
Version Components
| Field | Description | Example | Injection Method |
|---|---|---|---|
version | Semantic version string | v0.19.4 | ldflags at build time |
commit | Git commit hash (7 chars) | a1b2c3d | ldflags at build time |
built-at | Build timestamp (RFC3339 UTC) | 2026-02-18T12:34:56Z | ldflags at build time |
go-version | Go compiler version | go1.26.0 | Read from runtime.Version() |
platform | OS/Architecture | linux/amd64 | Read from runtime.GOOS/runtime.GOARCH |
Version Injection
Version and build metadata are injected at build time using ldflags:Development Builds
Binaries built without version injection will show:- Version:
dev - Commit:
none - Build Date:
unknown
go installbuilds from source- Local development builds with
go build
Release Builds
Pre-built binaries from GitHub Releases include correct version information:- Version: semantic version tag (e.g.,
v0.19.4) - Commit: 7-character Git SHA (e.g.,
a1b2c3d) - Build Date: RFC3339 UTC timestamp
Exit Codes
| Exit Code | Meaning |
|---|---|
| 0 | Version displayed successfully |
| 2 | Execution error (should not occur) |
Notes
- The
versioncommand takes no positional arguments. - Version information is always available, even when no Docker daemon or registry access is present.
- Go version and platform are read from the Go runtime and do not require ldflags injection.
- GoReleaser automatically injects version information during release builds using template variables
{{.ShortCommit}}and{{.Date}}. - Docker images use build args (
VERSION,COMMIT,BUILD_DATE) to inject version information.