Advocate Plumbing ↗️ App Definition and Development / Application Definition & Image Build

Technology Guide

CUE

License: Apache-2.0

CUE Logo

Field Guide

Complete Guide

CUE (Configure, Unify, Execute) is a data constraint language from Marcel van Lohuizen, who previously worked on Borg’s configuration language (BCL/GCL) at Google. It’s a superset of JSON where types and values live in the same lattice: int is a constraint satisfied by all integers, >0 is a narrower constraint, 42 is the narrowest. Unification — CUE’s core operation — combines any two values into the most specific value that satisfies both, or fails with a clear conflict. This means schemas, defaults, and concrete data compose associatively and commutatively, and order of imports doesn’t matter.

In practice, CUE is used for Kubernetes manifests (it round-trips to YAML and JSON, and can import OpenAPI, Protobuf, and JSON Schema), generating configuration across multiple systems from a single source of truth, validating data in CI, and as the base language for higher-level tools — Dagger’s pipelines originally used CUE, Istio uses it internally for CRD validation, and Timoni is a Helm-alternative built entirely on CUE modules. It has a package manager (cue mod), a central registry, and modules with SemVer.

Compared to Jsonnet, Dhall, or Helm templates, CUE’s win is that there is no separate templating language layered on top of your data: constraints, defaults, and values are all the same thing, and conflicts are statically detectable. The cost is a steep learning curve — unification, disjunctions, and the type lattice are unfamiliar to most engineers arriving from YAML and Go templates.