Est. 2019 Intermediate

CUE

A constraint-based configuration language that unifies types and values into a single lattice, designed to validate, define, and generate data at scale.

Created by Marcel van Lohuizen

Paradigm Declarative, Constraint-based
Typing Static, Structural
First Appeared 2019
Latest Version v0.16.0 (March 2025, as of early 2025)

CUE — which stands for Configure, Unify, Execute — is a constraint-based configuration language designed to validate, define, and generate structured data at scale. Born from over fifteen years of experience with Google’s internal configuration systems, CUE takes a fundamentally different approach from traditional templating languages by treating types and values as points on a single lattice, where constraints can be combined in any order to produce deterministic results.

History and Origins

CUE was created by Marcel van Lohuizen, a veteran engineer who spent approximately 18-19 years at Google. During his time there, van Lohuizen was a founding team member of Borg — the cluster management system that preceded Kubernetes — and led the development of GCL (Google Configuration Language, also known as BCL or Borg Config Language), which became the dominant configuration language inside Google.

After years of studying system outages and configuration failures at Google scale, van Lohuizen identified two fundamental shortcomings in existing configuration tooling: complexity arising from inheritance-based composition and a lack of meaningful typing. These insights directly shaped CUE’s design.

The first public release, v0.0.2, appeared on GitHub on June 22, 2019. Development moved quickly through approximately fifteen releases by the end of that year. In 2021, the project migrated from cuelang/cue to the cue-lang organization. Van Lohuizen later co-founded CUE Labs with Paul Jolly, headquartered in Zug, Switzerland, which emerged from stealth in October 2025 with backing from Sequoia Capital, OSS Capital, Founders Fund, and Dell Technologies Capital.

Design Philosophy

CUE’s central design principle can be summarized as: “Wrap code in data, not data in code.” Where most configuration languages embed data within a programming language (using loops, conditionals, and inheritance to generate output), CUE starts from the data and layers constraints on top of it.

Three mathematical properties distinguish CUE from its peers:

  • Associativity: Grouping of constraint combinations does not affect the result
  • Commutativity: The order in which constraints are combined does not matter
  • Idempotency: Applying the same constraint twice has no additional effect

These properties mean that configuration from different teams, files, or sources can be merged in any order and always produce the same result. This is a deliberate contrast to inheritance-based systems like GCL and Jsonnet, where the order of application can change the outcome, making large-scale configuration increasingly difficult to reason about.

CUE also follows a push, not pull model for constraints. Rather than requiring explicit template invocation, CUE applies constraints through blanket pattern declarations — if a constraint applies to a structure, it applies everywhere that structure appears, without requiring the author to opt in.

Key Features

Types Are Values

CUE’s most distinctive feature is that types and values exist on a single hierarchy — a partially ordered set (lattice). There is no separate type system: a type is simply a more general value, and a value is simply a more specific type. This collapses concepts like generics, enums, sum types, and null coalescing into unified constructs.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
// A type (constraint)
#Person: {
    name: string
    age:  int & >=0 & <=150
}

// A value (more specific point on the lattice)
alice: #Person & {
    name: "Alice"
    age:  30
}

JSON Superset

All valid JSON is valid CUE, enabling incremental adoption. CUE extends JSON with comments, trailing commas, optional quotes on field names, constraints, definitions, and much more.

Multi-Format Interoperability

CUE can import and export between JSON, YAML, Protocol Buffers, OpenAPI, and JSON Schema. This makes it practical as a bridge between different schema and configuration ecosystems.

Constraint-Based Validation

CUE provides fine-grained constraints that double as both validation rules and templates. Constraints can specify exact values, ranges, regular expression patterns, structural requirements, and relationships between fields.

Order-Independent Composition

Because CUE’s merge operation is commutative and associative, constraints from different sources — different teams, different files, different layers of an organization — can be combined without defining an application order. This is essential for managing configuration at scale across large organizations.

Tooling-First Design

CUE was designed from the start to be machine-manipulable. The cue CLI provides commands for evaluation (eval), export (export), formatting (fmt), vetting (vet), and schema definition (def). An LSP implementation shipped with v0.15.0 for editor integration.

Theoretical Foundations

CUE’s lattice-based approach draws from an unexpected source: computational linguistics. The language is rooted in the theory of typed feature structures (TFS) and graph unification, as described in Bob Carpenter’s The Logic of Typed Feature Structures (1992) and Ann Copestake’s Implementing Typed Feature Structure Grammars (2002). These formalisms were originally developed for natural language parsing but provide the mathematical framework CUE uses for constraint propagation and validation.

CUE occupies a space alongside several other configuration and data languages, each with different tradeoffs:

AspectCUEJsonnetHCLYAML
ApproachConstraint-based validationData templating via inheritanceDeclarative configurationData serialization
CompositionCommutative, order-independentInheritance-based, order-dependentFile overlay, order-dependentNo built-in composition
Type systemTypes and values unified on a latticeDynamically typedLimited type checkingNo types
OriginGCL successor (validation focus)GCL successor (templating focus)Terraform DSLGeneral-purpose data format
Turing-completeNo (by design)YesNoNo

CUE and Jsonnet both descend from Google’s GCL but address different shortcomings. Jsonnet focuses on reducing boilerplate through inheritance; CUE focuses on ensuring correctness through constraints. CUE intentionally sacrifices some flexibility for safety and toolability.

Evolution

CUE has evolved steadily since its 2019 debut while remaining pre-v1.0:

  • v0.1.0 (April 2020) introduced the streamlined CLI and format interoperability with Protobuf, OpenAPI, and JSON Schema
  • v0.2.0 (May 2020) made a significant syntax change, replacing the :: definition notation with #-prefixed identifiers
  • v0.3.0 (April 2021) marked the first step toward a backwards compatibility guarantee
  • v0.15.0 (2025) shipped initial LSP support and removed the legacy evaluator
  • v0.16.0 (March 2025) delivered up to 80% speed improvements on some large projects through type checker caching, with similar gains reported for very large structs

The project has published well over a hundred releases across its history and continues active development under the cue-lang GitHub organization.

Current Relevance

CUE has found its strongest adoption in the Kubernetes and cloud-native ecosystem, where configuration complexity is a persistent challenge. Projects like Istio, KubeVela, and Grafana’s Thema framework use CUE to manage schema evolution and configuration validation.

The formation of CUE Labs in 2025, backed by major venture capital firms, signals growing commercial investment in the language. The company announced a Central Registry for sharing verified CUE modules and a Configuration Control Plane product aimed at enterprise configuration management.

CUE is implemented entirely in Go and distributed as a Go module, with a Go API available for programmatic use. The project is licensed under Apache 2.0 and hosted at github.com/cue-lang/cue.

Why It Matters

CUE represents a principled rethinking of how configuration should work at scale. By grounding its design in lattice theory and computational linguistics rather than conventional programming language constructs, CUE demonstrates that configuration validation and data integrity can be achieved without Turing-completeness or inheritance hierarchies. Its mathematical guarantees — that constraints compose deterministically regardless of order — address a real and costly problem: the configuration errors that cause outages in distributed systems. As cloud-native infrastructure grows more complex, CUE’s approach to taming configuration through constraints rather than code offers a compelling alternative to the status quo.

Timeline

2019
First public release (v0.0.2) on June 22 under github.com/cuelang/cue; approximately 15 releases through v0.0.15 by December
2020
v0.1.0 released (April 10), introducing streamlined CLI, Docker image auto-generation, and Protobuf/OpenAPI/JSON Schema interoperability
2020
v0.2.0 released (May 20), introducing '#'-based definition syntax replacing the '::' notation — a significant language change
2021
v0.3.0 released (April 2), described as the first large step toward a backwards compatibility guarantee
2021
Repository migrated from cuelang/cue to cue-lang/cue; original repo archived in November
2022
Dagger, the CI/CD platform founded by Docker creator Solomon Hykes, adopts CUE as its declarative pipeline definition language (later ended CUE SDK support in December 2023 in favor of general-purpose language SDKs)
2025
v0.15.0 released with initial Language Server Protocol (LSP) support and removal of legacy evaluator
2025
v0.16.0 released (March 3), featuring up to 80% speed-ups on some large projects from type checker caching improvements, alongside similar gains for very large structs
2025
CUE Labs emerges from stealth in October with over $10M in funding from Sequoia Capital, OSS Capital, Founders Fund, and Dell Technologies Capital

Notable Uses & Legacy

Dagger

CI/CD platform founded by Docker creator Solomon Hykes originally used CUE as its core declarative pipeline definition language for composing build and deployment actions. Dagger ended CUE SDK support in December 2023, shifting to general-purpose language SDKs (Go, Python, Node.js) based on user feedback.

Istio

The service mesh project uses CUE to generate OpenAPI schemas and Custom Resource Definitions (CRDs) for Kubernetes.

Grafana (Thema)

Grafana developed Thema, a CUE-based framework for writing portable, evolvable schemas to solve version coordination across Grafana's schema ecosystem.

KubeVela

CNCF application delivery platform that uses CUE at the core of its abstraction layer, where platform engineers define component, trait, policy, and workflow step definitions.

Mercari

Japanese e-commerce company developed Kubernetes Kit (k8s-kit), a CUE-based abstraction of Kubernetes manifests to simplify configuration and reduce cognitive load for developers.

Language Influence

Influenced By

Go JSON Jsonnet HCL TypeScript Prolog

Running Today

Run examples using the official Docker image:

docker pull cuelang/cue:latest

Example usage:

docker run --rm -v $(pwd):/cue -w /cue cuelang/cue:latest eval hello.cue
Last updated: