CUE

No Change
assess
First Added:July 10, 2025 Updated: July 28, 2026

CUE is a constraint-based language for validating, unifying, and generating structured data (JSON, YAML, TOML, and more). We assess it when JSON Schema and OpenAPI are not enough, but we do not default to it for new work.

Blurb

CUE makes it easy to validate data, write schemas, and ensure configurations align with policies.

Summary

What it is: Configure, Unify, Execute. CUE merges schemas through unification, validates with cue vet, and exports to JSON Schema, OpenAPI, and Kubernetes CRD shapes. Influenced by Google’s internal GCL/BCL lineage (see Details).

When to use:

SituationNotes
Cross-format validationOne schema for JSON, YAML, and CUE inputs in CI
Policy patchesSeparate base schema from version-specific constraints; CUE merges and reports conflicts
Kubernetes CRDsGenerate structural OpenAPI from concise CUE definitions
Go or Protobuf driftcue import from GoLang or Protobuf types

When to skip:

  • Standard API or config validation (JSON Schema adopt is the default)
  • Teams without appetite for another config language
  • Estates already standardized on HCL, YAML templates, or Conftest + Rego
  • Greenfield work where schema tooling is not the bottleneck

Trade-offs: Powerful but niche. Another standards-layer risk (XKCD 927). Smaller ecosystem than JSON Schema. Worth studying even when you do not adopt, because it demonstrates how constraint unification can replace verbose schema boilerplate.

Details

Core Commands

CommandRole
cue vetValidate data files against CUE schemas
cue exportEmit JSON, YAML, or other targets from unified values
cue importPull types from Go, JSON Schema, OpenAPI, Protobuf
cue fmtFormat CUE sources

Schemas and policies can live in separate .cue files. CUE unifies them before validation.

Compared to JSON Schema

TopicCUEJSON Schema
VerbosityConcise constraints, unificationVerbose for complex cross-field rules
EcosystemGrowing; Kubernetes and OpenAPI bridgesAdopt everywhere in our pipelines
Learning curveNew language semanticsFamiliar to most platform engineers
Garden stanceassessadopt

GCL Lineage

CUE draws from Google’s internal General Config Language (GCL) and related BCL work. Even if you never deploy CUE, reading the design explains how Google-style config unification differs from template sprawl. Public background: General Config Language paper (PDF).

References