Skip to content

SDK Configuration

Configuration is layered. Later sources win:

defaults  <  config file  <  environment variables  <  flags

Config file

Location by OS:

OSPath
Linux~/.config/glacier/config.json
macOS~/Library/Application Support/glacier/config.json
Windows%AppData%\glacier\config.json

All keys are optional. The SDK runs with no config file present.

Minimal example:

json
{
  "versioncheck": {
    "cache_ttl": "1h"
  }
}

Config keys

KeyTypeDefaultDescription
github.repostringnathanbrophy/glacierRepository used by version --check for the latest-release lookup.
versioncheck.cache_ttlduration24hTTL for the cached latest-release result. Accepts Go duration strings: 1h, 30m, 24h.
versioncheck.enabledbooltrueSet to false to disable the version --check network call entirely.
versioncheck.strictboolfalseWhen true, a network failure during --check exits 68 instead of degrading gracefully.
banner.show_on_helpbooltrueShow the banner when glacier --help is invoked.
palette.overrideobject{}Per-token color overrides. Keys are CSS custom property names (e.g. "--mg-cyan": "#00ffff").

The telemetry key is hard-coded to false. Setting it has no effect. The SDK never phones home.

Environment variables

Config key overrides

Every config key maps to an environment variable with the GLACIER__ prefix and double-underscore separators:

Config keyEnvironment variable
github.repoGLACIER__GITHUB__REPO
versioncheck.cache_ttlGLACIER__VERSIONCHECK__CACHE_TTL
versioncheck.enabledGLACIER__VERSIONCHECK__ENABLED
versioncheck.strictGLACIER__VERSIONCHECK__STRICT
banner.show_on_helpGLACIER__BANNER__SHOW_ON_HELP

Color control

VariableEffect
NO_COLORSuppress all ANSI color; equivalent to --no-color. Honored by all ANSI-aware tools.
GLACIER_NO_COLORSame as NO_COLOR, scoped to the Glacier SDK only.
FORCE_COLORForce color even when stdout is not a TTY.
GLACIER_FORCE_COLORSame as FORCE_COLOR, scoped to the Glacier SDK only.

Logging and verbosity

VariableEffect
GLACIER_VERBOSEEquivalent to --verbose (-V): raises log level to Debug.
GLACIER_DEBUGEquivalent to --very-verbose: raises log level to Trace.

Telemetry (opt-in)

VariableEffect
OTEL_EXPORTER_OTLP_ENDPOINTWhen set, the SDK initializes obs and emits per-command spans and counters to this endpoint. No data is sent when this variable is unset.

Global flags

These flags are accepted by every command and take precedence over all other sources.

FlagShortDescription
--help-hPrint help text
--quiet-qSuppress non-error output and animations; keep the final summary
--verbose-VRaise log level to Debug
--very-verboseRaise log level to Trace
--no-animateForce plain output even on a TTY
--no-bannerSuppress the banner on this invocation
--no-colorDisable all ANSI color output
--force-colorForce color output even when output is not a TTY
--profileWrite pprof CPU, heap, and goroutine profiles
--otel-endpointOverride OTEL_EXPORTER_OTLP_ENDPOINT for this invocation

--quiet and --verbose / --very-verbose are mutually exclusive. Combining them exits 2.

-v is reserved for --version on the root command.

Exit codes

CodeMeaning
0Success
1Generic failure
2Usage error
64Generator failure (generate)
65Lint findings at or above the severity threshold (lint)
66Tests failed or benchmark regression detected (test)
67Scaffolding failure (init, new)
68Version-check unreachable when --strict is set (version --check --strict)
69Codegen drift detected (generate --check)
70Subprocess failure (wrapped tool exited non-zero)
130SIGINT / Ctrl-C
143SIGTERM

Exit codes are stable across SDK versions. Use glacier explain <code> to read the full description and suggested next steps.

Cache files

FileOwner commandPurpose
<UserCacheDir>/glacier/versioncheck.jsonversionLatest-release lookup result, cached with TTL
<repo>/.glacier/lint-cache.jsonlintPer-file content-hash result cache
<repo>/.glacier/bench-baseline.jsontest --benchBenchmark baseline for regression gating
<repo>/.glacier/coverage.outtest --coverCoverage profile

<repo>/.glacier/ is added to the .gitignore generated by glacier init. All cache writes route through internal/safefile for atomic replacement.

Apache-2.0