Skip to content

glacier version

Synopsis. Print the Glacier SDK version, Go toolchain, and OS/arch. With --check, compare against the latest published release.

Other commands: vibe generate lint test init new completions explain

Flags

FlagDefaultDescription
--checkfalseFetch the latest release from GitHub and compare against the running version.
--strictfalseWhen combined with --check, exit 68 if the GitHub endpoint is unreachable instead of degrading gracefully.
--jsonfalseEmit a single JSON object to stdout instead of human-readable lines.

Examples

Print the current version:

sh
glacier version

Check whether a newer release is available:

sh
glacier version --check

Machine-readable output for scripting:

sh
glacier version --json

Fail the script if the version check cannot reach GitHub:

sh
glacier version --check --strict

Parse the latest tag with jq:

sh
glacier version --check --json | jq -r '.latest.tag'

What it does under the hood

version reads its own version string from a value baked in at build time via -ldflags; when that is empty or "dev" it falls back to runtime/debug.ReadBuildInfo. With --check, it looks up the latest release via cmd/glacier/internal/ghreleases using httpc.Default. The lookup result is cached in a layered cache (in-memory primary backed by <UserCacheDir>/glacier/) with a 24-hour TTL configured by versioncheck.cache_ttl. A network failure without --strict prints latest: unknown (offline) and exits 0. All version output writes to stdout so glacier version --json | jq .latest works correctly.

Exit codes

CodeMeaning
0Success, or offline without --strict
68Network failure during --check when --strict is set
130SIGINT during the network call

See also

Apache-2.0