Skip to main content
CUE (Configure, Unify, Execute) is another well-regarded schema language, useful for defining valid fields, types, and values for a config. CUE was developed at Google by Marcel van Lohuizen, one of the original creators of Go. The original motivation stemmed from Google’s internal struggles in managing complex, large-scale configurations for infrastructure and applications. JSON and YAML were too weak for expressing constraints, logic, or composition, so CUE set out to solve that. Instead of building and managing external tools to validate, patch, or generate configs, CUE itself is a fully programmable config engine. This means CUE wholly encapsulates the configuration data, the schema, and the logic (how to derive those config values).

Example

Below is an example CUE schema:
CUE
Although many of CUE’s capabilities are omitted in this example, you’ll find some of the most commonly used features, including:
  • type specification - number, string, bool, etc.
  • numeric constraints- >=, <=, ==, !=, =~, !~, etc.
  • default values - | *value
  • enumerations - | "value1" | "value2" | "value3"
  • intersection of constraints - &
As you can see, CUE inlines constraints directly with type definitions, making schemas significantly more concise than JSON Schema. For more information on the supported features of CUE, check out the CUE tour on the official CUE website.

CUE version

Miru fully supports CUE and stays up to date with the latest CUE features and syntax. Currently, Miru uses CUE API v0.14.2.

File formats

Unlike JSON Schema, CUE can only be written in the CUE file format and must have the .cue extension:
  • CUE (.cue)
Similar to JSON Schema, CUE schemas can validate config instances in formats other than CUE. The following formats are supported:
  • JSON (.json)
  • YAML (.yaml, .yml)
YAML support requires Miru Agent v0.7.0 or newer

CUE packages

CUE supports the concept of a package—a way to spread a schema’s definition across multiple files. For example, say we have a communication schema which contains the following files:
communication
peripherals.cue
network.cue
sensors.cue
main.cue
Each file defines a portion of the schema, which is then aggregated by the main.cue file to define the schema. Miru fully supports CUE packages, treating the communication directory as a single schema. Identifying packages The Miru CLI automatically identifies CUE packages for you when creating a release using the package clause at the top of each schema file (as described in the CUE documentation). You don’t need to explicitly specify the package in the CLI command—just provide the path to the package directory or to the individual schema files within the package. Annotations To annotate a CUE package, annotate exactly one file in the package. Annotating multiple files or no files will result in an error.
Last modified on July 21, 2026